0.6: Cockpit on OpenCode 2 — one package for 1 and 2, logging, doctor - #18
Merged
Merged
Conversation
The full-screen shell console and the Review pane painted with the theme's background, which the "system" theme leaves transparent, so the conversation showed through. Both now use the first opaque background, or a solid fallback. docs/opencode/v2.md records what was measured on 1.18.32 and 2.0.15. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Bays will talk to Host, the ~30 calls they use named as v1 names them. fromV1 wraps the v1 API; fromV2 builds the same shape on the v2 context (theme tokens under v1 names, slot paths, keymap layers, storage-backed kv, renderer key stream for intercept). dualTui makes one entry both load. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Shell, Review, Statusline, Updater and the bundle start through dualTui. Component dialogs became host prompt/confirm/select; the console's keys a host-owned layer; Review's submit and Statusline's brief go through promptSession; Statusline reads v2 session data (cost, tokens, model limit). The Updater points at OpenCode 2's own plugin update. v1 answers a dialog before clearing it — clearing fires the close handler, which settled every prompt as cancelled. The smoke test takes OPENCODE. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…and 2 Agent side - client/server: ServerHost, dualServer, composeParts. Shell and Review write their tools and hooks once; v1 gets hooks, v2 gets tool.transform, the "context" hook and the event stream. Tools keep v1's tool(); v2 is given their input-side JSON Schema and arguments are parsed here, so defaults apply on both. v1's preview call to setup is skipped. - Measured end to end: a real agent turn on v1 1.18.32 and v2 2.0.15 calls shell_start and review_list and is told the guidance. Fixes found on v2 - Review drew nothing: a dead titleColor prop blanked the overlay. - Theme: action and feedback tokens are a colour per state; accent and primary are palettes, not text.action (which is white). Mapping checked against both default themes, captured as fixtures. - Statusline modules outside a project: v2 words the resolve error differently, so the fallback never ran. Logging - client/log: one cockpit.log for both halves of every bay, levels, rotation, COCKPIT_DEBUG=1 (daemon too). Starts, errors with stacks, failed tools. First lines were lost before the cockpit home existed; tests no longer write the developer's log. Doctor - npx opencode-cockpit doctor: OpenCode version, config in both spellings, what last ran, recent errors, daemon, git/ps, settings. Prints the fix for the OpenCode installed; --json; exit 1 on failure. Node only. Docs and floor - Site: OpenCode 1 and 2 page, install for both, doctor page, troubleshooting around the log; landing install tab for v2. - Floor stays OpenCode 1.18.0: the full smoke passes on 1.18.0 and 1.18.28. - v2 known limits documented, shell_start permission first among them. - dev:install for testing a checkout; smoke covers full screen, plugin failures and (AGENT=1) a real agent turn. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- log: the size and directory were checked once per process, so a long debug session grew the file without bound, and a cache cleared under a running OpenCode stopped the log until restart. Rechecked every 256 lines, and after a failed write. - doctor: OpenCode 1 never reads cli.json, so panels configured only there are a missing half; OpenCode 2 loads the interface from opencode.json too, so the bundle there and a bay in cli.json is the bay loaded twice. Entries in a file the installed OpenCode ignores are marked as such. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cockpit runs on OpenCode 1.18+ and 2.0.15+ from the same packages. Each entry carries a v1 half (
tui/server) and a v2 half (setup); whichever OpenCode loads it picks its own.How
@opencode-cockpit/client/host— the interface half of every bay is written once againstHost;fromV1/fromV2supply it,dualTuimakes the entry.@opencode-cockpit/client/server— the same for the agent half: tools and hooks once, registered as v1 hooks or on v2'stool.transform,session.hook("context")and event stream.Also in this release
~/.cache/opencode-cockpit/cockpit.logfor both halves of every bay;COCKPIT_DEBUG=1for detail.npx opencode-cockpit doctor— checks a setup on either OpenCode and prints the fix.Known limits on OpenCode 2 (documented on the site)
shell_startruns without a permission prompt — v2 gives plugin tools no documented way to ask. Next up (roadmap).execute);/plugins-updatedefers to editingopencode.json; statuslinelspsegment is empty.Verified
bun run check: 933 tests pass;pack:checkpasses, includingdoctor --helpunder Node.smoke:tuiwithAGENT=1on OpenCode 2.0.15 and 1.18.32: panels live, console, full screen, statusline, Review diff, updater, and a real agent turn callingshell_start+review_list.+ note, gutter).Release as 0.6.0 after merge; the release script bumps every install pin, including the new v2 forms.
🤖 Generated with Claude Code