[BUG] Intermittent Task/subagents fail with API Error: 400 The provided model identifier is invalid while main agent succeeds (Bedrock)

Status Fixed / completed
Maintainer reply None cached
Activity 4 comments · opened Dec 31, 2025 · closed Jan 12, 2026
# Intermittent Task/Subagent failure: `400 The provided model identifier is invalid` (Bedrock)

## Summary
When running Claude Code with AWS Bedrock enabled, `Task` subagents fail intermittently (~2 runs out of 3) with a 400 error.

## Error
```text
API Error: 400 The provided model identifier is invalid
invalid model: us.anthropic.claude-sonnet-4-5-20250929-v1:0
subagent failed after 3 attempts

Expected

Subagents invoked via Task should reliably use the same provider/model configuration as the parent run, and should not fall back to an invalid default model identifier.

Configuration (env + settings.json)

Environment variables

CLAUDE_CODE_USE_BEDROCK=1
CLAUDE_PROVIDER=bedrock
BEDROCK_MODEL_ID=anthropic.claude-3-5-sonnet

AWS_REGION=eu-west-3
ANTHROPIC_MODEL=eu.anthropic.claude-haiku-4-5-20251001-v1:0
ANTHROPIC_SMALL_FAST_MODEL=eu.anthropic.claude-sonnet-4-5-20250929-v1:0
ANTHROPIC_DEFAULT_HAIKU_MODEL=eu.anthropic.claude-haiku-4-5-20251001-v1:0

settings.json (as written)

{
  "env": {
    "AWS_ACCESS_KEY_ID": "${AWS_ACCESS_KEY_ID}",
    "AWS_SECRET_ACCESS_KEY": "${AWS_SECRET_ACCESS_KEY}",
    "CLAUDE_CODE_USE_BEDROCK": "1",
    "AWS_REGION": "${AWS_REGION}",
    "ANTHROPIC_MODEL": "${ANTHROPIC_MODEL}",
    "ANTHROPIC_SMALL_FAST_MODEL": "${ANTHROPIC_SMALL_FAST_MODEL}",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "${ANTHROPIC_DEFAULT_HAIKU_MODEL}",
    "CLAUDE_CODE_MAX_OUTPUT_TOKENS": "50000",
    "MAX_THINKING_TOKENS": "1024"
  },
  "permissions": {
    "allow": [
      "Bash(dir:*)",
      "Bash(cat:*)",
      "Bash(find:*)",
      "Bash(nul)",
      "Bash(findstr:*)",
      "Bash(git diff:*)",
      "Bash(git grep:*)"
    ],
    "deny": [],
    "ask": []
  }
}

Note

I’m not explicitly selecting us.anthropic.claude-sonnet-4-5-20250929-v1:0 anywhere; it appears as a fallback/default during Task subagent execution.

Question

Will the Bedrock model/region configuration issue be fixed in the next release? It’s mentioned in several issues.

View original on GitHub ↗

4 Comments

github-actions[bot] · 9 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/11489
  2. https://github.com/anthropics/claude-code/issues/10807
  3. https://github.com/anthropics/claude-code/issues/14305

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

bameur · 9 months ago

@bcherny Will the Bedrock model/region configuration issue be fixed in the next release? It’s mentioned in several issues.

bameur · 9 months ago

The problem is fixed in the latest version.

github-actions[bot] · 8 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.