Fix default model rehydration when providers share slash-qualified model IDs#1326
Fix default model rehydration when providers share slash-qualified model IDs#1326hacker1e7 wants to merge 2 commits intonesquena:masterfrom
Conversation
|
Pushed a small follow-up fix for the session picker PRIMARY badge issue when duplicate slash-qualified model IDs exist across providers. This makes both the backend badge mapping and the UI badge lookup provider-aware, and adds coverage for the regression. |
|
Thanks for the patch. The two-part approach lines up with how #1313 manifests:
The follow-up commit on the session picker PRIMARY badge is a nice catch — same root cause (badge lookup keyed on bare id) and worth folding into the same PR rather than splitting. Will review the diff in One thing worth confirming on review: that the prefixed values round-trip through |
|
Thanks — I also sanity-checked the persistence path locally. Saving a prefixed duplicate still writes the CLI-safe bare/slash model plus the matching |
|
Thanks for the persistence-path sanity check. That confirms the round-trip I was worried about:
So a user who has a colliding model selected today won't get their preference dropped after this lands — the prefix is purely a dropdown-value uniqueness mechanism and doesn't bleed into persisted config. Will move to review. The PRIMARY-badge follow-up commit fits in this PR rather than getting split, since both bugs share the same root cause (lookup keyed on bare id without provider context). |
|
Shipped in v0.50.245 via batch release PR #1334 (merge commit Released alongside 9 other contributor fixes — see the v0.50.245 entry in CHANGELOG.md. |
…lified IDs (nesquena#1313) From PR nesquena#1326. Co-authored-by: hacker2005 <[email protected]>
…lified IDs (nesquena#1313) From PR nesquena#1326. Co-authored-by: hacker2005 <[email protected]>
Summary
Fixes the default-model Preferences dropdown when multiple providers expose the same slash-qualified model id (for example
google/gemma-4-27b).Previously,
_deduplicate_model_ids()only disambiguated bare ids and skipped slash-qualified ids entirely. That left duplicate<option value>entries in the dropdown, so reopening Preferences could snap the saved default model back to the first provider that exposed the same id.What changed
_deduplicate_model_ids()to also de-duplicate repeated slash-qualified ids@provider_id:<original_id>active_providerwhen rehydrating a saved default modelWhy this fixes #1313
The bug was not only that duplicate slash ids existed in the dropdown, but also that default-model rehydration only matched by value/normalized id. With this patch:
Tests
Added regression coverage for:
@provider_id:<original_id>Closes #1313.