Expand description
OpenCode headless runner for ingest and enrich pipelines (v1.0.90).
Symmetric to claude_runner.rs (claude -p) and codex_spawn.rs
(codex exec). Builds the opencode run command, parses NDJSON
output, and provides rate-limit backoff.
Functionsยง
- build_
opencode_ command - Build the opencode run command with hardening flags.
- build_
opencode_ command_ sync - Build a sync
std::process::Commandfor opencode. - call_
opencode - Call opencode headless and return the parsed JSON response.
- find_
opencode_ binary - find_
opencode_ binary_ with_ override - Resolve the opencode binary path.
- parse_
json_ from_ opencode_ text - Parse a JSON value from opencode output text.
- parse_
opencode_ output - Parse the NDJSON output from
opencode run --format json. - propagate_
opencode_ env - Propagate opencode-relevant env vars into a subprocess.
- propagate_
opencode_ env_ sync - Propagate opencode-relevant env vars into a sync subprocess.
- resolve_
opencode_ model - Resolve the opencode model name.
- resolve_
opencode_ timeout - Resolve the opencode timeout in seconds.
- spawn_
opencode - Spawn opencode with setsid for process group isolation but WITHOUT RLIMIT_AS. The Bun runtime inside opencode uses aggressive virtual memory mappings that exceed the 4 GB limit applied to claude/codex.
- validate_
opencode_ version - Validate the installed opencode version meets the minimum requirement.