fix(tiers): 修复 Zhipu 非流式 429 无法触发 tier 降级#123
Merged
Conversation
根因:factory.py 中 ZhipuVendor 构造时未传入 failover_cfg 参数, 导致 BaseVendor._failover_config 为 None,should_trigger_failover() 永远返回 False。 当 Zhipu 在 message(非流式)路径返回临时 429 时,executor 无法判定应降级, 直接将 429 原样返回给客户端导致任务中断。 修复: - zhipu.py: __init__ 新增 failover_config 可选参数并转发至基类 - factory.py: _create_vendor_from_config 中给 ZhipuVendor 注入 failover_cfg - test_router_executor.py: 新增 TestExecuteMessageFailoverOn429 测试类(5 个用例) 测试结果:971/971 passed,零回归 🤖 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.
Summary
factory.py中ZhipuVendor构造时未传入failover_cfg,导致BaseVendor._failover_config = None,should_trigger_failover()永远返回False变更文件
src/coding/proxy/vendors/zhipu.py__init__新增failover_config可选参数并转发至基类src/coding/proxy/server/factory.py_create_vendor_from_config给ZhipuVendor注入failover_cfgtests/test_router_executor.pyTestExecuteMessageFailoverOn429测试类(5 个用例)测试验证
修复后行为
🤖 Generated with Claude Code, CodeX, Gemini