Repository navigation
Description
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
- Configure Claude Code to use a custom/internal model endpoint
- Enable Agent Teams experimental feature:
{ "env": { "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" } } - Create a team:
TeamCreate with team_name: "test-team" - Spawn teammates:
Agent with subagent_type: "general-purpose", team_name: "test-team" - 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_notificationwithout 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:
- The
modelparameter passed to the Agent tool, OR - The team lead's current model configuration, OR
- 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
github-actions commentedon Mar 9, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
junaidtitan commentedon Mar 9, 2026
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.jsonThe check detects when
~/.claude/settings.jsonis missing amodelkey while team directories are present — since that's the condition where subagents silently fall back toclaude-opus-4-6instead 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.gavinyao commentedon Mar 9, 2026
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
═══════════════════════════════════════════════════════════════════
All clear — no issues found.
MasterXue commentedon Mar 10, 2026
https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#2172
2.1.72 fix the bug, but I haven't verified it yet.
it235 commentedon Mar 10, 2026
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"}
MasterXue commentedon Mar 10, 2026
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"}}
it235 commentedon Mar 10, 2026
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
MasterXue commentedon Mar 10, 2026
Why does the Changelog say the issue has been fixed? I think Agent Teams works great, but this bug has made it unusable.
MasterXue commentedon Mar 12, 2026
v2.1.74 maybe fix it, i tested it
East-rayyy commentedon Mar 16, 2026
@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_*_MODELenv 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.4 remaining items
refactor: 3-agent auto-improve with pre-cycle PR maintenance (#34)
Qingco commentedon Apr 17, 2026
PS E:\Claude Code> claude -v
2.1.112 (Claude Code)
仍然存在这个问题啊
freeformz commentedon May 19, 2026
This was solved for me by modelOverrides in settings.
tangwei-dev commentedon Jun 10, 2026
It works!
github-actions commentedon Jul 18, 2026
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
github-actions commentedon Sep 15, 2026
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.