Skip to content

fix(VendorConfig): 修复原生 Anthropic 兼容供应商共享字段误报跨供应商警告#138

Merged
ThreeFish-AI merged 1 commit into
feature/1.x.xfrom
vk/46a9-fix-vendorconfig
Apr 9, 2026
Merged

fix(VendorConfig): 修复原生 Anthropic 兼容供应商共享字段误报跨供应商警告#138
ThreeFish-AI merged 1 commit into
feature/1.x.xfrom
vk/46a9-fix-vendorconfig

Conversation

@ThreeFish-AI

@ThreeFish-AI ThreeFish-AI commented Apr 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • 修复 _warn_irrelevant_fields 验证器的共享字段误报问题:当配置 vendor=zhipu 并设置 api_key 后,启动服务会输出多条误报警告(字段 api_key 属于 minimax/kimi/doubao/xiaomi/alibaba 供应商,当前值将被忽略
  • 根因_VENDOR_EXCLUSIVE_FIELDS 中 zhipu/minimax/kimi/doubao/xiaomi/alibaba 均映射到同一个 _NATIVE_ANTHROPIC_FIELDS{"api_key"}),但验证器仅跳过同名供应商(vendor_type == self.vendor),未跳过共享相同字段集的其他供应商
  • 修正测试 logger 名称coding.proxy.config.schemacoding.proxy.config.routing,与实际 logger 模块路径一致

Changes

文件 变更
src/coding/proxy/config/routing.py 内层循环新增 if field_name in exclusive: continue,跳过与当前 vendor 共享的合法字段
tests/test_schema.py 修正 5 处 logger 名称;新增 test_no_warning_for_native_anthropic_shared_fields 测试用例

Test plan

  • uv run pytest tests/test_schema.py -v — 16 tests passed(含新增用例)
  • uv run pytest tests/ -v — 1127 tests passed,零回归
  • uv run coding-proxy start — 启动时无误报警告输出

🤖 Generated with Claude Code, CodeX, Gemini

_warn_irrelevant_fields 验证器仅跳过同名供应商,未处理共享字段集的供应商组,
导致 zhipu 配置 api_key 时误报"属于 minimax/kimi/doubao/xiaomi/alibaba 供应商"。
新增 field_name in exclusive 判断,跳过与当前 vendor 共享的字段;
同时修正测试 logger 名称并新增共享字段测试用例。

🤖 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 changed the title /fix 启动服务时出现一段如下提示(VendorConfig(vendor=zhipu): 字段 api_key 属于 xxx 供应商,当前值将被忽略),这不是预期的,分析原因并修正: (vibe-kanban) fix(VendorConfig): 修复原生 Anthropic 兼容供应商共享字段误报跨供应商警告 Apr 9, 2026
@ThreeFish-AI
ThreeFish-AI merged commit d3082b0 into feature/1.x.x Apr 9, 2026
6 checks passed
@ThreeFish-AI
ThreeFish-AI deleted the vk/46a9-fix-vendorconfig branch April 9, 2026 15:43
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