Skip to content

feat(opencode): add OpenCode as a third harness alongside Codex/Claude#23

Open
d180 wants to merge 2 commits into
AlmanacCode:mainfrom
d180:feat/opencode-harness
Open

feat(opencode): add OpenCode as a third harness alongside Codex/Claude#23
d180 wants to merge 2 commits into
AlmanacCode:mainfrom
d180:feat/opencode-harness

Conversation

@d180

@d180 d180 commented Jul 9, 2026

Copy link
Copy Markdown

Summary

  • Add OpenCode as a third harness alongside Codex and Claude (issue Support OpenCode #9): local opencode serve process management, an HTTP client, event/part mapping, and setup wizard + transcript discovery integration.
  • Add live-progress narration and hang detection for OpenCode runs, polling OpenCode's own SQLite store while a run is in flight. This works around a confirmed, currently-open upstream OpenCode bug where tool calls (glob/read/bash) have no internal timeout and can hang forever.
  • Change OpenCode's harness.model config validation from a fixed allowlist to a provider/model shape check, since OpenCode is a router that accepts any provider the user has authenticated — unlike Codex/Claude, which genuinely only offer a fixed handful of models and keep their allowlists.
  • De-duplicate append_event/emit_result, which had drifted into three separate copies across the Codex/Claude/OpenCode harnesses, into one shared module.
  • Fix a real Windows bug found during review: start_opencode_server() never resolved the opencode executable through PATH/PATHEXT, so an npm-installed shim would pass check()'s version probe but fail every real run.

Why

OpenCode was the one harness planned but not yet built (tracked in issue #9). Building it surfaced a real reliability gap (OpenCode's tool layer can hang indefinitely with no error), which needed a fix beyond just wiring up the adapter, or the harness would be unusable on any real repo.

Verification

uv run pytest        # 482 passed
uv run ruff check .  # All checks passed
uv build --out-dir dist   # both wheel and sdist built
uvx twine check dist/*    # both PASSED

Also live-tested end-to-end against a real project and a real opencode serve instance (not just fixtures): init and garden both completed cleanly with a healthy resulting wiki (codealmanac health reports zero orphans/dead refs/broken links).

Docs and wiki

  • README/docs updated if user-facing behavior changed.
  • .almanac/ wiki updated if an implementation decision, workflow, invariant, or gotcha changed.
  • Not applicable.

Notes for reviewers

Closes #9

@d180 d180 force-pushed the feat/opencode-harness branch from 6d3c1ee to 434ca3e Compare July 10, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support OpenCode

1 participant