fix(provider):删除误加入模型发现逻辑问题#566
Conversation
There was a problem hiding this comment.
Found 2 issues worth addressing. The main regression is that discovery for several non-openaicompat OpenAI-compatible drivers is now silently turned into an empty success path, while the rest of the config/selection stack still allows model_source: discover for those drivers.
| return nil, err | ||
| } | ||
| return p.DiscoverModels(ctx) | ||
| return nil, nil |
There was a problem hiding this comment.
Discover now returns nil, nil, which silently breaks custom providers that still use the dedicated deepseek/qwen/glm/mimo/minimax drivers with model_source: discover. The config layer still treats those drivers as discovery-capable (isOpenAICompatLike / custom-provider normalization), and provider add still defaults custom providers to discovery, so this changes a supported path into "success with zero models" instead of surfacing a config error. If discovery is intentionally unsupported now, these drivers should reject discovery explicitly; otherwise keep the old /models implementation.
| @@ -371,74 +354,6 @@ func TestDiscoverContractAcrossDrivers(t *testing.T) { | |||
| expectedHeader: "x-api-key", | |||
There was a problem hiding this comment.
These discovery contract cases were removed without adding any replacement assertion for the new contract. That leaves the regression above completely untested: the suite no longer verifies either /models compatibility or that model_source: discover is rejected for these drivers. Please add a test that covers whichever behavior is now intended, otherwise this config/code drift will keep passing CI.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
/code 提高测试覆盖率到100% |
已完成已补充这次 PR 缺失的覆盖用例,并推送到当前分支 本次补测聚焦 Codecov 指出的缺口:
已验证:
提交: |
Generated with [codeagent](https://github.com/qbox/codeagent) Co-authored-by: phantom5099 <245659304+phantom5099@users.noreply.github.com>
No description provided.