Skip to content

[Bug]: delegate_task with category parameter fails with "JSON Parse error: Unexpected EOF" - categories config ignored #1264

@64andrewwalker

Description

@64andrewwalker

Prerequisites

  • I will write this issue in English (see our Language Policy)
  • I have searched existing issues to avoid duplicates
  • I am using the latest version of oh-my-opencode
  • I have read the documentation

Bug Description

When using delegate_task with the category parameter (e.g., category="quick"), the task fails with JSON Parse error: Unexpected EOF.

Root cause investigation reveals:

  1. The category system ignores the categories configuration in oh-my-opencode.json
  2. Instead, it falls back to a hardcoded model (opencode/claude-haiku-4-5) which doesn't exist for users without OpenCode Zen access
  3. This causes the agent to fail immediately with EOF error (no response from non-existent model)

Additionally: The disabled_hooks: ["category-skill-reminder"] config option appears to not work - the hook still fires despite being in the disabled list.

Steps to Reproduce

  1. Configure oh-my-opencode.json with custom category models:

    {
      "categories": {
        "quick": { "model": "openai/gpt-5.2" },
        "visual-engineering": { "model": "google/antigravity-gemini-3-pro-high" }
      },
      "disabled_hooks": ["category-skill-reminder"]
    }
  2. Use delegate_task with category:

    delegate_task(category="quick", load_skills=[], prompt="Say hello", run_in_background=false)
    
  3. Observe error:

    Send prompt failed
    
    **Error**: JSON Parse error: Unexpected EOF
    **Agent**: sisyphus-junior (category: quick)
    
  4. Note that the [Category+Skill Reminder] hook output still appears despite being in disabled_hooks.

Expected Behavior

  1. delegate_task(category="quick", ...) should use the model configured in categories.quick.model
  2. The disabled_hooks configuration should prevent the specified hooks from running

Actual Behavior

  1. Category-based delegation fails with JSON Parse error: Unexpected EOF
  2. The system appears to ignore the categories config and fall back to a hardcoded default model
  3. disabled_hooks: ["category-skill-reminder"] has no effect - the hook still runs

Workaround

Using subagent_type instead of category works correctly:

delegate_task(subagent_type="general-gemini-3-flash", ...)  # Works
delegate_task(category="quick", ...)                         # Fails

Doctor Output

Installation
────────────────────────────────────────
  ✓ OpenCode Installation → 1.1.42
  ✓ Plugin Registration → Registered (pinned: latest)

Configuration
────────────────────────────────────────
  ✓ Configuration Validity → Valid JSON config

Error Logs

SyntaxError: JSON Parse error: Unexpected EOF
    at <parse> (:0)
    at parse (unknown)
    at processTicksAndRejections (native:7:39)

Configuration

{
  "$schema": "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/master/assets/oh-my-opencode.schema.json",
  "disabled_hooks": ["category-skill-reminder"],
  "categories": {
    "quick": { "model": "openai/gpt-5.2" },
    "visual-engineering": { "model": "google/antigravity-gemini-3-pro-high" },
    "ultrabrain": { "model": "openai/gpt-5.2" },
    "artistry": { "model": "google/antigravity-gemini-3-pro-high" },
    "unspecified-low": { "model": "google/antigravity-gemini-3-flash" },
    "unspecified-high": { "model": "google/antigravity-gemini-3-pro-high" },
    "writing": { "model": "google/antigravity-gemini-3-pro-high" }
  },
  "agents": {
    "sisyphus-junior": { "model": "openai/gpt-5.2" }
  }
}

Additional Context

Related issues:

Investigation notes:

  • The sisyphus-junior agent is used for category-based delegation
  • Both agents.sisyphus-junior.model and categories.*.model configs are ignored
  • The fallback chain appears to select opencode/claude-haiku-4-5 regardless of config
  • Users without direct Anthropic/OpenCode Zen access cannot use categories at all

Operating System

macOS

OpenCode Version

3.1.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions