refactor(vendor-channels): 将 vendor 转换专属函数从 request_normalizer 迁入 vendor_channels 统一维护#193
Merged
Merged
Conversation
…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>
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.
摘要
将供应商转换专属函数从
request_normalizer.py迁入vendor_channels.py统一维护,消除 vendor 兼容逻辑的分散管理。关键变更
vendor_channels.pyenforce_anthropic_tool_pairing和strip_thinking_blocks,合并_strip_thinking_blocks_inplace为统一的strip_thinking_blocks公开函数request_normalizer.pyapply_anthropic_specific_fixes、_repair_orphaned_tool_use、_emit_misplaced_tool_result_summary),精简NormalizationResult仅保留 Phase 1 字段routes.py/router.py/executor.pynormalization死参数三层透传链routes.pycount_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 的三层透传测试验证
🤖 Generated with Claude Code, CodeX, Gemini
Co-Authored-By: Aurelius Huangthreefish.ai@gmail.com