Skip to content

Commit 8faf2bf

Browse files
committed
docs: correct variants, plan mode, sqlite self-heal
Align docs with rc.2: variants are per reasoning/effort level (boolean params collapse to one on-variant), no synthetic plan variant; document plan agent → Cursor plan mode; add sqlite binding self-heal and stale plugin-cache troubleshooting; add the rc.2 changelog entry.
1 parent a436ad9 commit 8faf2bf

2 files changed

Lines changed: 52 additions & 7 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,29 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
- `0.1.0-rc.2` — pre-release on the npm `next` dist-tag. Fixes found while
8+
validating rc.1 against opencode 1.16.2:
9+
- **Plugin now loads when installed by package name.** Added the
10+
`exports["./server"]` entry opencode uses to resolve a plugin's entrypoint;
11+
rc.1 exposed the plugin only at `./plugin`, which opencode does not read, so
12+
the package installed but registered no hooks (no provider, no models).
13+
- **Self-heal the `sqlite3` native binding.** opencode installs plugins with
14+
Bun, which skips sqlite3's install script, so `@cursor/sdk`'s
15+
`require("sqlite3")` failed with "Could not locate the bindings file". The
16+
plugin now runs sqlite3's `prebuild-install -r napi` under the system Node
17+
before loading the SDK (once per process, never throws).
18+
- **Stream ordering.** The final answer no longer renders above the reasoning
19+
blocks that preceded it — the open text part is closed when reasoning
20+
resumes and each resume opens a fresh text part.
21+
- **Model variants reach the picker.** Variants are seeded on the
22+
config-injected models (opencode discards the `provider.models()` hook for
23+
providers outside its models.dev catalog). Variant naming reworked against
24+
the real catalog: boolean params (e.g. `thinking`) collapse to one
25+
param-named variant instead of literal `true`/`false`; enum params key by
26+
value. The synthetic `plan` variant was removed.
27+
- **Plan agent → Cursor plan mode.** opencode's plan agent (`Tab`) is mapped
28+
to Cursor's plan mode via the `chat.params` hook; an explicit variant/option
29+
mode still wins.
730
- `0.1.0-rc.1` — first pre-release of the 0.1.0 surface below, published to the
831
npm `next` dist-tag for validation ahead of the stable `0.1.0`.
932

@@ -21,8 +44,9 @@ and a permission-gated delegation tool surface.
2144
tool activity, usage). Implements both `doStream()` and `doGenerate()`.
2245
- **Per-request controls** via `providerOptions.cursor` — `mode` (agent/plan),
2346
`params`, and `thinking` level; works with opencode's model variant picker.
24-
- **Model variants** auto-generated from `Cursor.models.list` parameters: a
25-
`plan` variant plus one per reasoning level a model advertises.
47+
- **Model variants** auto-generated from `Cursor.models.list` parameters: one
48+
per reasoning/effort level a model advertises (boolean params collapse to a
49+
single on-variant). opencode's plan agent maps to Cursor plan mode.
2650
- **Session reuse** (`session: true`) — keeps one Cursor agent per opencode
2751
session via `Agent.resume()` across turns, with automatic fallback to a fresh
2852
agent. A run wedged by a crashed/duplicate process is recovered by retrying
@@ -56,7 +80,8 @@ and a permission-gated delegation tool surface.
5680

5781
### Plugin
5882

59-
- **opencode plugin** (`@stablekernel/opencode-cursor/plugin`): auth hook (API-key login;
83+
- **opencode plugin** (`@stablekernel/opencode-cursor`, resolved via the package's
84+
`./server` export): auth hook (API-key login;
6085
the key is validated on first use rather than at login), config hook
6186
(auto-injects `provider.cursor`),
6287
`provider.models()` (live catalog via `Cursor.models.list`), and the

‎README.md‎

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,19 @@ opencode delivers per-request, provider-specific settings to the model under
156156
- `params` → `{ <paramId>: value }` mapped to Cursor `ModelSelection.params`
157157
- `thinking` → convenience, mapped to the `thinking` param
158158

159-
These are most naturally driven by opencode's **model variant picker**: the plugin auto-generates a
160-
`plan` variant plus one variant per reasoning/thinking value the model advertises
161-
(`Cursor.models.list()` parameters). Selecting a variant sends its settings through
162-
`providerOptions.cursor`. You can also set them statically per model:
159+
These are most naturally driven by opencode's **model variant picker**: the plugin auto-generates
160+
one variant per reasoning/effort level a model advertises (`Cursor.models.list()` parameters). A
161+
boolean parameter (e.g. `thinking: ["false","true"]`) collapses to a single variant named after the
162+
parameter that switches it on (the off state is the default — no variant selected); enum parameters
163+
(e.g. `effort`, `reasoning`) produce one variant per value. Selecting a variant sends its settings
164+
through `providerOptions.cursor`.
165+
166+
> **Plan mode is not a variant.** opencode's **plan agent** (toggled with `Tab`) is mapped to
167+
> Cursor's plan mode automatically by the plugin's `chat.params` hook, so switching opencode into
168+
> plan mode puts the Cursor agent into plan mode too. An explicit `mode` from a selected variant or
169+
> model option still wins.
170+
171+
You can also set controls statically per model:
163172

164173
```json
165174
{ "provider": { "cursor": { "models": {
@@ -336,6 +345,17 @@ Enable blocks mode in your opencode config:
336345
with `OPENCODE_CURSOR_SIDECAR=1`.
337346
- **"Running under Bun without a usable Node sidecar" warning.** Install Node.js 22+, or set
338347
`OPENCODE_CURSOR_SIDECAR=0` to accept in-process behavior and silence the warning.
348+
- **"Could not locate the bindings file" / `node_sqlite3.node` not found.** `@cursor/sdk` depends on
349+
the native `sqlite3` addon, and opencode installs plugins with Bun, which skips sqlite3's install
350+
script — so the prebuilt binary may be missing. The plugin detects this and self-heals on first SDK
351+
load by running sqlite3's own `prebuild-install -r napi` under your system Node (requires Node on
352+
`PATH`). If it can't (no Node, offline), it logs a one-line manual fix: `cd` into the printed
353+
sqlite3 directory and run `npx prebuild-install -r napi` (or `npm rebuild sqlite3`). Set
354+
`OPENCODE_CURSOR_DEBUG=1` to see the repair output.
355+
- **Plugin looks enabled but no `cursor` provider/models appear.** opencode caches a plugin by its
356+
install spec under `~/.cache/opencode/packages/`; a stale cache from an older version can persist.
357+
Pin an exact version (`@stablekernel/opencode-cursor@<version>`) or delete the cached dir and
358+
restart so opencode reinstalls.
339359
- **Only the four fallback models appear in the picker.** The live catalog loads after the first
340360
authenticated use — restart opencode once after logging in, or run `cursor_refresh_models` to
341361
force a refresh.

0 commit comments

Comments
 (0)