Skip to content

Fix language model picker visibility#316843

Open
ZardLi1115 wants to merge 2 commits into
microsoft:mainfrom
ZardLi1115:fix-316481-llm-model-selection
Open

Fix language model picker visibility#316843
ZardLi1115 wants to merge 2 commits into
microsoft:mainfrom
ZardLi1115:fix-316481-llm-model-selection

Conversation

@ZardLi1115
Copy link
Copy Markdown

Summary

  • add a persisted model picker visibility toggle in the Manage Models panel
  • apply isUserSelectable overrides from chatLanguageModels.json while keeping provider model configuration separate
  • treat only explicit isUserSelectable: false as hidden so third-party models that omit the flag still appear in model pickers

Tests

  • git diff --check
  • npm run compile-check-ts-native (blocked: this workspace has an incomplete node_modules tree and tsgo is missing; npm ci and targeted package install did not restore executable packages)
  • pre-commit hook was bypassed for the same incomplete dependency tree (event-stream missing from node_modules)

Fixes #316481

Copilot AI review requested due to automatic review settings May 17, 2026 02:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 isUserSelectable overrides are applied from chatLanguageModels.json without 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
});
@ZardLi1115
Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Large Language Model Selection and Panel Bug

4 participants