claude-code - 💡(How to fix) Fix [BUG] ANTHROPIC_DEFAULT_*_MODEL creates duplicate 'Custom' entry in /model picker on Bedrock [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49566Fetched 2026-04-17 08:37:29
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
labeled ×5

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.

Fix Action

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.

Code Example

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
 ...
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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

extent analysis

TL;DR

The most likely fix is to modify the ujY() function to merge the custom Sonnet entry with the built-in Sonnet entry when ANTHROPIC_DEFAULT_SONNET_MODEL resolves to the same model family.

Guidance

  • Review the ujY() function to understand how it creates a separate picker entry when ANTHROPIC_DEFAULT_SONNET_MODEL is set.
  • Compare the value used by the built-in Sonnet entry (mjY()) with the value used by the custom entry to identify why they are not being deduplicated.
  • Consider adding a check in ujY() to merge the custom entry with the built-in entry when they resolve to the same model family.
  • Evaluate the suggested fix of providing a separate ANTHROPIC_DEFAULT_MODEL env var to set the default model label without creating a picker entry.

Example

No code snippet is provided as the issue does not include the implementation details of ujY() or mjY().

Notes

The fix may require changes to the ujY() function or the introduction of a new environment variable. The exact implementation will depend on the specifics of the Claude Code source code.

Recommendation

Apply a workaround by modifying the ujY() function to merge the custom Sonnet entry with the built-in Sonnet entry when ANTHROPIC_DEFAULT_SONNET_MODEL resolves to the same model family, as this approach directly addresses the root cause of the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] ANTHROPIC_DEFAULT_*_MODEL creates duplicate 'Custom' entry in /model picker on Bedrock [1 participants]