-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Description
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 Agent Teams with AWS Bedrock, teammates spawned via the Task tool always fail with 400 The provided model identifier is invalid.
The root cause: Claude Code spawns teammates in tmux panes with --model claude-opus-4-6 (Anthropic API format) instead of the Bedrock-qualified model ID us.anthropic.claude-opus-4-6-v1. The --model CLI flag is hardcoded from the team config's model field, which stores the API-format name regardless of the Bedrock environment.
Key observations:
- The parent/lead process correctly uses Bedrock with
ANTHROPIC_MODEL=us.anthropic.claude-opus-4-6-v1 - The team config stores
"model": "claude-opus-4-6"(API format) for each teammate - The spawn command passes
--model claude-opus-4-6explicitly - The child process shows
claude-opus-4-6 · API Usage Billing(not Bedrock) despiteCLAUDE_CODE_USE_BEDROCK=1being available in the tmux global environment - Setting tmux global environment variables (
tmux set-environment -g) does not help because the--modelCLI flag appears to take precedence over env vars
Note: The similar issue for regular Task subagents (#15907, #21235) was fixed, but Agent Teams uses a different code path for spawning teammates that still has this problem.
What Should Happen?
When CLAUDE_CODE_USE_BEDROCK=1 is set, Agent Teams should:
- Store the Bedrock-qualified model ID in the team config (e.g.,
us.anthropic.claude-opus-4-6-v1instead ofclaude-opus-4-6) - OR map the model alias (e.g.,
opus) to the Bedrock model ID usingANTHROPIC_DEFAULT_OPUS_MODELwhen generating the--modelflag for the spawn command - OR ensure the child process respects
CLAUDE_CODE_USE_BEDROCK=1from the environment even when--modelis provided with an API-format name
Error Messages/Logs
API Error (claude-opus-4-6): 400 The provided model identifier is invalid.
Spawn command observed in tmux pane:
cd /path/to/repo && CLAUDECODE=1 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 \
/path/to/claude \
--agent-id anime-otaku@team-name \
--agent-name anime-otaku \
--team-name team-name \
--agent-color blue \
--parent-session-id <uuid> \
--agent-type general-purpose \
--permission-mode acceptEdits \
--model claude-opus-4-6
Team config showing API-format model:
{
"agentId": "anime-otaku@team-name",
"name": "anime-otaku",
"model": "claude-opus-4-6",
"backendType": "tmux"
}Steps to Reproduce
- Configure Claude Code for AWS Bedrock:
{
"env": {
"CLAUDE_CODE_USE_BEDROCK": "1",
"AWS_REGION": "us-west-2",
"ANTHROPIC_MODEL": "us.anthropic.claude-opus-4-6-v1",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "us.anthropic.claude-opus-4-6-v1",
"AWS_PROFILE": "claude",
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
},
"teammateMode": "tmux"
}- Create a team with
TeamCreate - Spawn a teammate using the
Tasktool withteam_nameparameter - Observe the teammate's tmux pane showing
claude-opus-4-6 · API Usage Billingand400 The provided model identifier is invalid
Related Issues
- [BUG] Intermittent Task/subagents fail with API Error: 400 The provided model identifier is invalid while main agent succeeds (Bedrock) #15907 (closed) - Same model ID issue for regular Task subagents (fixed, but fix not applied to Agent Teams path)
- Task tool ignores model configuration when using AWS Bedrock #21235 (closed) - Task tool ignores model config on Bedrock (fixed, but not for Agent Teams)
- [BUG] in-process CLI flag and config file setting are ignored, claude always launches teammembers in tmux panes from tmux #23437 (open) -
in-processmode ignored when running from tmux (blocks the workaround) - [BUG][bedrock] Opus 4.6 [1m] selection writes invalid model id → 400 "The provided model identifier is invalid" #23499 (open) - Bedrock model ID issue with
[1m]suffix
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
No response
Claude Code Version
v2.1.33
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
Other
Additional Information
The in-process teammate mode workaround is also blocked by #23437 (in-process setting is ignored when running from tmux, always falls back to tmux panes).