fix(ai): restore opencode.nvim integration with OpenCode V1 CLI #10

Merged
sam_oneal merged 3 commits from fix/opencode-ai into main 2026-09-21 13:09:26 +00:00
Owner
No description provided.
sam_oneal added 3 commits 2026-09-21 13:09:20 +00:00
opencode.nvim drives the HTTP API that `opencode --port` exposes, but the
installed OpenCode v2.0.11 CLI removed the --port flag and replaced the server
API (pairing auth, new endpoints). opencode.nvim does not support v2 yet
(upstream issue nickjvandyke/opencode.nvim#322), so:

- Bump opencode.nvim to v1.0.2 (latest V1-compatible release)
- Migrate to its current API: snacks `opencode_send` picker action now uses
  format()/prompt() (snacks_picker_send was removed in v0.12.0), drop the
  opencode.terminal on_win hook and the removed server.stop/server.toggle and
  lsp opts
- Move <leader>at toggling to snacks.terminal.toggle (opencode.toggle() was
  removed in v1.0.2)
- Fix the session.half.page.up typo (sesion -> session) in the scroll-up keymap
- Document the V1 CLI requirement and pin instructions in the README
opencode.nvim requires the V1 CLI (--port was removed in v2). Use the
pinned V1 binary at ~/.opencode/bin/opencode explicitly for both the
server spawn (ai.lua) and the <leader>at toggle (keymaps.lua), so the
interactive shell keeps resolving 'opencode' (v2) from its normal PATH.

Scope OPENCODE_DISABLE_AUTOUPDATE=1 to the spawned V1 process via
snacks.terminal env (jobstart merges env over the parent environment) so
the pinned binary cannot replace itself with v2, without freezing the
terminal's v2 updates.
sam_oneal merged commit 249fcb687a into main 2026-09-21 13:09:26 +00:00
sam_oneal deleted branch fix/opencode-ai 2026-09-21 13:09:26 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam_oneal/nvim-config#10