Task Tool Model Parameter Causes API 404 Error
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Version: Claude Code 2.0.42
Platform: Linux (WSL2)
Date: 2025-11-15
Issue Description
When using the Task tool with the optional model parameter set to "sonnet", "opus", or "haiku", the API returns a 404 error because the short model name is not being resolved to the full model ID before making the API call.
Steps to Reproduce
- Launch Claude Code (version 2.0.42)
- Use the Task tool with a
modelparameter:
{
"description": "Find personality type algorithm",
"prompt": "Explore this Django project...",
"subagent_type": "Explore",
"model": "sonnet"
}
- Receive the following error:
API Error: 404 {"type":"error","error":{"type":"not_found_error","message":"model: sonnet"},"request_id":"req_011CV9MB7Uz8wyruj5Xmbj4s"}
Expected Behavior
The model parameter "sonnet" should be resolved to the full model ID (e.g., "claude-sonnet-4-5-20250929") before making the API call, as defined in the Task tool schema:
"model": {
"description": "Optional model to use for this agent...",
"enum": ["sonnet", "opus", "haiku"],
"type": "string"
}
What Should Happen?
Actual Behavior
The API receives "sonnet" as the literal model name instead of the full model ID, resulting in a 404 not found error.
Workaround
Avoid specifying the model parameter in Task tool calls. The subagent will inherit the parent's model, which works correctly.
Environment Details
- Node.js: v24.7.0
- Claude Code: 2.0.42 (installed via npm globally)
- OS: Linux 6.6.87.2-microsoft-standard-WSL2
- Authentication: OAuth (Claude Max)
Additional Context
The cli.js file contains references to full model IDs like "claude-sonnet-4-5", "claude-opus", "claude-haiku" for Vertex region configuration, but the model alias resolution for Task tool subagents appears to be missing or broken.
Error Messages/Logs
API Error: 404 {"type":"error","error":{"type":"not_found_error","message":"model: sonnet"},"request_id":"req_011CV9MB7Uz8wyruj5Xmbj4s"}
Steps to Reproduce
- Launch Claude Code (version 2.0.42)
- Use the Task tool with a
modelparameter:
{
"description": "Find personality type algorithm",
"prompt": "Explore this Django project...",
"subagent_type": "Explore",
"model": "sonnet"
}
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.0.42
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗