Skip to content

Non-Claude models fail to call task tool due to required subagent_type parameter #20804

@jbmml

Description

@jbmml

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

  1. Configure a non-Claude model (e.g., opencode/minimax-m2.5-free)
  2. Define a subagent in .opencode/agents/
  3. Prompt: "Use the task tool to spawn the Engineer agent to say hello"
  4. 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

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions