Description
Non-Claude models (tested: MiniMax M2.5, Gemini 2.5 Flash, Qwen 3.5 35B) consistently fail to invoke the task tool because they send agent or agent_type instead of subagent_type. The Zod schema rejects these with invalid_type on the subagent_type path, and models retry in a loop without recovering.
Claude models work because they're trained on this specific parameter name. Every other model I tested guesses the more natural agent — which seems reasonable given the tool spawns an agent.
Example error (repeats 20+ times until the model gives up):
The task tool was called with invalid arguments: [
{
"expected": "string",
"code": "invalid_type",
"path": ["subagent_type"],
"message": "Invalid input: expected string, received undefined"
}
]
Steps to reproduce
- Configure a non-Claude model (e.g.,
opencode/minimax-m2.5-free)
- Define a subagent in
.opencode/agents/
- Prompt: "Use the task tool to spawn the Engineer agent to say hello"
- Model sends
{ agent: "Engineer", ... } — Zod rejects it because subagent_type is required and missing
Environment
- OpenCode: 1.3.13 (also reproduced on latest dev at
8daeacc98)
- OS: macOS 15.4 (arm64)
- Models tested: MiniMax M2.5 Free, Gemini 2.5 Flash, Qwen 3.5 35B-A3B via MLX
Description
Non-Claude models (tested: MiniMax M2.5, Gemini 2.5 Flash, Qwen 3.5 35B) consistently fail to invoke the task tool because they send
agentoragent_typeinstead ofsubagent_type. The Zod schema rejects these withinvalid_typeon thesubagent_typepath, and models retry in a loop without recovering.Claude models work because they're trained on this specific parameter name. Every other model I tested guesses the more natural
agent— which seems reasonable given the tool spawns an agent.Example error (repeats 20+ times until the model gives up):
Steps to reproduce
opencode/minimax-m2.5-free).opencode/agents/{ agent: "Engineer", ... }— Zod rejects it becausesubagent_typeis required and missingEnvironment
8daeacc98)