Skip to content

Add model managed setting and make it default for new conversations#322669

Draft
vijayupadya wants to merge 5 commits into
mainfrom
hissing-ostrich
Draft

Add model managed setting and make it default for new conversations#322669
vijayupadya wants to merge 5 commits into
mainfrom
hissing-ostrich

Conversation

@vijayupadya

@vijayupadya vijayupadya commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

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:

    • "auto" — let Copilot pick the model
    • a model family name (e.g. "opus", "gemini") — resolves to the latest available version in that family
    • a full model id
  • A new ChatDefaultModel enterprise policy that maps the model managed setting onto this configuration.

Behavior

  • New conversations start at the configured model across the local chat panel and the Agents window (including Copilot CLI sessions).
  • Users can still switch models within a conversation; an explicit pick is never overridden by the configured default.
  • Reopened conversations keep their own saved model.
  • When the setting is unset, behavior is unchanged.
  • Setting applied to both local agent and AH

Copilot AI review requested due to automatic review settings June 24, 2026 04:57
# Conflicts:
#	src/vs/platform/policy/common/copilotManagedSettings.ts
#	src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 ChatDefaultModel enterprise 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 modelDetials which 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

Comment thread src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts
Comment thread src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.ts
Comment thread src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts
Comment thread src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts Outdated
Comment thread src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts
Comment thread src/vs/workbench/contrib/chat/common/constants.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot's findings

  • Files reviewed: 11/11 changed files
  • Comments generated: 2

Comment thread build/lib/policies/policyData.jsonc Outdated
Comment thread src/vs/workbench/contrib/chat/browser/chat.shared.contribution.ts
@vijayupadya

Copy link
Copy Markdown
Contributor Author

cc @joshspicer

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants