diag(executor): 扩展语义拒绝诊断日志覆盖范围,进一步定位 zhipu [1210] 真因#247
Merged
Conversation
在 execute_message 和 execute_stream 的 semantic rejection 日志中 附加请求体参数快照(thinking/extended_thinking/reasoning_effort 顶层参数、 会话历史中 thinking blocks 数量、cache_control 存在情况、模型名、消息数), 用于定位 zhipu glm-4.7 [1210] 参数校验拒绝的具体祸根参数。 🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist) Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
…t_types 等维度 PR #244 部署后的诊断日志反转了原推断:失败请求均不含 thinking/cache_control, 说明祸根在更细粒度的参数。扩展 _build_semantic_rejection_diagnostic 函数: 新增维度(仅存在时输出): - system 形态(string/blocks + cache_control 计数) - tools 数量 + tool_choice 形态 - 采样参数(max_tokens/temperature/top_p/top_k/stop_sequences) - stream / metadata_keys - messages.content 类型分布(含 string content) - 请求体字节数估算(json.dumps) 新增 14 个单元测试(TestBuildSemanticRejectionDiagnostic)覆盖各字段组合 与真实失败请求形态。所有测试通过(1478 passed)。
- pyproject.toml: 版本号取上游 0.4.1a8 - tests/test_router_executor.py: 保留两侧新增的 import 与测试类(TestBuildSemanticRejectionDiagnostic + TestSanitizeUserText + TestExtractSessionTitle) - uv.lock: 同步版本号并重新生成 🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist) Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR #244 部署后的诊断日志推翻了原推断 —— 失败请求均不含
thinking/cache_control,说明祸根在更细粒度的参数。本 PR 扩展诊断函数覆盖范围至system / tools / sampling / metadata / content_types / body_bytes等维度,并配套 14 个单元测试。Context
messages=1、无 thinking、无 cache_control、tokens=[0 0 0 0] duration<1s,被 zhipu 在入口阶段直接拒绝glm-5-turbo(用户当前配置claude-haiku-* → glm-5-turbo),而非先前推测的 glm-4.7Changes
src/coding/proxy/routing/executor.py:扩展_build_semantic_rejection_diagnostic函数tests/test_router_executor.py:新增TestBuildSemanticRejectionDiagnostic类(14 个用例)docs/agents/issue.md:记录 [1210] 问题的诊断阶段进展pyproject.toml/uv.lock:版本号升级至 0.4.1a6Diagnostic fields added (all optional)
system_kind=string(len=N)/system_blocks=N[,cc=K]tools=N+tool_choice=...max_tokens/temperature/top_p/top_k/stop_sequences=Nstream=true/false+metadata_keys=Ncontent_types={text:5,tool_use:2}body_bytes=NTest plan
uv run pytest tests/→ 1478 passeduv run ruff check src/ tests/→ All checks passeduv run ruff format src/ tests/→ 已格式化