Add per-model configuration support for language models#302771
Merged
Add per-model configuration support for language models#302771
Conversation
… for per-model options
… interface and revert chatProvider version to 4
…te ActionsColumnRenderer
…th user config in sendChatRequest
…onfigurations directly to resolved models
…pSchema.title and enhancing formatting
…in LanguageModelsService
…ed model picker functionality
…sService for toolbar actions
…e gear button for context menu access
…nd updating visibility styles
…ess and improve toolbar action handling
… improve context menu handling
…ns that opens an inline menu
…ent management and layout adjustments
…e hover interactions
…ion label as group title
…ify navigation properties handling and remove unused language models service references
…on values display in model picker
…d support for enum icons in model configuration
…eplace enumIcons with a single icon property for configuration
…emove icon property from configuration schema
…tions and related hover logic
…er is opened by the ModelConfigPickerActionItem view item on click
…move OpenModelConfigPickerAction and chatModelHasNavigationConfig context key The config picker dropdown button in the chat input has been removed while keeping the underlying per-model configuration API, settings support, and model management editor intact. Also fix ILanguageModelConfigurationSchema to not include boolean in properties type (incompatible with IJSONSchema), and add showUnavailableFeatured/showFeatured to IModelPickerDelegate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…inition for clarity
…ify default checks
- Make showUnavailableFeatured/showFeatured optional on IModelPickerDelegate (defaults to true), removing the need to change newChatViewPane.ts - Fix sendChatRequest merge order: caller's configuration takes precedence over stored model config - Remove dead typeof propSchema !== 'boolean' checks after type cleanup Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
These files were modified to add showUnavailableFeatured/showFeatured which already landed on main separately. Revert to merge-base versions to keep the diff clean. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Revert to merge-base version — the diff was from main changes (delegation picker, showUnavailableFeatured/showFeatured) that will come in on merge. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds per-model configuration support for language models, allowing model providers to declare configurable per-model settings (via a schema) and having resolved configuration flow through core, UI, and the extension host into providers/participants.
Changes:
- Extend proposed API to allow models to declare a
configurationSchemaand to expose resolvedmodelConfigurationon requests. - Implement per-model configuration resolution/storage in
LanguageModelsServiceand surface enum-based config actions in the model management UI. - Propagate resolved configuration through chat requests (including subagent invocations) and add unit tests for config merging/defaults.
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vscode-dts/vscode.proposed.chatProvider.d.ts | Adds proposed API surface for per-model config schema + resolved config on requests. |
| src/vs/workbench/contrib/chat/common/languageModels.ts | Core implementation: config caching, merging defaults, persistence, and UI actions. |
| src/vs/workbench/contrib/chat/common/languageModelsConfiguration.ts | Extends provider group model to include settings for per-model config. |
| src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.ts | Adds JSON schema/intellisense support for settings in chatLanguageModels.json. |
| src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.ts | Adds model gear/context menu entries for per-model configuration actions. |
| src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.ts | Carries model configuration into chat agent request construction. |
| src/vs/workbench/contrib/chat/common/participants/chatAgents.ts | Extends IChatAgentRequest to include modelConfiguration. |
| src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.ts | Forwards model configuration into subagent invocations. |
| src/vs/workbench/api/common/extHostTypeConverters.ts | Exposes model configuration on vscode.ChatRequest objects. |
| src/vs/workbench/api/common/extHostLanguageModels.ts | Passes resolved per-model config into provider options (modelConfiguration). |
| src/vs/workbench/api/common/extHostChatSessions.ts | Threads modelConfiguration through session request handling. |
| src/vs/workbench/api/common/extHostChatAgents2.ts | Threads modelConfiguration through agent/detector request conversion. |
| src/vs/workbench/api/common/extHost.protocol.ts | Updates protocol types for request options plumbing. |
| src/vs/workbench/contrib/chat/test/common/languageModels.ts | Updates mock service surface to match new ILanguageModelsService API. |
| src/vs/workbench/contrib/chat/test/common/languageModels.test.ts | Adds unit tests for resolved per-model config and default merging. |
| src/vs/workbench/contrib/chat/test/browser/chatManagement/chatModelsViewModel.test.ts | Updates mock service to satisfy new interface requirements. |
Comments suppressed due to low confidence (2)
src/vs/workbench/contrib/chat/common/languageModels.ts:1098
- Default-value pruning uses
propSchema.default === value, which will fail for non-primitive defaults (objects/arrays) and can leave default values persisted. Consider using the existingequals(...)helper (already imported) for JSON-schema defaults, or otherwise ensuring deep equality when comparing defaults.
if (schema?.properties) {
for (const [key, value] of Object.entries(updatedConfig)) {
const propSchema = schema.properties[key];
if (propSchema?.default !== undefined && propSchema.default === value) {
delete updatedConfig[key];
}
}
src/vs/workbench/contrib/chat/common/languageModels.ts:1074
- New behavior in
setModelConfiguration(merging values, pruning defaults, and updating/removing groups) isn’t covered by tests. Adding unit tests for default-pruning and group removal/creation would help prevent regressions as the per-model settings format evolves.
async setModelConfiguration(modelId: string, values: IStringDictionary<unknown>): Promise<void> {
const metadata = this._modelCache.get(modelId);
if (!metadata) {
return;
}
You can also share your feedback on Copilot code review. Take the survey.
src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.ts
Outdated
Show resolved
Hide resolved
The property was renamed from 'models' to 'settings' in the ILanguageModelsProviderGroup interface but the test still used the old name, causing configs to not be found. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Previously, _resolveModelConfiguration was called when collecting per-model configs, which resolved secret references into plaintext. The resolved values were then cached in _modelConfigurations, and setModelConfiguration could inadvertently persist plaintext secrets back into chatLanguageModels.json. Now store raw config (with secret references intact) and remove the unused _resolveModelConfiguration method. Per-model config properties don't use secrets in practice (they're for temperature, reasoning effort, etc.), but this prevents any future secret leakage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
7f2c61e to
a42f842
Compare
bpasero
approved these changes
Mar 18, 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
Adds per-model configuration support, allowing extensions to declare configurable properties per model (e.g., thinking effort for Anthropic models) via a
configurationSchema, and users can customize values through the model management editor andchatLanguageModels.json.What's included
Extension API (
vscode.proposed.chatProvider.d.ts)configurationSchemaonLanguageModelChatInformation— extensions declare per-model config propertiesmodelConfigurationonProvideLanguageModelChatResponseOptions— resolved config passed to providers at request timemodelConfigurationonChatRequest— resolved config available to chat participantsCore service (
languageModels.ts)getModelConfiguration(modelId)— returns resolved config (schema defaults + user overrides)setModelConfiguration(modelId, values)— persists per-model config, auto-removes default valuesgetModelConfigurationActions(modelId)— returnsSubmenuAction[]for enum-based config propertiesconfigureModel(modelId)— openschatLanguageModels.jsonwith snippet for the modelsettingsproperty inchatLanguageModels.jsongroupsModel management editor (
chatModelsWidget.ts)Config delivery
sendChatRequestmerges stored config into options (caller overrides take precedence)IChatAgentRequest.modelConfigurationcarries config to chat participantsJSON schema (
languageModelsConfigurationService.ts)settingsinchatLanguageModels.jsonviaif/thenconditional schemasTests
getModelConfiguration, default merging, unknown models