Skip to content

agent-host: restore selected model in picker#314613

Merged
roblourens merged 6 commits into
mainfrom
agents/use-the-skill-located-at-vsckb-implement-file-7d1b70c6
May 6, 2026
Merged

agent-host: restore selected model in picker#314613
roblourens merged 6 commits into
mainfrom
agents/use-the-skill-located-at-vsckb-implement-file-7d1b70c6

Conversation

@roblourens
Copy link
Copy Markdown
Member

Summary

  • restore Agent Host model picker selection from the current session model when one exists
  • use resource-scheme-scoped storage only as view state for new untitled sessions
  • avoid defaulting new sessions to the first available model when no stored selection exists
  • add focused regression coverage for model resolution behavior

Validation

  • npm run compile-check-ts-native
  • node --experimental-strip-types build/hygiene.ts src/vs/sessions/contrib/chat/browser/agentHost/agentHostModelPicker.ts src/vs/sessions/contrib/chat/test/browser/agentHostModelPicker.test.ts
  • npm run valid-layers-check
  • npm run gulp compile
  • ./scripts/test.sh --run src/vs/sessions/contrib/chat/test/browser/agentHostModelPicker.test.ts --timeout 10000

(Written by Copilot)

Use session state as the source of truth for existing agent host sessions, while keeping resource-scheme-scoped storage as the view-state fallback for new untitled sessions. (Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 6, 2026 01:43
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 updates the Agents window’s Agent Host model picker to prefer the model already associated with the active session (when present), and to treat persisted picker selection as untitled-session view state rather than as a default for existing sessions.

Changes:

  • Add scheme-scoped storage keys and a small resolver to determine which model should be displayed for a given session.
  • Update the model picker initialization logic to use session state first, and only consult stored picker state for untitled sessions.
  • Add targeted regression unit tests for storage key construction and model resolution behavior.
Show a summary per file
File Description
src/vs/sessions/contrib/chat/browser/agentHost/agentHostModelPicker.ts Implements scheme-scoped storage keys and updates model resolution/initialization logic for the agent-host model picker.
src/vs/sessions/contrib/chat/test/browser/agentHostModelPicker.test.ts Adds regression tests for storage key generation and model resolution behavior.

Copilot's findings

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

Comment thread src/vs/sessions/contrib/chat/browser/agentHost/agentHostModelPicker.ts Outdated
roblourens and others added 3 commits May 5, 2026 18:55
…located-at-vsckb-implement-file-7d1b70c6

# Conflicts:
#	src/vs/sessions/contrib/chat/browser/agentHost/agentHostModelPicker.ts
…located-at-vsckb-implement-file-7d1b70c6

(Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
roblourens and others added 2 commits May 6, 2026 10:51
Recompute Agent Host model picker state when the active session status changes so storage fallback is only used while a session is untitled. (Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roblourens roblourens marked this pull request as ready for review May 6, 2026 22:22
@roblourens roblourens enabled auto-merge (squash) May 6, 2026 22:22
@roblourens roblourens merged commit 21b561c into main May 6, 2026
26 checks passed
@roblourens roblourens deleted the agents/use-the-skill-located-at-vsckb-implement-file-7d1b70c6 branch May 6, 2026 22:47
@vs-code-engineering vs-code-engineering Bot added this to the 1.120.0 milestone May 6, 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