Skip to content

Task tool ignores model configuration when using AWS Bedrock #21235

@svailla4

Description

@svailla4

Description

When using Claude Code with AWS Bedrock, the Task tool for spawning subagents ignores all model configuration and uses a hardcoded model ID that doesn't exist.

Environment

  • AWS Bedrock
  • Model configured in settings.json: us.anthropic.claude-opus-4-5-20251101-v1:0

Expected Behavior

Task tool should use the model from:

  1. Explicit model parameter in Task tool call
  2. model field in agent frontmatter (e.g., ~/.claude/agents/my-agent.md)
  3. model in ~/.claude/settings.json

Actual Behavior

Task tool always uses .anthropic.claude-sonnet-4-5-20250929-v1:0 which:

  1. Is missing the us prefix required for Bedrock
  2. References a Sonnet version that doesn't exist

Error

API Error (.anthropic.claude-sonnet-4-5-20250929-v1:0): 400 The provided model identifier is invalid.

Reproduction Steps

  1. Configure Claude Code for AWS Bedrock with settings.json:
{
  "model": "us.anthropic.claude-opus-4-5-20251101-v1:0",
  "env": {
    "CLAUDE_CODE_USE_BEDROCK": "1",
    "AWS_REGION": "us-east-1"
  }
}
  1. Create a custom agent in ~/.claude/agents/test-agent.md:
---
name: test-agent
description: Test agent
tools: Bash
model: opus
---
Test prompt: $ARGUMENTS
  1. Try to spawn the agent or use Task tool directly with model: "opus" parameter

  2. Observe error - Task tool ignores all model settings and uses broken hardcoded model

Workaround

Use MCP tools directly instead of spawning subagents. MCP tools run in the main conversation which respects the model setting.

Impact

All custom agents and Task tool subagents are completely broken when using Bedrock.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions