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
3 Commits
Author SHA1 Message Date
sam_oneal 249fcb687a chore(lazy): pin opencode.nvim v1.0.2 in lazy-lock.json 2026-09-21 07:04:23 -06:00
sam_oneal 01780e13e8 fix(ai): point opencode.nvim at pinned V1 binary; keep terminal on v2
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.
2026-09-21 07:03:08 -06:00
sam_oneal 6592e167d7 fix(ai): restore opencode.nvim integration with OpenCode V1 CLI
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
2026-09-21 06:49:39 -06:00