Skip to content

Agent Teams: Spawned teammates don't inherit model configuration from team lead #32368

Closed as not planned

Description

@gavinyao

Summary

When using Agent Teams with a custom/internal model endpoint, spawned teammates fail to inherit the model configuration. The team lead works correctly with the configured model, but teammates attempt to use a different model ID (claude-opus-4-6), resulting in 403 permission errors.

Environment

  • Claude Code version: Latest (March 2026)
  • OS: macOS Darwin 24.6.0
  • Shell: zsh
  • Model configured: Internal/custom endpoint (e.g., internal-model-opus-aws)

Steps to Reproduce

  1. Configure Claude Code to use a custom/internal model endpoint
  2. Enable Agent Teams experimental feature:
    {
      "env": {
        "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
      }
    }
  3. Create a team:
    TeamCreate with team_name: "test-team"
    
  4. Spawn teammates:
    Agent with subagent_type: "general-purpose", team_name: "test-team"
    
  5. Send tasks to teammates via SendMessage

Expected Behavior

Teammates should inherit the same model configuration as the team lead and execute tasks normally.

Actual Behavior

  • Team lead works correctly with the configured internal model
  • Teammates repeatedly send idle_notification without executing any tasks
  • Teammates' API calls fail with 403 error:
API Error: 403 {
  "error": {
    "code": "",
    "message": "Token does not have permission to access model claude-opus-4-6",
    "type": "new_api_error"
  }
}

Analysis

Role Model Used Result
Team Lead internal-model-opus-aws (from config) ✅ Works
Teammates claude-opus-4-6 (hardcoded?) ❌ 403 Error

The teammates appear to use a hardcoded or default model ID (claude-opus-4-6) instead of inheriting from the team lead's configuration or the global settings.

Impact

Users with custom/internal API endpoints cannot use the Agent Teams feature at all. This blocks adoption for enterprise users or those using proxy endpoints.

Suggested Fix

Ensure spawned teammates inherit the model configuration from:

  1. The model parameter passed to the Agent tool, OR
  2. The team lead's current model configuration, OR
  3. The global settings.json configuration

Workaround Attempted

Tried specifying model: "haiku" or model: "sonnet" in the Agent tool parameters, but the issue persists (teammates still attempt to use claude-opus-4-6).

Activity

  1. github-actions commented on Mar 9, 2026

    @github-actions

    Found 3 possible duplicate issues:

    1. Agent team teammates don't inherit Bedrock model ARN from env overrides #29660
    2. Team/subagent agents don't inherit Bedrock model identifiers #25094
    3. [BUG][Bedrock] Agent Teams teammates spawned with non-Bedrock model ID via --model flag, causing 400 errors #23561

    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

  2. junaidtitan commented on Mar 9, 2026

    @junaidtitan

    Hitting this too with custom endpoints. We've added a doctor check for this in Cozempic v0.9.0:

    pip install -U cozempic
    cozempic doctor  # warns if agent teams are active but no model set in settings.json

    The check detects when ~/.claude/settings.json is missing a model key while team directories are present — since that's the condition where subagents silently fall back to claude-opus-4-6 instead of inheriting the team lead's config.

    Workaround until fixed upstream: add "model": "your-model-id" explicitly to ~/.claude/settings.json. That ensures subagents pick it up rather than relying on env var inheritance which appears broken.

  3. gavinyao commented on Mar 9, 2026

    @gavinyao
    Author

    thans for reply, but It's not work for me.

    Claude Code v2.1.71

    ❯ cozempic --version
    cozempic 0.9.0

    ❯ cozempic doctor

    COZEMPIC DOCTOR
    ═══════════════════════════════════════════════════════════════════

    ✓ trust-dialog-hang         [OK]
      Trust dialog flag not set — no issue
    
    ✓ hooks-trust-flag          [OK]
      Hooks trust flag set correctly — hooks will load normally
    
    ✓ claude-json-corruption    [OK]
      .claude.json is valid (25160 bytes)
    
    ✓ corrupted-tool-use        [OK]
      No corrupted tool_use blocks found (132 sessions checked)
    
    ✓ orphaned-tool-results     [OK]
      No orphaned tool_result blocks found (132 sessions checked)
    
    ✓ zombie-teams              [OK]
      4 active team(s), no stale teams found
    
    ✓ agent-model-mismatch      [OK]
      Model 'internal-model-opus-aws' set in settings.json — subagents should inherit correctly
    
    ✓ oversized-sessions        [OK]
      No oversized sessions found (132 sessions checked)
    
    ✓ stale-backups             [OK]
      No stale backup files found
    
    ✓ disk-usage                [OK]
      132 sessions using 49.5MB total
    

    All clear — no issues found.

  4. MasterXue commented on Mar 10, 2026

    @MasterXue

    https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#2172

    • Fixed team agents to inherit the leader's model

    2.1.72 fix the bug, but I haven't verified it yet.

  5. it235 commented on Mar 10, 2026

    @it235

    2.1.72 fix the bug, but I haven't verified it yet.

    I also noticed this fix, but I spent 3 hours researching version 2.1.72 and the issue still exists and has not been fixed

    @team-lead> code-review
    ⎿  API Error: 400 event:error
    data:{"code":"InvalidParameter","message":"model 'claude-opus-4-6' not found or not
    supported","request_id":"07ff7a59-4a17-94b6-99be-365b68c5b68f"}

  6. MasterXue commented on Mar 10, 2026

    @MasterXue

    2.1.72 fix the bug, but I haven't verified it yet.

    I also noticed this fix, but I spent 3 hours researching version 2.1.72 and the issue still exists and has not been fixed

    @team-lead> code-review ⎿  API Error: 400 event:error data:{"code":"InvalidParameter","message":"model 'claude-opus-4-6' not found or not supported","request_id":"07ff7a59-4a17-94b6-99be-365b68c5b68f"}

    Yes, I tested it and I'm sure it didn't fix it.
    @team-lead❯
    ⎿  API Error: 400 {"error":{"code":"400","message":"Param Incorrect","param":"Not supported model claude-opus-4-6"}}

  7. it235 commented on Mar 10, 2026

    @it235

    2.1.72 fix the bug, but I haven't verified it yet.

    I also noticed this fix, but I spent 3 hours researching version 2.1.72 and the issue still exists and has not been fixed
    @team-lead> code-review ⎿  API Error: 400 event:error data:{"code":"InvalidParameter","message":"model 'claude-opus-4-6' not found or not supported","request_id":"07ff7a59-4a17-94b6-99be-365b68c5b68f"}

    Yes, I tested it and I'm sure it didn't fix it. @team-lead❯ ⎿  API Error: 400 {"error":{"code":"400","message":"Param Incorrect","param":"Not supported model claude-opus-4-6"}}

    I feel that this issue will not be fixed in the short term because unofficial sources are not taken seriously. I have searched through many issues but have not received any further updates. My boss is urging me why it is so simple that I cannot get through

  8. MasterXue commented on Mar 10, 2026

    @MasterXue

    2.1.72 fix the bug, but I haven't verified it yet.

    I also noticed this fix, but I spent 3 hours researching version 2.1.72 and the issue still exists and has not been fixed
    @team-lead> code-review ⎿  API Error: 400 event:error data:{"code":"InvalidParameter","message":"model 'claude-opus-4-6' not found or not supported","request_id":"07ff7a59-4a17-94b6-99be-365b68c5b68f"}

    Yes, I tested it and I'm sure it didn't fix it. @team-lead❯ ⎿  API Error: 400 {"error":{"code":"400","message":"Param Incorrect","param":"Not supported model claude-opus-4-6"}}

    I feel that this issue will not be fixed in the short term because unofficial sources are not taken seriously. I have searched through many issues but have not received any further updates. My boss is urging me why it is so simple that I cannot get through

    Why does the Changelog say the issue has been fixed? I think Agent Teams works great, but this bug has made it unusable.

  9. MasterXue commented on Mar 12, 2026

    @MasterXue

    v2.1.74 maybe fix it, i tested it

  10. East-rayyy commented on Mar 16, 2026

    @East-rayyy

    @gavinyao — teammates defaulting to the wrong model ID is a known alias resolution issue. I built claude-alias-patch that fixes this by patching the model resolver and env var whitelist in cli.js.

    It also lets you register custom model aliases via ANTHROPIC_DEFAULT_*_MODEL env vars, so if you're using a custom endpoint, your aliases map directly to the correct model IDs. Single install script — auto-patches your Claude instance.

  11. 4 remaining items

  12. Qingco commented on Apr 17, 2026

    @Qingco

    PS E:\Claude Code> claude -v
    2.1.112 (Claude Code)
    仍然存在这个问题啊

  13. freeformz commented on May 19, 2026

    @freeformz

    This was solved for me by modelOverrides in settings.

  14. tangwei-dev commented on Jun 10, 2026

    @tangwei-dev

    This was solved for me by modelOverrides in settings.

    It works!

  15. github-actions commented on Jul 18, 2026

    @github-actions

    Closing for now — inactive for too long. Please open a new issue if this is still relevant.

  16. github-actions commented on Sep 15, 2026

    @github-actions

    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.

  17. locked as resolved and limited conversation to collaborators on Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:agentsarea:modelbugSomething isn't workinghas reproHas detailed reproduction stepsplatform:macosIssue specifically occurs on macOSstaleIssue is inactive

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions