Skip to content

[Bug]: Librarian agent fails with JSON Parse error: Unexpected EOF #683

@travka

Description

@travka

Describe the bug

The librarian agent consistently fails with a JSON Parse error: Unexpected EOF when invoked via call_omo_agent or background_task.

Interestingly, the explore agent, configured with the exact same model (google/antigravity-gemini-3-flash), works perfectly.

To Reproduce

  1. Configure oh-my-opencode.json with a valid Gemini model for librarian (e.g., google/antigravity-gemini-3-flash).
  2. Run a task that triggers the librarian agent, or call it directly:
    call_omo_agent({
      description: "Test librarian",
      prompt: "Search for documentation about X",
      run_in_background: false,
      subagent_type: "librarian"
    })
  3. See error: Error: Failed to send prompt: JSON Parse error: Unexpected EOF

Expected behavior

The librarian agent should successfully spawn, perform its search/retrieval tasks, and return a response.

Environment

  • oh-my-opencode version: 2.14.0
  • OpenCode version: 1.1.12
  • Model used: google/antigravity-gemini-3-flash
  • Platform: macOS (Darwin)

Additional context

  • explore agent works fine with the same model.
  • oracle agent (GPT-5.2) works fine.
  • The error happens immediately upon sending the prompt.
  • Session logs show the user message being sent to the librarian session, but the assistant never responds (EOF reached before response start).

Possible causes:

  • Malformed system prompt for the librarian agent causing Gemini to return empty/invalid JSON.
  • Transient API issue (though persistent across multiple retries).
  • Regression in 2.14.0 related to librarian's tool definitions or instructions.

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