@stablekernel/opencode-cursor 0.2.0 → 0.4.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -3
- package/README.md +148 -268
- package/dist/{chunk-D4YQ7ZEM.js → chunk-BTI2NHEE.js} +73 -8
- package/dist/chunk-BTI2NHEE.js.map +1 -0
- package/dist/plugin/index.js +134 -23
- package/dist/plugin/index.js.map +1 -1
- package/dist/provider/index.d.ts +7 -5
- package/dist/provider/index.js +149 -21
- package/dist/provider/index.js.map +1 -1
- package/package.json +6 -1
- package/dist/chunk-D4YQ7ZEM.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,62 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
- **Fixed: Cursor's `fast` tier is no longer silently forced on.** The variant
|
|
8
|
+
builder only mapped reasoning/effort params and dropped Cursor's `fast` toggle
|
|
9
|
+
entirely, so it never reached `providerOptions.cursor`. Because Cursor marks
|
|
10
|
+
the **default** variant of several models as `fast: true` (composer-2.5,
|
|
11
|
+
composer-2, and the gpt-*-codex line), omitting the param meant opencode
|
|
12
|
+
silently ran the fast tier with no way to opt out. Now `fast` defaults OFF —
|
|
13
|
+
fast-capable models seed `options.params.fast = "false"` (sent every turn, and
|
|
14
|
+
pinned into each reasoning variant so picking a reasoning level can't re-enable
|
|
15
|
+
it) — and a `fast` picker variant lets you opt back in. Override per model via
|
|
16
|
+
`provider.cursor.models.<id>.options.params.fast`.
|
|
17
|
+
- **Fingerprint-guarded session reuse, now the default (`session: "auto"`).**
|
|
18
|
+
Previously the provider created a fresh Cursor agent every turn and re-sent
|
|
19
|
+
the whole transcript (robust but cache-hostile and increasingly costly as a
|
|
20
|
+
conversation grows), while opt-in `session: true` resumed one agent per
|
|
21
|
+
session but could drift from opencode's history (edits/reverts/compaction) and
|
|
22
|
+
was disturbed by non-chat side calls. `session: "auto"` (the new default)
|
|
23
|
+
hashes only the parts opencode replays verbatim — the system prompt and the
|
|
24
|
+
user-message sequence — and classifies each turn: a clean **continuation**
|
|
25
|
+
resumes the pooled agent and sends only the new message (maximizing prefix
|
|
26
|
+
cache hits); a **side-call** (system prompt differs, e.g. title generation)
|
|
27
|
+
runs a fresh ephemeral agent without touching the pool; a **divergence**
|
|
28
|
+
(edit/revert/compaction/queued messages) or a failed resume falls back to a
|
|
29
|
+
fresh agent + full transcript and re-pools. Worst case is one self-healing
|
|
30
|
+
full replay — never worse than the old default. `session: true` is now an
|
|
31
|
+
alias for `"auto"`; `session: false` keeps the always-fresh behavior.
|
|
32
|
+
Set `OPENCODE_CURSOR_DEBUG=1` to log per-turn classification and cache usage.
|
|
33
|
+
- **Session reuse survives opencode restarts.** The pool's fingerprint records
|
|
34
|
+
persist (best-effort) to `~/.cache/opencode-cursor/session-pool.json` (7-day
|
|
35
|
+
TTL, 200-entry LRU cap), so the first turn after a restart resumes the
|
|
36
|
+
session's Cursor agent — whose conversation lives in Cursor's own checkpoint
|
|
37
|
+
store — instead of paying a cache-cold full-transcript replay.
|
|
38
|
+
- **MCP servers are re-forwarded live, per turn, with OAuth mapping.** The
|
|
39
|
+
`config` hook's startup snapshot meant mid-session MCP enable/disable never
|
|
40
|
+
reached the Cursor agent. The `chat.params` hook now forwards the live set
|
|
41
|
+
each turn (`client.mcp.status()` for runtime truth, `client.config.get()` for
|
|
42
|
+
launch specs). Because a resumed agent keeps its original servers, a changed
|
|
43
|
+
set forces a fresh agent (full-transcript replay, re-pooled) so the new
|
|
44
|
+
servers take effect — the session fingerprint carries an `mcpHash` for this.
|
|
45
|
+
Remote servers with a registered OAuth client are forwarded with a Cursor
|
|
46
|
+
`auth` block so the agent runs its own OAuth flow; servers needing OAuth
|
|
47
|
+
without a shareable `clientId` (dynamic registration) are skipped with a
|
|
48
|
+
one-time toast instead of forwarding a spec that would 401.
|
|
49
|
+
- **Fixed: text/reasoning streamed after a tool call rendered above the tool
|
|
50
|
+
block.** The earlier ordering fix closed parts on text↔reasoning transitions,
|
|
51
|
+
but blocks-mode tool parts were emitted while the narration part stayed open
|
|
52
|
+
— and hosts position a part where it started. Open text/reasoning parts are
|
|
53
|
+
now closed before tool parts are emitted (except for buffered edit calls,
|
|
54
|
+
which emit nothing until their result arrives, so narration isn't split
|
|
55
|
+
needlessly).
|
|
56
|
+
- **Tool outputs are included (truncated) in flattened transcripts.** The
|
|
57
|
+
fresh/divergence/`session: false` replay paths previously dropped Cursor tool
|
|
58
|
+
results to bare `[result of X]` placeholders, so a fresh agent re-read a
|
|
59
|
+
transcript with prior tool outputs missing. Outputs are now inlined and capped
|
|
60
|
+
(2,000 chars per result, 500 per tool-call args) so context stays faithful
|
|
61
|
+
without unbounded bloat.
|
|
62
|
+
|
|
7
63
|
## [0.2.0] — 2026-06-11
|
|
8
64
|
|
|
9
65
|
- **More Cursor tools map onto opencode's native tool renderers (blocks mode).**
|
|
@@ -47,7 +103,8 @@ and a permission-gated delegation tool surface.
|
|
|
47
103
|
- **Session reuse** (`session: true`) — keeps one Cursor agent per opencode
|
|
48
104
|
session via `Agent.resume()` across turns, with automatic fallback to a fresh
|
|
49
105
|
agent. A run wedged by a crashed/duplicate process is recovered by retrying
|
|
50
|
-
the send once with the SDK's `local.force` escape hatch.
|
|
106
|
+
the send once with the SDK's `local.force` escape hatch. (Superseded by the
|
|
107
|
+
fingerprint-guarded `session: "auto"` default; see Unreleased.)
|
|
51
108
|
- **Native diff viewer for Cursor edits (blocks mode).** A Cursor `edit` tool
|
|
52
109
|
call is now surfaced under opencode's registered `edit` tool with its real
|
|
53
110
|
unified diff in `metadata.diff`, so opencode renders its built-in diff viewer
|
|
@@ -61,7 +118,7 @@ and a permission-gated delegation tool surface.
|
|
|
61
118
|
- `"blocks"` (default) emits structured, provider-executed **dynamic** `tool-call` /
|
|
62
119
|
`tool-result` parts so opencode renders native tool blocks. Names are
|
|
63
120
|
`cursor_`-prefixed and sanitized (`shell` → `cursor_shell`,
|
|
64
|
-
`
|
|
121
|
+
`myserver/find_symbol` → `cursor_myserver_find_symbol`) so they can't collide
|
|
65
122
|
with opencode-registered tools, and carry `providerExecuted: true` +
|
|
66
123
|
`dynamic: true` so ai v6's `parseToolCall` accepts them without
|
|
67
124
|
registered-tool validation. Tool-results use the V3-spec `result` +
|
|
@@ -97,7 +154,7 @@ and a permission-gated delegation tool surface.
|
|
|
97
154
|
rather than showing only the fallback snapshot.
|
|
98
155
|
- **MCP server forwarding** — opencode's configured `config.mcp` entries are
|
|
99
156
|
translated to Cursor `McpServerConfig` and passed to the local agent so it can
|
|
100
|
-
use the same servers
|
|
157
|
+
use the same servers. Opt out with `provider.cursor.options.forwardMcp`.
|
|
101
158
|
- **Model discovery** with a 24-hour cache (keyed by key fingerprint) and a
|
|
102
159
|
built-in fallback snapshot (composer-2.5, claude-opus-4-8, claude-sonnet-4-6,
|
|
103
160
|
gpt-5.5) for use without an API key.
|