AO

OpenCode

OpenCode terminal agent. Uses the OpenCode session API for resume and discovery.

Slot: agent · Name: opencode · Binary: opencode

OpenCode is an open-source terminal coding agent. It has a structured session API, which means AO can discover, resume, and track its sessions reliably.

macOSSupported
LinuxSupported
WindowsSupported

Install

npm install -g opencode-ai

Use

agent-orchestrator.yaml
agent: opencode

No plugin-level config.

How it works

  • Launch: opencode starts in the worktree with AO:<sessionId> as the session title — this is how AO finds it back later.
  • Session discovery: opencode session list --format json returns the list; AO matches on the title prefix.
  • Resume: opencode --session <id> rehydrates the state.
  • Activity tracking: Primary signal is the OpenCode session's updatedAt. AO falls back to its own activity JSONL if the session API doesn't answer.
  • PR + git tracking: PATH wrappers for gh / git.

Environment variables

VariableSet by AOPurpose
AO_SESSION_IDAO session id
AO_ISSUE_IDIssue identifier
PATHPrepends ~/.ao/bin
GH_PATHAbsolute path to real gh

Troubleshooting