agentHost: fix Claude agent window showing only Haiku 4.5 in model picker#320294
Open
Bappoz wants to merge 1 commit into
Open
agentHost: fix Claude agent window showing only Haiku 4.5 in model picker#320294Bappoz wants to merge 1 commit into
Bappoz wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
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_enabledas a filter criterion inisClaudeModel. - 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. |
Author
@microsoft-github-policy-service agree |
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.
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):
ClaudeCodeModelsfetches viaendpointProvider.getAllChatEndpoints()modelMetadataFetcherapplies thecopilotchat.showInModelPickerA/B experimentoverride, which sets
showInModelPicker = truefor models CAPI has asfalseClaude agent window (agent host path):
ClaudeAgent._refreshModels()fetches directly fromcopilotApiService.models()(raw CAPI response)
isClaudeModel()requiredmodel_picker_enabled: truefrom the raw CAPI value —with no experiment override applied
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_enabledcheck fromisClaudeModel()insrc/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):
ClaudeCodeModelsfetches viaendpointProvider.getAllChatEndpoints()modelMetadataFetcherapplies thecopilotchat.showInModelPickerA/B experimentoverride, which sets
showInModelPicker = truefor models CAPI has asfalseClaude agent window (agent host path):
ClaudeAgent._refreshModels()fetches directly fromcopilotApiService.models()(raw CAPI response)
isClaudeModel()requiredmodel_picker_enabled: truefrom the raw CAPI value —with no experiment override applied
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_enabledcheck fromisClaudeModel()insrc/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:
vendor === 'Anthropic'auto)supported_endpoints.includes('/v1/messages')capabilities.supports.tool_callstryParseClaudeModelId(id) !== undefinednectarine,autoChanges
src/vs/platform/agentHost/node/claude/claudeAgent.ts— removed!!m.model_picker_enabledfrom
isClaudeModel(); updated JSDoc explaining why the flag is intentionally excludedsrc/vs/platform/agentHost/test/node/claudeAgent.test.ts— updated three test assertionsCAPI /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_enabledcheck fromisClaudeModel()insrc/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:
vendor === 'Anthropic'auto)supported_endpoints.includes('/v1/messages')capabilities.supports.tool_callstryParseClaudeModelId(id) !== undefinednectarine,autoChanges
src/vs/platform/agentHost/node/claude/claudeAgent.ts— removed!!m.model_picker_enabledfrom
isClaudeModel(); updated JSDoc explaining why the flag is intentionally excludedsrc/vs/platform/agentHost/test/node/claudeAgent.test.ts— updated three test assertionsto reflect that
model_picker_enabled: falsemodels now correctly appear in the agentwindow picker
Testing
Unit tests
The existing test suite covers the fix directly. Key tests updated:
'authenticate populates models filtered to Claude family'— now asserts thatANTHROPIC_PICKER_DISABLED(claude-opus-4.5,model_picker_enabled: false) appearsalongside 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 likenectarine,auto|Changes
src/vs/platform/agentHost/node/claude/claudeAgent.ts— removed!!m.model_picker_enabledfrom
isClaudeModel(); updated JSDoc explaining why the flag is intentionally excludedsrc/vs/platform/agentHost/test/node/claudeAgent.test.ts— updated three test assertionsto reflect that
model_picker_enabled: falsemodels now correctly appear in the agentwindow picker
Testing
Unit tests
The existing test suite covers the fix directly. Key tests updated:
'authenticate populates models filtered to Claude family'— now asserts thatANTHROPIC_PICKER_DISABLED(claude-opus-4.5,model_picker_enabled: false) appearsalongside 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 IDlist 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):
After — tests are passing :
Related
extensions/copilot/src/extension/chatSessions/claude/node/claudeCodeModels.tssrc/vs/platform/agentHost/node/claude/claudeAgent.ts(_refreshModels)extensions/copilot/src/platform/endpoint/node/modelMetadataFetcher.ts(
_getShowInModelPickerOverride)