claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Bug: --continue flag uses wrong model ID for EU region (Bedrock)

Open jr42 opened this issue 2 months ago • 6 comments

Description

When using Claude Code with AWS Bedrock in eu-central-1 region, the --continue flag fails because it attempts to use the US Haiku model identifier which is not available in EU regions.

Error Message

% claude --continue

▗ ▗   ▖ ▖  Claude Code v2.0.25
           Sonnet 4.5 · API Usage Billing
  ▘▘ ▝▝    ~/Develop/claude-code-stats

> Warmup 
  ⎿  API Error (us.anthropic.claude-3-5-haiku-20241022-v1:0): 400 The provided model identifier is invalid.

% claude           

▗ ▗   ▖ ▖  Claude Code v2.0.25
           Sonnet 4.5 · API Usage Billing
  ▘▘ ▝▝    ~/Develop/claude-code-stats

Expected Behavior

When using --continue with AWS Bedrock in eu-central-1, Claude Code should use the EU-compatible model identifier:

  • eu.anthropic.claude-3-5-haiku-20241022-v1:0 (EU Haiku)

Instead of:

  • us.anthropic.claude-3-5-haiku-20241022-v1:0 (US Haiku)
  • Entire session being lost (won't appear anymore with --resume)

Environment

  • Claude Code Version: v2.0.25
  • Platform: macOS (Darwin 24.6.0)
  • AWS Region: eu-central-1 (confirmed via AWS_DEFAULT_REGION)
  • Provider: AWS Bedrock (CLAUDE_CODE_USE_BEDROCK=1)
  • Primary Model: Sonnet 4.5 (works fine for new sessions)

Relevant Environment Variables

AWS_DEFAULT_REGION=eu-central-1
CLAUDE_CODE_USE_BEDROCK=1
CLAUDE_CODE_ENTRYPOINT=cli

Steps to Reproduce

  1. Configure Claude Code to use AWS Bedrock in eu-central-1 region
  2. Set environment: export AWS_DEFAULT_REGION=eu-central-1
  3. Set environment: export CLAUDE_CODE_USE_BEDROCK=1
  4. Start a new session: claude (works fine)
  5. Try to continue the session: claude --continue
  6. Error occurs: "The provided model identifier is invalid"

Root Cause

The warmup phase when using --continue appears to be hardcoded to use US model identifiers (us.anthropic.claude-3-5-haiku-20241022-v1:0) regardless of the AWS region configuration.

Impact

  • --continue is completely broken for all EU Bedrock users
  • No workaround available - users cannot resume previous sessions
  • Forces users to start new sessions every time, losing conversation context

Suggested Fix

Claude Code should:

  1. Detect the AWS region from environment (AWS_DEFAULT_REGION) or Bedrock configuration
  2. Use region-appropriate model identifiers for all operations including --continue
  3. Map us.* models to eu.* models when in EU regions
  4. Apply this logic consistently across all warmup and model selection code paths

Example Region Mapping

const modelIdByRegion = {
  'us-east-1': 'us.anthropic.claude-3-5-haiku-20241022-v1:0',
  'us-west-2': 'us.anthropic.claude-3-5-haiku-20241022-v1:0',
  'eu-central-1': 'eu.anthropic.claude-3-5-haiku-20241022-v1:0',
  'eu-west-1': 'eu.anthropic.claude-3-5-haiku-20241022-v1:0',
  'eu-west-2': 'eu.anthropic.claude-3-5-haiku-20241022-v1:0',
  // ... other regions
};

Workaround

None available. Users must avoid --continue and start new sessions each time.

jr42 avatar Oct 23 '25 07:10 jr42

I'm also investigating cross-region issues. In your case @jr42, just pointing out that Claude Code documentation refers to AWS_REGION and not AWS_DEFAULT_REGION to select the proper region.

https://docs.claude.com/en/docs/claude-code/amazon-bedrock#3-configure-claude-code

alexduros avatar Oct 23 '25 15:10 alexduros

I'm also investigating cross-region issues. In your case @jr42, just pointing out that Claude Code documentation refers to AWS_REGION and not AWS_DEFAULT_REGION to select the proper region.

Same behavior experienced here with AWS_REGION=eu-central-1.

marcguyer avatar Oct 23 '25 15:10 marcguyer

Same issue affects WebFetch tool

This hardcoded model ID issue also affects the WebFetch tool in EU regions.

Error with WebFetch

API Error (us.anthropic.claude-3-5-haiku-20241022-v1:0): 400 The provided model identifier is invalid.

WebFetch internally uses a Haiku model to process web content, but it's hardcoded to use the US model ID regardless of region.

Environment

  • Claude Code Version: v2.0.28
  • AWS Region: eu-central-1
  • Provider: AWS Bedrock (CLAUDE_CODE_USE_BEDROCK=1)

Workaround

Setting the environment variable fixes WebFetch:

export ANTHROPIC_DEFAULT_HAIKU_MODEL="eu.anthropic.claude-haiku-4-5-20251001-v1:0"

Note: Must use inference profile ID (with eu. prefix), not direct model ID. AWS Bedrock requires inference profiles for on-demand throughput.

Available EU Inference Profiles

aws bedrock list-inference-profiles --query 'inferenceProfileSummaries[?contains(inferenceProfileName, `Haiku`)]'

Returns:

  • eu.anthropic.claude-3-haiku-20240307-v1:0 (Claude 3 Haiku)
  • eu.anthropic.claude-haiku-4-5-20251001-v1:0 (Claude 4.5 Haiku)
  • global.anthropic.claude-haiku-4-5-20251001-v1:0 (Global profile)

Root Cause

Same as --continue: hardcoded US model identifiers throughout Claude Code codebase. Affects multiple features:

  • --continue flag (already documented in this issue)
  • ✅ WebFetch tool (documented here)
  • ❓ Potentially other internal tools using Haiku

Suggested Fix

The proposed region mapping solution would fix both --continue and WebFetch. Consider also supporting ANTHROPIC_DEFAULT_HAIKU_MODEL environment variable as an override mechanism.

fchenebault avatar Oct 28 '25 14:10 fchenebault

I found a workaround:

type /model and change it to Opus and then revert it back to Default again

Hely0n avatar Nov 04 '25 15:11 Hely0n

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 09 '25 10:12 github-actions[bot]

pls fix it! 🙏

vuon9 avatar Dec 09 '25 12:12 vuon9