Skip to content

refactor(vendor-channels): 将 vendor 转换专属函数从 request_normalizer 迁入 vendor_channels 统一维护#193

Merged
ThreeFish-AI merged 1 commit into
feature/1.x.xfrom
vk/a921-fix-vendor-zhipu
Apr 18, 2026
Merged

refactor(vendor-channels): 将 vendor 转换专属函数从 request_normalizer 迁入 vendor_channels 统一维护#193
ThreeFish-AI merged 1 commit into
feature/1.x.xfrom
vk/a921-fix-vendor-zhipu

Conversation

@ThreeFish-AI

Copy link
Copy Markdown
Owner

摘要

将供应商转换专属函数从 request_normalizer.py 迁入 vendor_channels.py 统一维护,消除 vendor 兼容逻辑的分散管理。

关键变更

文件 变更
vendor_channels.py 迁入 enforce_anthropic_tool_pairingstrip_thinking_blocks,合并 _strip_thinking_blocks_inplace 为统一的 strip_thinking_blocks 公开函数
request_normalizer.py 移除已废弃的 Phase 2 逻辑(apply_anthropic_specific_fixes_repair_orphaned_tool_use_emit_misplaced_tool_result_summary),精简 NormalizationResult 仅保留 Phase 1 字段
routes.py / router.py / executor.py 移除 normalization 死参数三层透传链
routes.py count_tokens 端点的 strip_thinking_blocks 导入改为从 vendor_channels

移除的废弃代码

  • apply_anthropic_specific_fixes() — 已被 enforce_anthropic_tool_pairing() 替代
  • _repair_orphaned_tool_use() — 已被 enforce_anthropic_tool_pairing() 内含
  • _emit_misplaced_tool_result_summary() — 已废弃
  • NormalizationResult.has_cross_vendor_signals / has_anthropic_fixes — 死属性
  • normalization 参数在 routes → router → executor 的三层透传

测试验证

  • 1252 测试全通过,无回归

🤖 Generated with Claude Code, CodeX, Gemini
Co-Authored-By: Aurelius Huangthreefish.ai@gmail.com

…dor_channels 统一维护;

移除 request_normalizer.py 中已废弃的 Phase 2 逻辑(apply_anthropic_specific_fixes、_repair_orphaned_tool_use 等),
将 enforce_anthropic_tool_pairing 和 strip_thinking_blocks 移入 vendor_channels.py,
合并重复的 _strip_thinking_blocks_inplace 为统一的 strip_thinking_blocks 公开函数,
移除 normalization 参数在 routes→router→executor 三层透传中的死参数链,
精简 NormalizationResult 仅保留 Phase 1 必要字段。

🤖 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>
@ThreeFish-AI
ThreeFish-AI merged commit 0774766 into feature/1.x.x Apr 18, 2026
6 checks passed
@ThreeFish-AI
ThreeFish-AI deleted the vk/a921-fix-vendor-zhipu branch April 18, 2026 08:54
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