fix(models): merge live API results with curated static catalog in generic provider path
When a provider's live /v1/models endpoint returns a stale or incomplete list (e.g. Z.AI missing glm-5.2), the generic profile-based code path returned only the live results, silently dropping curated models. Generalize the kimi-coding merge pattern to all providers: live entries come first (provider's preferred order), then curated-only entries are appended with case-insensitive dedup. This ensures models that the live endpoint omits still appear in /model picker. Fixes #46850
This commit is contained in:
@@ -114,7 +114,8 @@ class TestProviderModelIdsPreferred:
|
||||
patch("providers.base.ProviderProfile.fetch_models", return_value=["kimi-k2.6"]),
|
||||
):
|
||||
out = provider_model_ids("kimi-coding")
|
||||
assert out[:2] == ["kimi-k2.7-code", "kimi-k2.6"]
|
||||
# Live-first order; curated-only (k2.7-code) appended after live
|
||||
assert out[:2] == ["kimi-k2.6", "kimi-k2.7-code"]
|
||||
|
||||
def test_kimi_setup_flow_uses_same_coding_plan_catalog(self):
|
||||
"""The setup wizard must not carry a stale duplicate Kimi model list."""
|
||||
|
||||
Reference in New Issue
Block a user