Documentation
¶
Overview ¶
ox-adapter-opencode is the external adapter binary for OpenCode sessions.
OpenCode stores sessions in a SQLite database at ~/.local/share/opencode/opencode.db. Hooks are installed as TypeScript plugins at .opencode/plugin/ox-prime.ts. Session reading queries SQLite directly using modernc.org/sqlite (pure Go, no CGo).
serve.go handles the long-running serve mode for incremental session reading.
session.go handles OpenCode session reading from SQLite.
OpenCode stores sessions in ~/.local/share/opencode/opencode.db with two tables: sessions (id, title, created_at, updated_at) and messages (id, session_id, role, parts JSON, model, created_at). The parts column is a JSON array of {type, data} wrappers where type is one of: text, tool_call, tool_result, reasoning, finish.