Fix model picker to handle metadata.id collisions between vendors#317170
Draft
vritant24 wants to merge 1 commit into
Draft
Fix model picker to handle metadata.id collisions between vendors#317170vritant24 wants to merge 1 commit into
vritant24 wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the chat model picker collision handling so models from different vendors that share the same metadata.id are not hidden from the grouped picker.
Changes:
- Separates placement tracking for globally unique model identifiers vs control-manifest ids.
- Preserves the first metadata-id lookup entry for legacy/id-based resolution.
- Adds regression tests for BYOK/Copilot metadata-id collisions.
Show a summary per file
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.ts |
Adjusts grouped picker placement and Other Models filtering for metadata-id collisions. |
src/vs/workbench/contrib/chat/test/browser/widget/input/chatModelPicker.test.ts |
Adds regression coverage for BYOK models sharing metadata ids with Copilot models. |
Copilot's findings
Comments suppressed due to low confidence (2)
src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.ts:623
- Surfacing colliding BYOK models in Other Models is incomplete because the rendering path below still looks up
controlModels[model.metadata.id]. A Copilot control entry with aminVSCodeVersionfor this id will disable the BYOK model as unavailable even though that manifest entry only describescopilot/<id>; Other Models should avoid applying Copilot-only control entries to non-Copilot models with the same metadata id.
// Filter only by identifier — metadata.id is not unique across
// vendors, so a BYOK model with the same metadata.id as an
// already-placed Copilot model must still be surfaced here.
otherModels = models.filter(m => !placedIdentifiers.has(m.identifier));
src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.ts:533
- This promoted-model path still applies
controlModels[model.metadata.id]after resolving by a full model identifier. If the selected or recent model is a BYOK model whose metadata id collides with a Copilot entry, the Copilot entry's version gate/unavailable metadata can disable or relabel the BYOK model; only apply metadata-id control entries to the Copilot model they describe.
if (model && !placedIdentifiers.has(model.identifier)) {
markModelPlaced(model);
const entry = controlModels[model.metadata.id];
- Files reviewed: 2/2 changed files
- Comments generated: 2
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.
No description provided.