Skip to content

Support opencode v2 in Pulse for opencode (0.2.0) - #17

Merged
fatwang2 merged 1 commit into
mainfrom
claude/project-thread-8hfo8k
Nov 3, 2026
Merged

fatwang2 merged 1 commit into
mainfrom
claude/project-thread-8hfo8k

Conversation

@fatwang2

@fatwang2 fatwang2 commented Nov 3, 2026

Copy link
Copy Markdown
Owner

opencode v2 (@opencode/cli 2.x) has a new TUI plugin API. The opencode Ecosystem reviewer asked for v2 support before listing the plugin (anomalyco/opencode#61387).

What changed

  • One package for both opencode lines. src/tui.tsx exports { id, tui, setup }. v1 (1.15+) calls tui and v2 calls setup; both resolve the same ./tui entry.
  • src/v1.tsx: the existing v1 host, unchanged in behavior.
  • src/v2.tsx: the new v2 host. The sidebar panel appends to sidebar.content. The quote band appends to app (the bottom line, which is the default) or to prompt.footer (right). Commands are added with keymap.layer (palette and slash), state is kept with storage.store, and dialogs use v2's promise API. Nothing in opencode's own UI is replaced.
  • src/view.tsx: the panel and band, shared by both hosts.
  • A v2-specific fix: storage.store updates only after its file is written, so an edit is held in memory until then. Without this, the panel lagged one edit behind.
  • README: install steps for v2 (opencode plugin add, cli.json) and v1 (tui.json). AGENTS.md is updated to match. Version bumped to 0.2.0.

Testing

  • make test-opencode passes.
  • opencode 2.2.5 (cloud container): checked the sidebar panel, the bottom band, the right placement, /pulse-add, /pulse-remove, /pulse-pause and /pulse-band. Also checked clicking a row (detail dialog), folding the panel, and that state persists in v2 storage.
  • opencode 1.19.5: checked the sidebar panel and the bottom band after the refactor.

Generated by Claude Code

opencode v2 (@opencode/cli 2.x) loads the same ./tui entry but calls a
setup(context) function with a new plugin API. The module now exports
{ id, tui, setup }: v1.tsx keeps the 1.15+ host, v2.tsx adds the v2 host
(slot claims on sidebar.content, app and prompt.footer; keymap layer;
storage; promise dialogs), and both render the shared views in view.tsx.

v2's storage store updates only after its file is written, so an edit is
held in memory until then; without this the next refresh read the old
list back and the panel lagged one edit behind.

Tested in opencode 2.2.5 and 1.19.5. Version 0.2.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DuYf7wf62kLrVeZHzMtocm
@fatwang2
fatwang2 merged commit 0dae1f8 into main Nov 3, 2026
4 checks passed
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.

2 participants