Skip to content

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

Closed as not planned

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

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 3, 2026
  2. added a commit that references this issue on Apr 3, 2026
    91aa0e2
  3. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  4. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions