Skip to content

OpenCode chat support #538

Closed
Closed

Description

@Ploppy3

Problem

OpenCode panes work in the terminal view, but the Chat tab has no native transcript. herdr already reports the agent and its session for the pane (agent: "opencode", agent_session: {"agent":"opencode","kind":"id","source":"herdr:opencode","value":"ses_…"}), but the conversation endpoint falls back:

GET /api/pane/conversation?pane_id=…  →  {"source":"scrollback","turns":[]}

so a session is readable on a phone only through the raw terminal.

Proposal

A transcript adapter for OpenCode, like the existing readers for claude, codex, omp, omo, gjc and pi:

  • Bind the pane to its session through the id herdr already reports (herdr:opencode), not a guess from cwd.
  • Read OpenCode's own store read-only. In 2.0.24 it is SQLite in the data directory (XDG_DATA_HOME, else ~/.local/share/opencode/opencode.db): session_v2 (id, directory, title, version) and session_message (session_id, type user/assistant/idle, data as JSON; an assistant's data.content parts carry text, reasoning and tool calls with input/output). Earlier releases wrote JSON files under storage/; the adapter should check what the versions in use actually write.
  • Map prompts and assistant text to turns, fold tool calls and outputs into the existing "Worked for …" block, and keep the terminal fallback when no session resolves.
  • Prompt cards for OpenCode's permission prompts could come later.

Where

Chat and prompt cards

Workarounds and alternatives

Use OpenCode's own TUI in the terminal view. Related: #359 requests the same for Prime Agent, whose store is pi-like.

Activity

  1. added a commit that references this issue on Oct 8, 2026
    cc9701c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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