[BUG] Vertex/Bedrock subagents silently downgraded to older models (Sonnet 4.5, Opus 4.1)
Bug Description
When using Claude Code with Vertex AI (CLAUDE_CODE_USE_VERTEX=1), subagent model resolution silently downgrades abstract model aliases to significantly older versions compared to first-party API users. This is undocumented and misleading.
Root Cause
The B8() function resolves abstract aliases (sonnet, opus, haiku) by calling provider-specific functions that hardcode older models for non-firstParty providers:
// CN() - "Current Sonnet"
function CN() {
if (process.env.ANTHROPIC_DEFAULT_SONNET_MODEL) return process.env.ANTHROPIC_DEFAULT_SONNET_MODEL;
if (E_() !== "firstParty") return b8().sonnet45; // Vertex/Bedrock → Sonnet 4.5
return b8().sonnet46; // Anthropic API → Sonnet 4.6
}
// tI() - "Current Opus"
function tI() {
if (process.env.ANTHROPIC_DEFAULT_OPUS_MODEL) return process.env.ANTHROPIC_DEFAULT_OPUS_MODEL;
if (E_() === "firstParty") return b8().opus46; // Anthropic API → Opus 4.6
return b8().opus41; // Vertex/Bedrock → Opus 4.1 (!!)
}
Effective model mapping
| Alias | firstParty (Anthropic API) | Vertex/Bedrock |
|-------|---------------------------|----------------|
| sonnet | Sonnet 4.6 | Sonnet 4.5 (claude-sonnet-4-5@20250929) |
| opus | Opus 4.6 | Opus 4.1 (claude-opus-4-1@20250805) |
| haiku | Haiku 4.5 | Haiku 4.5 (same) |
Why This Is a Problem
- Opus downgrade skips two major versions — Vertex users get Opus 4.1 instead of 4.6, despite 4.6 being GA on Vertex.
- Undocumented — The Vertex AI docs don't mention that abstract aliases resolve to older models.
- Misleading UI — The
/modelpicker shows "Sonnet 4.6" and the system prompt references "Sonnet 4.6" for Vertex users, but subagents spawned withmodel: "sonnet"silently get 4.5. - Affects all plugins — Any plugin agent definition using
model: sonnetormodel: opus(e.g., feature-dev, pr-review-toolkit, code-review) is affected. - Models are available — Google's own docs confirm Sonnet 4.6 and Opus 4.6 are GA in us-east5, europe-west1, asia-southeast1, and global endpoints.
Environment
- Claude Code version: 2.1.68
CLAUDE_CODE_USE_VERTEX=1CLOUD_ML_REGION=us-east5- Platform: macOS (darwin arm64)
Workaround
Setting explicit env vars bypasses the downgrade:
export ANTHROPIC_DEFAULT_SONNET_MODEL='claude-sonnet-4-6'
export ANTHROPIC_DEFAULT_OPUS_MODEL='claude-opus-4-6'
Expected Behavior
Abstract aliases should resolve to the same model generation across all providers, or at minimum this behavior should be documented and visible in the UI when a downgrade occurs.
Related
- #18674 (model version override env vars)
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗