Closed as not planned
Closed as not planned
Copy link
Description
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 becausesubagent_typeis 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
Metadata
Metadata
Assignees
Labels
No labels
Activity
fix(opencode): accept agent and agent_type as task tool parameter ali…
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.