Skip to main content

Module opencode

Module opencode 

Source
Expand description

OpenCode HarnessAdapter — Rust port of packages/cli/src/harnesses/opencode.ts.

OpenCode shares the pending-stamp + watch-loop shape with codex, so the adapter is constructed via super::pending_stamp::session_store_adapter instead of re-implementing the trait. The only opencode-specific bits are:

  • name = "opencode" — the dispatch key and log-line label.
  • session_root$HOME/.local/share/opencode/storage/session, resolved lazily so tests that override $HOME see the override. Mirrors the TS sibling’s path.join(homedir(), '.local', 'share', 'opencode', 'storage', 'session') exactly.
  • ingest_sessions — defers to relayburn_sdk::ingest_opencode_sessions, the opencode-only ingest pass. The factory opens a fresh ledger handle per call (mirrors the TS lock-then-write-then-close shape; SQLite WAL keeps the per-tick open cheap).

Functions§

adapter
Hand out a &'static dyn HarnessAdapter for opencode. The registry calls this once at lazy-init time. See pending_stamp::session_store_adapter for the leak semantics.