Skip to content

Generalize model picker to be used with Claude#311761

Merged
TylerLeonhardt merged 2 commits intomainfrom
tyler/fellow-ptarmigan
Apr 21, 2026
Merged

Generalize model picker to be used with Claude#311761
TylerLeonhardt merged 2 commits intomainfrom
tyler/fellow-ptarmigan

Conversation

@TylerLeonhardt
Copy link
Copy Markdown
Member

So that it has a model picker on the welcome chat.

Co-authored-by: Copilot copilot@github.com

So that it has a model picker on the welcome chat.

Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings April 21, 2026 18:51
@TylerLeonhardt TylerLeonhardt enabled auto-merge (squash) April 21, 2026 18:51
@TylerLeonhardt TylerLeonhardt self-assigned this Apr 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 21, 2026

Screenshot Changes

Base: d0b379e4 Current: 2bf8dacb

Changed (2)

chat/aiCustomizations/aiCustomizationManagementEditor/McpBrowseMode/Light
Before After
before after
editor/inlineCompletions/other/JumpToHint/Dark
Before After
before after

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 generalizes the Copilot Chat Sessions “Model” picker so it can be shown for Claude Code sessions as well, while persisting the selected model per session type.

Changes:

  • Introduces SessionModelPicker and modelPickerStorageKey() to unify model selection, storage, and provider syncing per sessionType.
  • Expands the New Session config “Model” menu contribution to also apply to Claude Code sessions.
  • Adds a new browser test suite covering storage key scoping, model filtering, and picker initialization behavior.
Show a summary per file
File Description
src/vs/sessions/contrib/copilotChatSessions/browser/copilotChatSessionsActions.ts Replaces inline picker wiring with a reusable SessionModelPicker, adds per-session-type storage keys, and enables picker for Claude sessions.
src/vs/sessions/contrib/copilotChatSessions/test/browser/modelPickerDelegate.test.ts Adds tests for model filtering and per-session-type persistence/initialization.
src/vs/sessions/contrib/copilotChatSessions/COPILOT_CHAT_SESSIONS_PROVIDER.md Updates docs to reflect the unified model picker for CLI + Claude.

Copilot's findings

Comments suppressed due to low confidence (2)

src/vs/sessions/contrib/copilotChatSessions/test/browser/modelPickerDelegate.test.ts:106

  • These fixtures use session type strings like 'copilot-cli'/'copilot-cloud'. The production session type IDs are defined as constants (e.g. COPILOT_CLI_SESSION_TYPE = copilotcli, COPILOT_CLOUD_SESSION_TYPE = copilot-cloud-agent). Please switch the test data to use those constants so the model filtering behavior matches real sessions.
	test('filters models by session type', () => {
		const models = [
			makeModel('cli-model', 'copilot-cli'),
			makeModel('cloud-model', 'copilot-cloud'),
			makeModel('claude-model', 'claude-code'),
		];

src/vs/sessions/contrib/copilotChatSessions/test/browser/modelPickerDelegate.test.ts:176

  • This test switches to sessionType: 'copilot-cli', but the actual CLI session type ID is COPILOT_CLI_SESSION_TYPE (copilotcli). Using the wrong ID here makes the asserted storage key (sessions.modelPicker.copilot-cli...) diverge from what SessionModelPicker will produce in production. Prefer importing the session type constants and asserting against modelPickerStorageKey(COPILOT_CLI_SESSION_TYPE) / modelPickerStorageKey(CLAUDE_CODE_SESSION_TYPE) instead of hard-coded strings.
		const { instantiationService, storage, activeSession } = stubServices(disposables, {
			models: allModels,
			activeSession: { providerId: 'default-copilot', sessionId: 's1', sessionType: 'copilot-cli' },
		});
  • Files reviewed: 3/3 changed files
  • Comments generated: 2

Comment thread src/vs/sessions/contrib/copilotChatSessions/browser/copilotChatSessionsActions.ts Outdated
@TylerLeonhardt TylerLeonhardt merged commit ba6a4b1 into main Apr 21, 2026
26 checks passed
@TylerLeonhardt TylerLeonhardt deleted the tyler/fellow-ptarmigan branch April 21, 2026 21:22
@vs-code-engineering vs-code-engineering Bot added this to the 1.118.0 milestone Apr 21, 2026
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.

3 participants