Add model managed setting and make it default for new conversations#322669
Draft
vijayupadya wants to merge 5 commits into
Draft
Add model managed setting and make it default for new conversations#322669vijayupadya wants to merge 5 commits into
vijayupadya wants to merge 5 commits into
Conversation
# Conflicts: # src/vs/platform/policy/common/copilotManagedSettings.ts # src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds support for configuring a default chat model for new conversations via chat.defaultConfiguration.model, including enterprise enforcement via a new managed-setting–backed policy. The change is applied across the workbench chat widget and the Agents window model picker, with shared resolution logic for auto, exact model IDs, and model-family-to-latest selection.
Changes:
- Add
chat.defaultConfiguration.model(string) and implement resolution of configured values to a concrete model (auto/ full ID / family→latest). - Apply the configured default model to new/empty sessions in the workbench chat input and in the Agents window picker, while tracking explicit user picks to avoid clobbering.
- Introduce a new
ChatDefaultModelenterprise policy backed by a new managed-settings key (model) and update exported policy data.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/chat/test/browser/widget/input/chatModelSelectionLogic.test.ts | Adds unit tests for configured-model resolution behavior (empty/auto/id/family/precedence). |
| src/vs/workbench/contrib/chat/common/constants.ts | Extends IChatDefaultConfiguration with model?: string and updates documentation. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatModelSelectionLogic.ts | Implements resolveConfiguredModel (and version comparison) to map configured values to available models. |
| src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts | Applies configured defaults to new/empty sessions, waits for late model registration, and tracks explicit user selections. |
| src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts | Registers the new configuration property and attaches a managed-settings–driven enterprise policy. |
| src/vs/workbench/contrib/chat/browser/actions/chatActions.ts | Marks model selection triggered by action options as user-initiated. |
| src/vs/sessions/contrib/chat/browser/modelPicker.ts | Applies the configured default model when initializing model selection for new sessions in the Agents window. |
| src/vs/platform/policy/common/copilotManagedSettings.ts | Adds COPILOT_MODEL_KEY managed-settings key constant. |
| build/lib/policies/policyData.jsonc | Updates the generated policy catalog to include ChatDefaultModel. |
Copilot's findings
Comments suppressed due to low confidence (1)
src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts:1553
- Spelling: the debug log message uses
modelDetialswhich makes log searching harder (and is inconsistent with the variable name).
const selectedModelStorageKey = this.getSelectedModelStorageKey();
const selectedModelIsDefaultStorageKey = this.getSelectedModelIsDefaultStorageKey();
logChangesToStateModel(this._inputModel, `setCurrentLanguageModel to ${model.identifier} in ${this._currentSessionKey}, storageKey=${selectedModelStorageKey}, isDefaultKey=${selectedModelIsDefaultStorageKey}, currentSessionType=${this._currentSessionType}, getCurrentSessionType=${this.getCurrentSessionType()}, boundInputModelSession=${this._inputModelSessionResource?.toString()}, modelDetials = ${modelDetails}`, undefined, undefined, this.logService);
- Files reviewed: 9/9 changed files
- Comments generated: 6
Contributor
Author
|
cc @joshspicer |
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.
Fixes https://github.com/microsoft/vscode-internalbacklog/issues/7934
Adds support for configuring a default model that applies to every new conversation, enforable by enterprise policy.
What's new
New model property on the chat.defaultModel setting. Accepts:
A new ChatDefaultModel enterprise policy that maps the model managed setting onto this configuration.
Behavior