Skip to content

agentHost: fix Claude agent window showing only Haiku 4.5 in model picker#320294

Open
Bappoz wants to merge 1 commit into
microsoft:mainfrom
Bappoz:fix/agent-host-model-picker
Open

agentHost: fix Claude agent window showing only Haiku 4.5 in model picker#320294
Bappoz wants to merge 1 commit into
microsoft:mainfrom
Bappoz:fix/agent-host-model-picker

Conversation

@Bappoz
Copy link
Copy Markdown

@Bappoz Bappoz commented Jun 7, 2026

Descrição:

Fixes #316454
Related: anthropics/claude-code#59136

Problem

The Claude agent window (agents-window) model picker shows only Claude Haiku 4.5,
while the normal Claude Code window correctly shows all available models (Sonnet 4.6,
Opus 4.8, Haiku 4.5, etc.).

Root Cause

Two code paths exist for populating the Claude model list:

Normal Claude Code window (extension path):

  • ClaudeCodeModels fetches via endpointProvider.getAllChatEndpoints()
  • modelMetadataFetcher applies the copilotchat.showInModelPicker A/B experiment
    override, which sets showInModelPicker = true for models CAPI has as false
  • Result: all capable Claude models are shown

Claude agent window (agent host path):

  • ClaudeAgent._refreshModels() fetches directly from copilotApiService.models()
    (raw CAPI response)
  • isClaudeModel() required model_picker_enabled: true from the raw CAPI value —
    with no experiment override applied
  • Result: only models CAPI explicitly flags as picker-eligible (Haiku 4.5) are shown

CAPI /models

├── Extension path → modelMetadataFetcher → showInModelPicker override → ALL models ✓

└── Agent host path → isClaudeModel() → raw model_picker_enabled → only Haiku 4.5 ✗

Fix

Removed the !!m.model_picker_enabled check from isClaudeModel() in
src/vs/platform/agentHost/node/claude/claudeAgent.ts.

Root Cause

Two code paths exist for populating the Claude model list:

Normal Claude Code window (extension path):

  • ClaudeCodeModels fetches via endpointProvider.getAllChatEndpoints()
  • modelMetadataFetcher applies the copilotchat.showInModelPicker A/B experiment
    override, which sets showInModelPicker = true for models CAPI has as false
  • Result: all capable Claude models are shown

Claude agent window (agent host path):

  • ClaudeAgent._refreshModels() fetches directly from copilotApiService.models()
    (raw CAPI response)
  • isClaudeModel() required model_picker_enabled: true from the raw CAPI value —
    with no experiment override applied
  • Result: only models CAPI explicitly flags as picker-eligible (Haiku 4.5) are shown

CAPI /models

├── Extension path → modelMetadataFetcher → showInModelPicker override → ALL models ✓

└── Agent host path → isClaudeModel() → raw model_picker_enabled → only Haiku 4.5 ✗

Fix

Removed the !!m.model_picker_enabled check from isClaudeModel() in
src/vs/platform/agentHost/node/claude/claudeAgent.ts.

The agent host has no access to the experiment service that drives the override.
The remaining four conditions are sufficient guards against synthetic or ineligible entries:

Condition Guards against
vendor === 'Anthropic' Non-Anthropic models (e.g. GPT-5, auto)
supported_endpoints.includes('/v1/messages') Models without Messages API support
capabilities.supports.tool_calls Models that cannot run tools
tryParseClaudeModelId(id) !== undefined Synthetic IDs like nectarine, auto

Changes

  • src/vs/platform/agentHost/node/claude/claudeAgent.ts — removed !!m.model_picker_enabled
    from isClaudeModel(); updated JSDoc explaining why the flag is intentionally excluded
  • src/vs/platform/agentHost/test/node/claudeAgent.test.ts — updated three test assertions

CAPI /models

├── Extension path → modelMetadataFetcher → showInModelPicker override → ALL models ✓

└── Agent host path → isClaudeModel() → raw model_picker_enabled → only Haiku 4.5 ✗

Fix

Removed the !!m.model_picker_enabled check from isClaudeModel() in
src/vs/platform/agentHost/node/claude/claudeAgent.ts.

The agent host has no access to the experiment service that drives the override.
The remaining four conditions are sufficient guards against synthetic or ineligible entries:

Condition Guards against
vendor === 'Anthropic' Non-Anthropic models (e.g. GPT-5, auto)
supported_endpoints.includes('/v1/messages') Models without Messages API support
capabilities.supports.tool_calls Models that cannot run tools
tryParseClaudeModelId(id) !== undefined Synthetic IDs like nectarine, auto

Changes

  • src/vs/platform/agentHost/node/claude/claudeAgent.ts — removed !!m.model_picker_enabled
    from isClaudeModel(); updated JSDoc explaining why the flag is intentionally excluded
  • src/vs/platform/agentHost/test/node/claudeAgent.test.ts — updated three test assertions
    to reflect that model_picker_enabled: false models now correctly appear in the agent
    window picker

Testing

Unit tests

The existing test suite covers the fix directly. Key tests updated:

  • 'authenticate populates models filtered to Claude family' — now asserts that
    ANTHROPIC_PICKER_DISABLED (claude-opus-4.5, model_picker_enabled: false) appears
    alongside the other Claude models
  • 'model filter excludes non-Claude entries' — confirms non-Anthropic, no-tool-calls,
    and no-messages-endpoint models are still excluded
    | capabilities.supports.tool_calls | Models that cannot run tools |
    | tryParseClaudeModelId(id) !== undefined | Synthetic IDs like nectarine, auto |

Changes

  • src/vs/platform/agentHost/node/claude/claudeAgent.ts — removed !!m.model_picker_enabled
    from isClaudeModel(); updated JSDoc explaining why the flag is intentionally excluded
  • src/vs/platform/agentHost/test/node/claudeAgent.test.ts — updated three test assertions
    to reflect that model_picker_enabled: false models now correctly appear in the agent
    window picker

Testing

Unit tests

The existing test suite covers the fix directly. Key tests updated:

  • 'authenticate populates models filtered to Claude family' — now asserts that
    ANTHROPIC_PICKER_DISABLED (claude-opus-4.5, model_picker_enabled: false) appears
    alongside the other Claude models
  • 'model filter excludes non-Claude entries' — confirms non-Anthropic, no-tool-calls,
    and no-messages-endpoint models are still excluded
  • 'authenticate retries proxy startup after a transient failure' — updated model ID
    list to include the formerly-excluded model

npm run test-node -- --run src/vs/platform/agentHost/test/node/claudeAgent.test.ts

Before — Claude agent window model picker (only Haiku 4.5):

image

After — tests are passing :

screenshot-2026-06-07_13-06-51 screenshot-2026-06-07_13-07-14 screenshot-2026-06-07_13-07-23

Related

Copilot AI review requested due to automatic review settings June 7, 2026 16:15
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

Note

Copilot was unable to run its full agentic suite in this review.

Updates Claude model filtering in the agent host to align with Copilot extension behavior by no longer filtering on model_picker_enabled, and adjusts tests/fixtures accordingly.

Changes:

  • Remove model_picker_enabled as a filter criterion in isClaudeModel.
  • Expand test expectations to include an Anthropic model that has model_picker_enabled:false (e.g., claude-opus-4.5).
  • Add explanatory comments in tests and implementation about why the flag is ignored.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/vs/platform/agentHost/node/claude/claudeAgent.ts Removes model_picker_enabled gating and documents rationale in isClaudeModel.
src/vs/platform/agentHost/test/node/claudeAgent.test.ts Updates assertions to include the additional Claude model and clarifies intent via comments.
Comments suppressed due to low confidence (1)

src/vs/platform/agentHost/test/node/claudeAgent.test.ts:1

  • This assertion snapshots the full model objects including presentation fields (name) and internal metadata (_meta.multiplierNumeric), which makes the test brittle to unrelated catalog/telemetry changes. If the intent is purely “Claude-family models are included (including picker-disabled ones)”, consider asserting on model IDs (and optionally key capability fields) rather than the entire object shape.
/*---------------------------------------------------------------------------------------------

Comment on lines +51 to +59
* Intentionally does NOT check `model_picker_enabled`: CAPI sets that flag
* conservatively (false for many models), and the Copilot extension overrides
* it via an A/B experiment (`copilotchat.showInModelPicker`) so the normal
* Claude Code window shows all capable models. The agent host has no access
* to that experiment service, so relying on the raw flag would cause it to
* show a much smaller set than the extension window does. The remaining four
* conditions (Anthropic vendor, `/v1/messages` endpoint, tool-call support,
* parseable model ID) are sufficient guards against synthetic or ineligible
* entries.
@Bappoz
Copy link
Copy Markdown
Author

Bappoz commented Jun 7, 2026

  • ownership

@microsoft-github-policy-service agree

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.

Claude agent window model selection limited to Haiku 4.5 in VS Code Insiders

3 participants