Generalize model picker to be used with Claude#311761
Merged
TylerLeonhardt merged 2 commits intomainfrom Apr 21, 2026
Merged
Conversation
So that it has a model picker on the welcome chat. Co-authored-by: Copilot <copilot@github.com>
Contributor
Contributor
There was a problem hiding this comment.
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
SessionModelPickerandmodelPickerStorageKey()to unify model selection, storage, and provider syncing persessionType. - 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 isCOPILOT_CLI_SESSION_TYPE(copilotcli). Using the wrong ID here makes the asserted storage key (sessions.modelPicker.copilot-cli...) diverge from whatSessionModelPickerwill produce in production. Prefer importing the session type constants and asserting againstmodelPickerStorageKey(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
justschen
approved these changes
Apr 21, 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.
So that it has a model picker on the welcome chat.
Co-authored-by: Copilot copilot@github.com