refactor: remove redundant 'id' property from model control entries in chat model picker#296476
Merged
refactor: remove redundant 'id' property from model control entries in chat model picker#296476
Conversation
…n chat model picker
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the chat model picker to remove the redundant id property from IModelControlEntry. Since these entries are stored in dictionaries keyed by their ID, storing the ID again as a property was redundant. The refactoring extracts the ID from the dictionary key when needed and passes it separately where required.
Changes:
- Removed
idproperty fromIModelControlEntryinterface - Updated code to use dictionary keys (via
Object.entries()) instead ofentry.id - Modified
createUnavailableModelItem()to acceptidas a separate parameter - Updated all test fixtures to remove the redundant
idproperty
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/vs/workbench/contrib/chat/common/languageModels.ts |
Removed id from IModelControlEntry interface; updated _setModelsControlManifest() to not copy id into dictionary values |
src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.ts |
Changed featured models loop from Object.values() to Object.entries() to access keys; added id parameter to createUnavailableModelItem() and updated all call sites; updated PromotedItem type to include id for unavailable items |
src/vs/workbench/contrib/chat/test/browser/widget/input/chatModelPicker.test.ts |
Removed redundant id property from all test fixture data (17 occurrences) |
alexr00
approved these changes
Feb 20, 2026
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.