Two bugs in get_available_models() conspired to duplicate the active provider's auto-detected models under a phantom 'Custom' group whenever custom_providers was also declared in config.yaml: 1. custom:* PIDs not in _named_custom_groups (e.g. stale slugs left from prior configs) fell through to the auto_detected_models fallback, copying the active provider's whole catalog into a phantom Custom: <slug> group. Fix: continue unconditionally for ANY custom:* PID — the named-group branch is the only legitimate population path. 2. The bare 'custom' PID, with the active provider being concrete (e.g. ai-gateway), hit 'elif auto_detected_models: copy.deepcopy(...)' and built a duplicate Custom group of the active provider's models with mismatched provider prefixes. Fix: when pid == 'custom' and the active provider is non-custom, leave models_for_group empty. The reporter also suggested a third fix gating resolve_model_provider() on config_provider — that's intentionally NOT applied because it conflicts with the long-standing model-specific-override semantics covered by test_model_resolver.py::test_custom_provider_*_routes_to_named_custom_provider (custom_providers entries explicitly override the active provider's routing when the user opted-in). The reporter's symptom (duplicate UI group) lives entirely in get_available_models()'s group construction and is fully fixed by the two changes above. Tests: 6 new regression tests (3 in #1881 file + reuse), 774 broader tests still green (model/provider/custom/config domain). |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| agent_health.py | ||
| agent_sessions.py | ||
| auth.py | ||
| background.py | ||
| clarify.py | ||
| commands.py | ||
| config.py | ||
| dashboard_probe.py | ||
| extensions.py | ||
| gateway_watcher.py | ||
| helpers.py | ||
| kanban_bridge.py | ||
| metering.py | ||
| models.py | ||
| oauth.py | ||
| onboarding.py | ||
| profiles.py | ||
| providers.py | ||
| rollback.py | ||
| routes.py | ||
| session_ops.py | ||
| session_recovery.py | ||
| startup.py | ||
| state_sync.py | ||
| streaming.py | ||
| system_health.py | ||
| terminal.py | ||
| updates.py | ||
| upload.py | ||
| workspace.py | ||