[BUG] Agent tool model parameter accepts only family aliases; aliases resolve to the latest model and cause a 401 for teams with a restricted allowlist
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?
The model parameter of the Agent tool accepts only four family aliases. The aliases are sonnet, opus, haiku and fable. The parameter does not accept a full model ID, for example claude-opus-4-7.
Each alias resolves to the newest model in that family. The resolution ignores the model allowlist of the team. My team allowlist contains three Opus versions. The allowlist does not contain the newest Opus version. Therefore the alias opus resolves to a model that my team cannot use.
The result is a subagent that cannot start. The API returns a 401 error. The team has no permitted value for the model parameter, although the allowlist contains three Opus models.
The failure is silent in the wrong direction. The caller sends opus and expects an approved model. The system selects a different model. The system gives no warning at configuration time. The error occurs only when the subagent starts. The failed subagent also consumes tokens before the error.
What Should Happen?
The caller can select an approved model version for a subagent. The subagent starts and does the task.
The model parameter accepts a full model ID, for example claude-opus-4-7. The four aliases stay valid.
Error Messages/Logs
InputValidationError: [
{
"code": "invalid_value",
"values": ["sonnet", "opus", "haiku", "fable"],
"path": ["model"],
"message": "Invalid option: expected one of \"sonnet\"|\"opus\"|\"haiku\"|\"fable\""
}
]
Steps to Reproduce
Preconditions: the team allowlist permits claude-opus-4-5, claude-opus-4-6 and claude-opus-4-7. The allowlist does not permit the newest Opus model.
- Start a Claude Code session.
- Call the Agent tool with
model: "claude-opus-4-7". This value is a permitted model for the team. The tool rejects the value with an InputValidationError. The error shows the four permitted aliases. - Call the Agent tool again with
model: "opus". This alias is the only permitted Opus value in the schema. - The subagent starts with the newest Opus model. The allowlist does not contain this model. The subagent stops, and the API returns a 401 error.
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.232
Platform
Google Vertex AI
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗