Documentation
¶
Overview ¶
Package opencode implements adapters.HarnessAdapter for the opencode CLI.
Run() forks `opencode run` with signal forwarding and exit normalisation. Unlike the claude adapter, session persistence, payload-patch application, and boid task notify integration are not wired.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct{}
Adapter implements adapters.HarnessAdapter for the opencode CLI.
func (*Adapter) Bindings ¶
Bindings declares the host bind-mounts opencode.Adapter.Run() needs inside the sandbox.
Returns nil: opencode CLI state and skills reach the sandbox via the workspace HOME volume (internal/dispatcher/workspace_home.go) and dispatcher-owned skill mounts (skills_overlay.go) instead of an adapter-declared bind. The opencode CLI binary itself is expected to be installed into that workspace home by the workspace's init.sh; a missing binary fails fast with an explicit message from Run() (run.go's missingCLIError).
Non-embedded host skills (bitbucket, jira, google-* etc.) have no adapter-side exposure path: a workspace that wants opencode to see them is the workspace author's responsibility, via the workspace's init.sh copying them into the workspace home (e.g. `cp -r ~/.claude/skills/<name> "$BOID_WORKSPACE_HOME/.claude/skills/"`).
func (*Adapter) Run ¶
Run forks opencode. Interactive vs non-interactive is keyed off rc.TaskID: session jobs (JobKindSession) carry no task and are user-initiated, so they land in interactive TUI mode; hook jobs carry a BOID_TASK_ID and fall through to non-interactive `opencode run`. Mirrors the codex adapter and how the claude adapter discriminates JobKindSession from JobKindHook via rc.TaskID == "".
Other responsibilities mirror the claude / codex adapters: signal forwarding via sigutil, exit code normalisation for daemon-initiated stops, PWD strip on the child env, and cmd.Dir as the source of truth for the workdir.
Session persistence and payload-patch application are deliberately NOT wired here — interactive sessions are run-and-done, no resume yet.