Skip to content

test: add edge case tests for llm request rules#13

Open
jgbai wants to merge 1 commit into
alexazhou:masterfrom
jgbai:test/llm-request-rules
Open

test: add edge case tests for llm request rules#13
jgbai wants to merge 1 commit into
alexazhou:masterfrom
jgbai:test/llm-request-rules

Conversation

@jgbai

@jgbai jgbai commented Jun 2, 2026

Copy link
Copy Markdown

补充 llm request rules 的边界场景测试用例。

新增 8 个测试:

StripRequiredToolChoiceForReasoningRule 边界场景:

  • reasoning_effort 为空字符串时不触发
  • tool_choice 为 None 时不触发
  • provider_params 为空字典时不触发

FillMissingReasoningContentRule 边界场景:

  • 纯文本 assistant 消息(无 tool_calls)不触发
  • provider_params 为空字典时不触发
  • thinking 为非 dict 值(如字符串)时不触发

组合场景:

  • 两条规则同时触发
  • 无任何规则匹配时请求原样返回

原有 7 个 + 新增 8 个 = 共 15 个测试,全部通过。

- StripRequiredToolChoiceForReasoningRule: reasoning_effort empty string,
  tool_choice None, provider_params empty dict
- FillMissingReasoningContentRule: plain assistant message without
  tool_calls, provider_params empty dict, thinking as non-dict value
- Both rules triggered simultaneously
- No rules triggered when no conditions match
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant