[BUG] ANTHROPIC_DEFAULT_*_MODEL creates duplicate 'Custom' entry in /model picker on Bedrock

Resolved 💬 1 comment Opened Apr 16, 2026 by aaaaaandrew Closed May 24, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When using ANTHROPIC_DEFAULT_SONNET_MODEL on Bedrock to pin the default Sonnet version (e.g., to change the default from Sonnet 4.5 to Sonnet 4.6), the /model picker shows a duplicate "Custom Sonnet model" entry alongside the built-in "Sonnet" entry.

Expected behavior: Setting ANTHROPIC_DEFAULT_SONNET_MODEL should update the default model label ("currently Sonnet 4.6") without creating a separate "Custom" picker entry — or at minimum, the custom entry should be merged with the built-in entry when they resolve to the same model family.

Actual behavior:

 1. Default                Use the default model (currently Sonnet 4.6)   ← ✅ label is correct
 2. Sonnet 4.6             Custom Sonnet model                            ← ❌ duplicate
 3. Sonnet                 Sonnet 4.6 · Best for everyday tasks           ← built-in
 4. Sonnet (1M context)    Sonnet 4.6 for long sessions
 5. Opus                   Opus 4.7 · Most capable for complex work
 ...

Root Cause

In the source, ujY() always creates a separate picker entry when ANTHROPIC_DEFAULT_SONNET_MODEL is set on Bedrock. The built-in Sonnet entry (mjY()) uses a different value (the resolved Bedrock model ID) vs the custom entry which uses value: "sonnet". Since the values differ, they're never deduplicated.

Workaround

Without ANTHROPIC_DEFAULT_SONNET_MODEL, the default label shows "currently Sonnet 4.5" (the hardcoded Bedrock default) even when modelOverrides routes claude-sonnet-4-6 to a Sonnet 4.6 inference profile. Users must choose between the wrong default label or a duplicate picker entry.

Suggested Fix

When ANTHROPIC_DEFAULT_SONNET_MODEL resolves to the same model family as a built-in entry, merge them instead of creating a separate "Custom" entry. Or provide a way to set the default model label without creating a picker entry (e.g., a separate ANTHROPIC_DEFAULT_MODEL env var).

Environment

  • Claude Code version: v2.1.111 / v2.1.112
  • Provider: Amazon Bedrock
  • OS: macOS
  • Configuration: modelOverrides mapping canonical IDs to application inference profile ARNs

🤖 Generated with Claude Code

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗