Fix language model picker visibility#316843
Open
ZardLi1115 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes language model picker visibility handling by treating isUserSelectable as “visible unless explicitly false”, and adds a persisted per-model toggle in the Manage Models UI while keeping provider configuration separate from picker visibility overrides.
Changes:
- Update model filtering to hide only models with
isUserSelectable === false(so third-party models that omit the flag still appear). - Persist a per-model “show/hide in model picker” toggle via
ILanguageModelsService.setModelPickerVisibility. - Ensure
isUserSelectableoverrides are applied fromchatLanguageModels.jsonwithout polluting provider model configuration.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/mcp/browser/mcpCommands.ts | Adjusts MCP sampling model picker to exclude only explicitly hidden models. |
| src/vs/workbench/contrib/chat/test/common/languageModels.ts | Updates test service stub to satisfy new ILanguageModelsService API. |
| src/vs/workbench/contrib/chat/test/common/languageModels.test.ts | Adds coverage for persisted picker visibility and ensures visibility isn’t treated as provider config. |
| src/vs/workbench/contrib/chat/test/browser/chatManagement/chatModelsViewModel.test.ts | Updates mock service to support picker visibility updates and fire change events. |
| src/vs/workbench/contrib/chat/common/languageModels.ts | Adds setModelPickerVisibility, applies isUserSelectable overrides from settings, and separates visibility from provider config. |
| src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.ts | Extends generated JSON schema to expose isUserSelectable as a configurable per-model setting. |
| src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.ts | Adds per-model actions to hide/show models in the picker via the new service API. |
| src/vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessionsActions.ts | Updates session model availability filtering to hide only explicitly non-selectable models. |
Comment on lines
+1220
to
+1237
| const allGroups = this._languageModelsConfigurationService.getLanguageModelsProviderGroups(); | ||
| let group = allGroups.find(g => g.vendor === metadata.vendor && g.settings?.[metadata.id] !== undefined); | ||
| if (!group) { | ||
| group = allGroups.find(g => g.vendor === metadata.vendor); | ||
| } | ||
|
|
||
| const existingSettings = (group?.settings as IStringDictionary<IStringDictionary<unknown>> | undefined) ?? {}; | ||
| const updatedModelSettings = { | ||
| ...(existingSettings[metadata.id] ?? {}), | ||
| [MODEL_PICKER_VISIBILITY_SETTING]: visible | ||
| }; | ||
| const updatedSettings = { ...existingSettings, [metadata.id]: updatedModelSettings }; | ||
|
|
||
| if (group) { | ||
| await this._languageModelsConfigurationService.updateLanguageModelsProviderGroup(group, { | ||
| ...group, | ||
| settings: updatedSettings | ||
| }); |
Author
|
@microsoft-github-policy-service agree |
This was referenced May 17, 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.
Summary
isUserSelectableoverrides fromchatLanguageModels.jsonwhile keeping provider model configuration separateisUserSelectable: falseas hidden so third-party models that omit the flag still appear in model pickersTests
git diff --checknpm run compile-check-ts-native(blocked: this workspace has an incompletenode_modulestree andtsgois missing;npm ciand targeted package install did not restore executable packages)event-streammissing fromnode_modules)Fixes #316481