fix(model-switch): keep same-endpoint custom providers with different names as separate picker rows - #67747
Closed
craigdfrench wants to merge 1 commit into
Closed
Conversation
… names as separate picker rows
Contributor
|
Merged via PR #67925 — your commit was cherry-picked onto current main with your authorship preserved in git log. This was exactly the right shape: extending the existing identity tuple instead of replacing it kept the credential/mode/headers safeguards intact, and the suffix-fold tests made the behavioral contract explicit. One small follow-up on our side: your test-mock additions for the three Ollama-flaky tests were dropped in favor of #62421's #67751 (excluded_providers) is next in the review queue now that this base has landed. Thanks! |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Multiple
custom_providersentries sharing the samebase_url(e.g. an aggregating proxy fronting multiple upstream providers at one URL) collapsed into a single picker row under the first entry's name. Users who configured separate entries for distinct sub-providers behind one endpoint saw all their models merged into one row, defeating the purpose of splitting them.Fix
Extends the
group_keyinlist_authenticated_providers()with a display-name prefix dimension:The display prefix is the text before an em-dash (
—) or space-hyphen-space (-) in the entry name. This means:key_envorapi_modestay separate (credential_identity / api_mode preserved — no regression).Why this is a bug fix, not a feature
The current grouping logic assumes all entries sharing an endpoint are duplicates of the same provider. This is wrong for aggregating proxies — users intentionally configure multiple entries pointing at the same URL to represent distinct upstream providers, each with their own model subset. The picker silently merging them destroys that configuration.
Tests
test_shared_url_different_display_names_are_separate_rows— three entries sharing base_url+api_key+api_mode but different names → three rows.test_shared_url_per_model_suffix_still_collapses— "Ollama — A"/"Ollama — B" still collapse into one "Ollama" row.fetch_api_modelsmock).Usage
Set
discover_models: falseand an explicitmodelslist on each sub-provider entry:Each entry appears as its own row in the
/modelpicker.Supersedes the grouping fix portion of #28218.