[BUG] Vertex/Bedrock subagents silently downgraded to older models (Sonnet 4.5, Opus 4.1)

Status Fixed / completed
Reported on v2.1.68
Maintainer reply None cached
Activity 6 comments · opened Mar 4, 2026 · closed Mar 9, 2026

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

  1. Opus downgrade skips two major versions — Vertex users get Opus 4.1 instead of 4.6, despite 4.6 being GA on Vertex.
  2. Undocumented — The Vertex AI docs don't mention that abstract aliases resolve to older models.
  3. Misleading UI — The /model picker shows "Sonnet 4.6" and the system prompt references "Sonnet 4.6" for Vertex users, but subagents spawned with model: "sonnet" silently get 4.5.
  4. Affects all plugins — Any plugin agent definition using model: sonnet or model: opus (e.g., feature-dev, pr-review-toolkit, code-review) is affected.
  5. 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=1
  • CLOUD_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)

View original on GitHub ↗

6 Comments

github-actions[bot] · 7 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/18447
  2. https://github.com/anthropics/claude-code/issues/29519
  3. https://github.com/anthropics/claude-code/issues/25530

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

chaitanya-parsana · 7 months ago

Not a duplicate of #25530, #18447, or #29519. Those issues report the opus alias downgrade only. This issue additionally documents:

  1. The sonnet alias is also affected — resolves to Sonnet 4.5 on Vertex/Bedrock instead of 4.6
  2. The exact code path causing the downgrade in CLI v2.1.68

Code path (extracted from binary)

The B8() model resolution function calls provider-specific "current model" functions:

// B8("sonnet") calls CN():
function CN() {
  if (process.env.ANTHROPIC_DEFAULT_SONNET_MODEL) return process.env.ANTHROPIC_DEFAULT_SONNET_MODEL;
  if (E_() !== "firstParty") return b8().sonnet45;  // ← Vertex/Bedrock hardcoded to 4.5
  return b8().sonnet46;
}

// B8("opus") calls tI():
function tI() {
  if (process.env.ANTHROPIC_DEFAULT_OPUS_MODEL) return process.env.ANTHROPIC_DEFAULT_OPUS_MODEL;
  if (E_() === "firstParty") return b8().opus46;
  return b8().opus41;  // ← Vertex/Bedrock hardcoded to 4.1
}

The b8() function returns provider-specific model IDs. For Vertex:

  • b8().sonnet45 → claude-sonnet-4-5@20250929
  • b8().sonnet46 → claude-sonnet-4-6
  • b8().opus41 → claude-opus-4-1@20250805
  • b8().opus46 → claude-opus-4-6

Both models are GA on Vertex (us-east5, europe-west1, asia-southeast1, global).

Related issues

  • #25530 — same root cause (opus only)
  • #18447 — same root cause (closed)
  • #29519 — Bedrock equivalent (closed)
  • #18674 — feature request for granular model version overrides
mark-99 · 7 months ago

+1
Just noticed the same issue, env var workaround is effective but be good to get this fixed properly.

edit so the workaround knocks out the [1m] (long context) models. You can set the env vars to those instead, but you can't have both regular and 1m both available in the model picker. So the workaround does have some problems.

mark-99 · 7 months ago

@blois if this is "completed" does that mean the problematic behaviour is fixed and if so in which version? Thx.

mark-99 · 7 months ago

I see this is listed as fixed in the relnotes for 2.1.73 but it's stills screwy.

For /model I get:
Default Sonnet 4.5
Sonnet 4.6
Sonnet 4.6 1M
Opus 4.1
Opus 4.6
Opus 4.6 1M
Haiku.

Next test spawning an opus and sonnet subagent with different main model selection:
Sonnet 4.5: Opus 4.6, Sonnet 4.5@20250929
Sonnet 4.6: Opus 4.6, Sonnet 4.6.
Sonnet 4.6 1M: Opus 4.6, Sonnet 4.6 1M.
Opus 4.1: Opus 4.6, Sonnet 4.5@20250929
Opus 4.6: Opus 4.6, Sonnet 4.5@20250929
Opus 4.6 1M: Opus 4.6 1M, Sonnet 4.5@20250929
Haiku: Opus 4.6, Sonnet Sonnet 4.5@20250929

So Opus is ok in that you get 4.6 or 4.6-1M if that's the parent, but Sonnet is still screwy - you get 4.6/4.6-1M if that's the parent, but otherwise still getting 4.5.

github-actions[bot] · 6 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.