76cfb7fe869ea2cc7147b2d8aefd33f1b4c4a8d8
78
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
463bbfe2b6 |
cursor 0.2.46: a quiet Run's error says the stream timed out, so Pi retries it (#1075)
Cursor's quiet watchdog (idle and heartbeat-only) now ends its error with "; stream timed out (try again)", so Pi, which classifies a streamed error by its words once the 502 is lost behind a 200, retries the turn within its own budget. The status, limits and failure stay as they were. 0.2.46. Reviewed at 507b2fd0. Checked Pi's own retry list (earendil-works/pi packages/ai/src/utils/retry.ts on main has "timed? out"; "(try again)" alone matches nothing there). magpie's gateway decides on the 502 status (busyStatus), so its own handling is unchanged. Run (WSL, Bun 1.4.2): packages/cursor bun test 421 pass, 0 fail; bun scripts/check.mjs cursor ok. Not run: scripts/cursor-pi-retry.integration.mjs (needs an installed Pi SDK, loopback only); a real Cursor stall (#550). Co-authored-by: wuuli <wuuli@users.noreply.github.com> |
||
|
|
0135b7b0ea |
agy-cli 0.1.32: the first model list after warming has agy's Claude and GPT models (#1064)
On a signed-in agy, `agy models` takes about 4.4s and `agy acp`'s
session/new about 3s. provider.models() needed three calls before
claude-opus-5-5, claude-sonnet-5-5 and gpt-oss-120b showed up, and
OpenCode 2.x calls it once.
What changed:
- packages/agy-cli/index.mjs:
- The offered-model probe now starts in listAgyModels' .then, as soon as
a non-empty list arrives and a caller asked for probeOffered. It no
longer waits for the next models() call. A hung or failed `agy models`
still never spawns the probe.
- probeSignedIn reuses the `agy models` stdout it already has. The same
parser (parseAgyModels, split out of listAgyModels) fills
cachedModelCatalog, and the probe starts. Sign-in waits for the probe
for at most 3s.
- The offer (acpOfferedModels, acpOfferedKey, offeredProbeAt and any
in-flight probe) is forgotten when agyPath changes and after a new
sign-in finishes. A generation counter drops the answer of a probe
that started before the reset.
- provider.warming() returns a promise while a list or probe is still
running, and null when nothing is.
- scripts/opencode2.mjs, copied byte for byte to every
packages/*/opencode2.mjs: after the first background refresh, the
adapter awaits hooks.provider.warming() once, for at most 60s, and then
refreshes once more. It does not loop. Plugins without warming() behave
as before.
- Not done: the issue's on-disk catalog cache (point 3), skipped as asked.
Known gap: agy-cli has no `config` hook, so under OpenCode 2.x the adapter
lists no provider for it. refresh() returns before it calls
provider.models(), so the follow-up refresh can't add agy's models on 2.x
until agy-cli gets a config hook.
Tests: test/testkit.mjs's fake agy takes a sessionNewDelayMs. The new
tests in test/catalog.mjs set 1.5s on both `agy models` and session/new
and wait for state through warming(), with no fixed sleeps:
- On a slow cold start, the first models() after warming lists Claude and
GPT, from one probe spawn.
- authorize() on a signed-in agy fills the catalog, and the next models()
runs no second `agy models`.
- The sign-in wait is bounded: with a 6s session/new, sign-in returns in
about 4.5s.
- Changing agyPath probes again.
The hang test now awaits warming() before it counts acp spawns.
scripts/opencode2.test.mjs: the warming list is read a second time when
warming ends, and only once when nothing is warming.
Run on Linux (a separate test Mac was over its load limit):
- packages/agy-cli bun test: 17 pass, 0 fail.
- bun scripts/check.mjs agy-cli: ok.
- bun scripts/check.mjs (all packages): ok.
- Root bun test in a temp HOME: 8530 pass, 19 skip, 0 fail.
Broken by hand on Linux, each red, then restored green:
- No probe in the .then: the slow cold-start test.
- probeSignedIn drops the list: the authorize and bounded-wait tests.
- agyPath change keeps the old offer: the agyPath test.
- Unbounded sign-in wait: the bounded-wait test (7514ms).
- Probe also on a failed listing: the hang test.
- origin/main's index.mjs with the new tests: all four #1064 tests.
- Adapter reads the list once: the warming adapter test, and the
copy-identity check.
Not tried: a real agy (no Google sign-in, no network). The reset after
login.finish has no unit test of its own.
Reported-by: hiee3
|
||
|
|
2479b36f23 |
cursor 0.2.45: a test switch lets Cursor search the web and saves that trace (#635)
A new plugin option, "Cursor web search (test)" (web_search_test, off by
default), sits next to Wire trace. On, a Run adds web_search_tool_call
(ToolCall field 18) to x-cursor-agent-allowed-tools and answers Cursor's
search query with an approval, as cursor-agent does when it auto-approves.
Every other tool of Cursor's own is refused as before. A Run in which
Cursor asked to search saves its WireTrace to cursor-traces whether it
succeeded or failed; a Run that never searched saves nothing unless Wire
trace is on and it failed. The trace is WireTrace as it is (kinds, field
numbers, sizes, times) plus one "web search" event; no search term or
result is written.
Protocol, from cursor-agent 2026.11.05-86047df's agent.v1 descriptors (the
plugin ships no .proto):
- AgentServerMessage 7 interaction_query: InteractionQuery {1 id uint32,
oneof query: 2 web_search_request_query (WebSearchRequestQuery {1 args:
WebSearchArgs {1 search_term, 2 tool_call_id}}), 9 web_fetch, ...}
- AgentClientMessage 6 interaction_response: InteractionResponse {1 id,
oneof result: 2 web_search_request_response (WebSearchRequestResponse
{1 approved {} | 2 rejected {1 reason}})}
- cursor-agent's x1.webSearchApproved builds exactly that approval; with
no args it rejects "Missing web search arguments", and so does this.
Before: native failed the Run on any interaction query ("unsupported native
interaction query", 502); stateless left it unanswered. Both stay so with
the switch off, and for every query but a web search with it on.
Run on mote, HOME a fresh mktemp -d:
- bun test packages/cursor: 421 pass, 0 fail
- bun scripts/check.mjs: ok
- the new off tests against origin/main 907847b's index.mjs and
native-session.mjs: pass (the off behaviour is the old one); the on
tests there: red, as they should be
The full root suite was not run (other reviews were using mote and mica).
Broken by hand, each red (11 tests named plugins#635):
- approval sent as a rejection: 5 red
- native answer not gated on the switch: off test red
- header always adds web_search_tool_call: both off tests red
- header adds shell_tool_call too: 6 red
- stateless never sends the answer: 2 red
- a successful Run without a search saved: 2 red
- a successful Run that searched not saved (ended() a no-op): 2 red
- frame bytes written into the trace: 4 red (secret found)
- any interaction query taken as a search: 3 red
Not tried: Cursor's real servers (fakes only, no real account). Whether
Cursor sends tool_call_started (update 2) for its own search, which would
keep StepCalls from counting it as completed by Cursor, is unknown; the
real trace this switch records is for that. With the switch on, every Run
holds a trace in memory until it ends, as with Wire trace on.
|
||
|
|
740e1af252 |
tests: grok's nocli puts PATH back when its file ends, so gumloop's Node children find node on CI
publish.yml has been red on main since
|
||
|
|
f73ba656b2 |
cursor: auth.calls lists the account's calls made outside magpie (0.2.44, WaiooT on X)
magpie's Usage page counts only what went through magpie, so Cursor's
editor and cursor-agent use was missing ("求支持统计cursor的使用情况").
auth.calls reads GetFilteredUsageEvents page by page from the time magpie
asks for and gives each of the account's own events: id, time, model,
tokens (input uncached; cache read/write apart), cost (totalCents / 100)
and conversation. A team's other members (owningUser vs GetMe's userId)
and the conversations this plugin ran itself (kept 40 days in
$XDG_DATA_HOME/opencode-cursor-auth/conversations.json, written
temp-and-rename) are left out. A refused page fails the reading.
Run: bun test in packages/cursor on mote (410 pass), scripts/check.mjs.
calls.test.mjs's fixtures carry the field names of a real Pro account's
reply. Real account: the hook read 43 events (30 days) from the owner's
Cursor sign-in, tokens and costs as the dashboard has them.
Broken by hand: without the own-conversation and owningUser filters the
first calls test goes red.
Not tried: a team account with other members; Cursor's editor (none
installed here), so an editor event's shape is taken as the same.
|
||
|
|
087c36123d |
inkstone 0.1.3: image-caps preflight, a zero-prompt browser sign-in, key calls on the session cookie (#832)
inkstone 0.1.3 (#832, yunwang2442-creator): - Image requests are prechecked before they leave: 8 images, 10MB each, 40MB in all. - A request over a cap gets a local 400 shape refusal, so magpie asks the next account and rests none. - The plan's invalid_media / media_fetch_failed / unsupported_media_type errors become the same kind of refusal. - The body rewrite strips the reasoning fields and sets image detail to auto. - A zero-prompt browser sign-in comes first, and a second browser method reuses a pasted key. - Neither browser method is offered when no Chromium-family browser is found (#825). - The /keys calls ride the session cookie, without the pagination query. Key creation retries the console's -15100 "refresh page and retry". - The #826 metadata token read is kept, and its test is back. - The fake browser is built once per user and source hash (#824), and the title wait reads only on Windows. - maxConcurrency is 4. - The doubled comment line is dropped from every opencode2.mjs copy, agy-cli's included. Reviewed at 88e66bde, on mote (macOS, Bun 1.4.2) with a temp HOME: - full bun test: 6853 pass / 0 fail; both checks exit 0 - bun scripts/check.mjs and bun scripts/check.mjs inkstone: exit 0 - 21 hand breaks: 20 red, 1 not caught (the /keys pagination test calls protocol.listKeys directly; follow-up filed) Not tried: a real InkStone account or sign-in, Windows and Linux runs. |
||
|
|
e7004d9354 |
inkstone 0.1.0: Intern InkStone (书生·端砚) Token Plan, browser sign-in, credit card and ink-* key chat (#775)
New package @magpie-community/opencode-inkstone-auth 0.1.0 for Intern InkStone (书生·端砚, Shanghai AI Lab) Token Plan, provider id `intern-inkstone`. Community package by yunwang2442-creator. What it does: - Browser sign-in (Edge/Chrome, its own profile under $XDG_CONFIG_HOME or ~/.config/magpie/inkstone-browser, or %LOCALAPPDATA%\magpie\inkstone-browser). The login window has no debugging port. A headless CDP read takes the uaa-token cookie, and the same read renews it silently later. - Usage card: ink-credit balance, 5-hour and 7-day windows, credit packs. - Chat: a pasted ink-* API key, or one the sign-in creates, named ink-<host4>-<acct4>-<rand4> (18 of the console's 20 characters). An idempotency clash (-15109) retries with a fresh name, up to three times. Pruning is on by default. It only touches this machine's and account's prefix, keeps the newest two and the key this sign-in created, and never deletes manual keys or keys of unknown age. - Closing on Unix: SIGTERM, then SIGKILL only after a 15s grace. Leftover browsers are matched by --user-data-dir=<escaped profile>, and Windows uses .Contains(). - The login wait comes from an injected waitForLogin in tests. No env hook is left in production code. - Hosts: discovery.intern-ai.org.cn, discovery-api.intern-ai.org.cn, 127.0.0.1 (CDP). Outside the package: scripts/opencode2.mjs lets a prompt with `required: false` stay optional (`p.required !== false`). Every package's copy is synced byte for byte, so all 39 copies in the merged tree are blob |
||
|
|
1eb9473f5b |
cursor 0.2.43: read per-step ModelCallCompletedUpdate usage (#796)
Asks AgentService/Run for emit_model_call_usage (AgentRunRequest field 37) and reads InteractionUpdate 31 (ModelCallCompletedUpdate: model_call_id, then input, output, cache read, cache write and reasoning tokens). These field numbers are checked against cursor-agent 2026.11.05-86047df's bundle. A multi-step native turn's final step reports that call's exact counts. The rest of TurnEnded's totals goes to usage.magpie_deferred, or the earlier calls' #31 sum when TurnEnded has no counts. A stateless step with a #31 before it seals takes that count and doesn't poll the dashboard. Without #31, both paths are as before. Reviewed at d2c49f3b on mote (mote-run, HOME=$(mktemp -d)): - bun scripts/check.mjs cursor: ok. - bun test packages/cursor: 406 pass, 0 fail. native-e2e alone 3 times: 145 pass each. - Probes: TurnEnded with no counts and a #31 per step, and only the final step's #31. Both give own 61000/700 and deferred 105000/1400, which add up to the turn. - Broken by hand, red each time: no field 37; native ignoring #31; #31 read unshifted; stateless ignoring #31; stateless still polling after #31. - Not red: dropping the lastStepUsage reset in nextStep. That test gap is filed as a follow-up. Not tried: a real Cursor account (whether api2 sends #31, and in what order). |
||
|
|
484b870266 |
cursor 0.2.42: a mid-batch checkpoint after a count sent first no longer seals a parallel tool batch (#788)
cursor 0.2.42: a checkpoint whose pending calls equal the calls handed out ends a step short of its count only when tool_requests_listed came after the step's last call update or exec (StepCalls.listedAfter). A count sent first can no longer let a checkpoint between parallel calls seal the batch after one call (502 "native call arrived after its batch was sealed"). An exec also removes its id from the calls Cursor completed by itself. Reviewed at e0794fef on mote (HOME=$(mktemp -d), Bun 1.4.2): bun test packages/cursor 405 pass, 0 fail; bun scripts/check.mjs cursor ok. Broken by hand: without listedAfter in native, 2 fail; without it in stateless, 2 fail; without byCursor.delete, 1 fails. Trade-off: a count sent before the calls, with Cursor-completed calls that send no update 3, now waits for the quiet timeout instead of ending on the checkpoint. A probe shows it; it hasn't been seen on the wire; filed as #790. 0.2.42 is the next version after npm's 0.2.41. Not tried: a real Cursor account. PR CI green. |
||
|
|
f2dc68c17e |
cursor 0.2.41: new input past a parent awaiting results gets a retained Run that takes no reservation (#706)
cursor 0.2.41 (ooboqoo): new input past a parent that is awaiting results gets a retained Run that takes no reservation, so those turns stop falling back to "owner busy" and then "historical native calls" rebuilds. When a later Run of the conversation starts, a parent waiting on results owes its step at once, bounded before that start, and the later Run collects it. The collection waits until owedAt, because Cursor adds a step to a Run's one event as the step ends. If the parent's own results resume it, an uncollected count is withdrawn, and a collected one comes off its final, so the event is billed once.
Reviewed at 74a1d8b23 merged onto main
|
||
|
|
4f3eddc256 |
cursor 0.2.40: a new user turn whose old native calls are all answered gets a retained Run (#672)
A new user turn whose earlier native calls (call_cursor_…) all have tool results now gets a retained Run of its own, with those calls imported as history the way the stateless path imports them. Any call still pending, a request ending in tool results with no live owner, or a tool attachment last still falls back as before; the owner-busy check is unchanged. Nothing is submitted to an old exec: a user message last has no trailing handles. By ooboqoo (#672). Run at the reviewed head 5b4dcf1 on mote: - packages/cursor `bun test`: 394 pass, 0 fail - `bun scripts/check.mjs`: ok Broken by hand: with origin/main's native-session.mjs and the PR's tests, "terminal old handles do not wedge a new user turn" and the new admission test both fail (2 fail, 168 pass in those two files). Not tried: a real Cursor account (the author reports ~270 requests over a day, all 200 or client-cancelled 499); Cursor dashboard usage or caching. |
||
|
|
023631774e |
cursor 0.2.39: release the catalog's Claude listing (jiaohanying, #634)
|
||
|
|
b8ec827579 |
cursor: the Claude Cursor hides from an account is listed once per context size (jiaohanying, #634)
By jiaohanying (#634). An account Cursor blocks Claude for has no Claude in the picker (AvailableModels), only in the usable list, so those models were listed as usableOnly fallback entries: a 200K window assumed, no sizes. AvailableModels with scope 3 (the full catalog) is now asked alongside the other two (8s; a failure leaves the list as before). The live Anthropic models the picker lacks (not isHidden, not Auto, not chat-only or Tab-only, with a variant the account has an id for) are listed as the picker's models are: once per context size (claude-opus-5-5@300k, @1m), thinking a parameter, the efforts the account is served, 1m in Max Mode. A catalog variant without a legacySlug gets the one of the model's ids that says its effort, thinking and fast; none or several, it is not offered. Only the parameters the model defines are sent: the catalog's Opus 4.7 to 5.5 variants carry cyber=false, which the picker's don't and cursor-agent never sends. A saved sized id (claude-opus-4-8-thinking@1m) now runs at its size. With no effort asked a catalog model goes at Cursor's default variant (Opus 5 and 4.8: high), as the picker's do. The version is bumped in the next commit: main's |
||
|
|
17e5ef7457 |
all: load on OpenCode 2.x through a default {id, setup} (#657)
nbczw8750 (#657): trae 0.2.26 on OpenCode 2.2.5 fails with "Plugin must export a default definition with an id and an effect or setup function. (cause: SchemaError(Missing key at ["default"]))". 2.x imports a package's exports["."] (a plugin dir and an npm install alike) and has no V1 path at all, so every package here that serves models failed the same way, not only trae. Every one of the 32 model packages now has: - opencode2.mjs, exports["."]: a copy of scripts/opencode2.mjs, an adapter that runs the package's V1 plugins inside 2.x's promise API. Config providers become 2.x providers (package pinned so the aisdk sdk hook runs), V1 auth methods become integration methods (oauth auto/code with forms; api without authorize as a key method), V1 credentials are kept in metadata.v1, the loader's baseURL, apiKey, headers and fetch are applied through the sdk hook, an auth.set renewal is stored per credential, and credential.switched /updated reload the account's own model list. - opencode.mjs, main: re-exports the V1 plugin functions only. OpenCode 1.x and magpie's host.js take main. On 1.x, trae 0.2.26's main exported a non-plugin (_internal) and 1.19.5 refused it ("Plugin export is not a function"); the new main fixes that too. - both files in "files"; patch version bumped. devin already had 2.x and is unchanged. scripts/check.mjs fails a model package whose 2.x entry has no default {id, setup}, whose opencode2.mjs differs from the canonical one, whose entry is missing from files, or whose main exports a non-plugin. Run at this head (mote): - HOME=$(mktemp -d) bun test, as CI runs it: 4900 pass, 0 fail (4914 tests, 374 files). A first run set globalThis.fetch for the whole process from opencode2.test and failed 528 tests in other packages; the block is now set and put back around that file's tests. - bun scripts/check.mjs: every package passes. With the network blocked cloudflare-workers-ai fails on its fetched catalog, the same on origin/main. - Real OpenCode 2.2.5 (npm opencode-ai), sandbox HOME, packed trae 0.2.27: loads with no error; /api/integration lists trae-cn "Trae CN" and trae-global "Trae Global" with their browser sign-ins; `auth login` starts the trae.cn authorization and waits (cancelled there); with a fake credential POSTed to /api/credential, `opencode models` lists trae-cn's six models. - Real 2.2.5 with a fake V1 key plugin through the same adapter against a local fake server: `auth login` with a key, `models`, `opencode run` reached /real/v1/chat/completions with the loader's "Bearer loader-sk-fake" and header, and printed the fake's reply; with @ai-sdk/anthropic it reached /real/v1/messages with x-api-key from the loader. This run found the key method missing after 2.x's second integration transform (a once-only flag outside the transform); fixed, and opencode2.test checks a rebuild. - Real OpenCode 1.19.5, sandbox HOME, trae 0.2.27: `opencode models` lists trae-cn and trae-global models; 0.2.26 failed there. Broken by hand (scratch copy, bun test scripts/ and check.mjs): - trae's exports back to "./index.mjs": the trae 2.x test fails (default.id undefined), check fails trae with "OpenCode 2.x: ./index.mjs has no default {id, setup} (plugins#657)". - zed's opencode2.mjs changed: the copies test fails, check fails zed "differs from scripts/opencode2.mjs". - the key flag back outside the transform: the 1.x plugin test fails on the rebuilt sign-ins (key missing). Not tried: a real sign-in with a real account on 2.x; Windows (the reporter's OS); chat.headers, chat.params, usage and tool hooks, which the adapter doesn't carry to 2.x; the tools/pages packages (calc, goanyapi, layerfs, search1api, aelios, agent-console, chat, fingerprint, nowledge-mem, kimi-desktop), which still load only on 1.x. |
||
|
|
3f615ea9ef |
cursor 0.2.37: a step with under 10 minutes of a retained Run's lifetime left starts fresh, and a deadline cut says to retry (#616)
yetone/magpie#4419 (Okxdd123; ggbdpq traced the cause and wrote the repro): a Pi turn on cursor/grok-4.7@500k kept one native Run across 12 tool steps. The 13th went on in that Run with 494 s of its 15-minute lifetime left, the answer was still streaming at the deadline, and the Run failed mid-answer with "native Run lifetime expired". The 200 was long sent, so the agent read only those words, and Pi doesn't retry on any of them, so the turn ended although asking again goes on. - native-session.mjs: a retained Run takes a tool batch's results only with more than continueReserve (10 minutes, new in NATIVE_LIMITS; at most two thirds of the lifetime) left. With less, the owner is retired and the step goes on a fresh Run from the supplied history, as #157 did for the last minute. 60 s didn't cover a long answer. - The deadline's error now says "native Run lifetime expired: the Run timed out; retry your request" (LIFETIME_EXPIRED). "timed out" is in Pi's _isRetryableError list and in magpie's passingSaid; "retry your request" is in passingSaid, so magpie's gateway adds nothing more. For Claude Code and Codex, magpie translates the error as api_error / server_error, as before. - README: the 10-minute reserve and the wording. Tests (native-e2e.test.mjs), no network and no real waiting: Date.now moved so a continuation has 494 s (the reporter's case) or 599 s left -> rebuilt on a fresh Run, no result written to the old one; 660 s left -> same Run. A retained continuation streams half an answer, the deadline is brought in with expireIn(0), and the SSE's one error starts "native Run lifetime expired" and matches Pi's retry regex and magpie's passingSaid (both copied into the test). Broken by hand: the old reserve (min(60 s, lifetime/10)) turns the 494 s and 599 s cases red; the old wording turns the mid-answer case red (3 fail, 135 pass in native-e2e). Run (mote, HOME=$(mktemp -d), as CI): bun test at the repo root, 4716 pass, 0 fail; bun scripts/check.mjs, exit 0. packages/cursor alone: 384 pass, 0 fail. Not tried: a real Cursor account reaching the 15-minute deadline; a real Pi, Claude Code or Codex reading the new wording (Pi's regex is the one in pi-coding-agent's agent-session.js as installed locally, not necessarily Pi 1.4.0's). |
||
|
|
24cd0b9123 |
cursor 0.2.36: a stateless step whose calls came hands them over when no count follows (#550)
Windsland52's fifth wire trace (2026-10-31 19:44, cursor-grok-4.6-xhigh,
stateless, why "historical native calls"): thinking, text, then two MCP
calls 43 ms apart (partial, started, exec each), no tool count (update
27), no checkpoint, and 24 heartbeats until quiet ended the Run at 240 s.
The stateless decode only ends a step on the count, a checkpoint or EOF,
so it waited out quiet; the retry of the same turn stays stateless, so a
native stall cost two 4-minute waits. Cursor's own client never waits on
toolRequestsListed (
|
||
|
|
b70725c1a6 |
cursor 0.2.35: a step ends on calls Cursor completed itself, or on a checkpoint waiting on every call (#550)
Windsland52's wire trace (stateless path): partial c1 -> completed c1, partial c2 -> completed c2, partial c3 -> started c3 -> one exec, then the tool count (update 27), 7 set_blob, a checkpoint whose pending_tool_calls (ConversationStateStructure 4) holds one id, and 240s of heartbeats. Cursor's count includes calls it completed itself (#7 then #3, with no #2 and no exec), which never reach this side, so the step waited for calls that were never coming while Cursor waited on the one exec's result. The native path had the same gap and failed after batchWait. Cursor's own client (cursor-agent 2026.10.01) takes a toolCallCompleted for a call it never started, and never waits on toolRequestsListed. Now, on both paths, a #3 for a call seen as #7 in the same step, never started (#2) or exec'd here, counts toward the step's tool count, and a checkpoint after the count whose pending calls equal the calls this side holds ends the step too. The strict "more calls than the count" check still counts only calls that came and were answered here. The quiet error and batchWait name the count, the calls, the answered and those completed by Cursor; the Wire trace keeps each update's count, tool kind, pending and why the Run was cut. Update 8 is named (token count). Run at this head: stall-550.test.mjs (10 tests, built from the trace's 195 inbound frames in order) and the cursor suite 376/0 on mote; the root suite with a temp HOME 4196 pass, 0 fail, and check.mjs cursor ok on mote; native-session, native-e2e, stall-550, conversation and stepusage 191/0 on Windows (win-run). Broken by hand, each red only in its own test: the stateless completed-by-Cursor rule, the stateless checkpoint rule, the native completed rule, the native checkpoint (waitedOn), and the #7-in-this-step requirement. Not tried: a real Cursor account; the real count value (the trace gives only 2..127); that a #3's call_id equals McpArgs.tool_call_id; what the two completed calls were; whether Cursor can checkpoint mid-step with pending equal to the calls before more execs. |
||
|
|
1a5b184991 |
cursor 0.2.34: the quiet error names its checkpoint; an opt-in Wire trace saves a failed Run's frames (#550)
Windsland52 (#550, 0.2.33, cursor/grok-4.6 at xhigh): four Runs ended
"Cursor went quiet: 24 heartbeats and nothing else for 240 s, its last
message checkpoint". They asked for the checkpoint to be named, and for a
way to see what Cursor sends after it. No change to quiet's budget or to
retry, as asked.
The quiet error now says, for a checkpoint: its number in the Run, which
of its step's checkpoints it was (native path; the stateless path doesn't
count steps), how many came in a row, and the kinds before it, e.g.
"its last message checkpoint #1 of the Run, the first of step 1, after
blob request x2, thinking". Other kinds read as before.
Wire trace is a new plugin option (wire_trace), off by default. With it
on, a Run that fails (not one the caller cancels), native or stateless,
writes <magpie's folder>/cursor-traces/<start>-<rand>.json (temp and
rename, mode 600, newest 20 kept). It holds both directions' frames as
time, size, kind, top-level field numbers with wire type and size, and
the field numbers and sizes one level inside: the shape, never the bytes.
No text, thinking, tool name or argument, blob or blob id, checkpoint
content, token, header, account or conversation id is read into it. The
error message is scrubbed of email-, uuid-, auth-id- and token-shaped
strings. It also has quiet's counters, the model id and plugin version.
The first 2000 and last 3000 frames are kept, the rest counted. The
folder comes from input.directory, which magpie sets to its config
folder. The option exists only in magpie, so OpenCode's project folder is
never written to.
Run on mote at this tree (
|
||
|
|
00de68a0f8 |
cursor 0.2.33: free credit (the plan's bonus and credit grants) on the card, with its limits
CryptoSarom on X (2116260605053321489): "magpie 似乎没法支持 cursor 的赠金读取,
以及赠金使用限制". The card read only the included pools and on-demand.
What Cursor exposes, as Cursor 3.x's IDE (workbench.desktop.main.js) and
cursor-agent 2026.10.01's schemas have it:
- GetCurrentPeriodUsage planUsage.bonusSpend (cents), remainingBonus (bool,
no amount) and bonusTooltip: the IDE's "+$X free usage on us" line.
- DashboardService/GetUsageLimitStatusAndActiveGrants activeGrants
(aiserver.v1.ActiveCreditGrant): totalCents, remainingCents, expiresAtMs,
allowedModelIds / allowedModelTags / allowedModelSelections (models it
may be spent on), allowedClientTypes ("glass" without "ide" is the IDE's
Cloud Agent credits), campaignName. The IDE's "Use your $X free credits"
banner reads it; it matches tags lower case with "-" as ".".
The card now shows Free usage (bonus spent, "more left" when
remainingBonus) and a window per grant (spent / total USD, runsOutAt and
runsOut at its expiry, models when limited, "(Cloud Agents only)" when
cursor-agent can't spend it). All are aside. Routing: a bonus with some
left, or a grant magpie can spend on every model, sets the spent pools
aside as on-demand does; a model-limited grant leaves its models out of
a spent pool (Cursor Models keeps a non-empty list, or goes aside). With
Included usage only on, none of this keeps an account served. A grants
read that fails leaves the card as before.
Run on mote at this tree: HOME=$(mktemp -d) bun test: 3960 pass, 9 skip,
1 fail (a test of my own, since fixed); then credit/usage/included-only
79 pass 0 fail; bun scripts/check.mjs cursor ok. Broken by hand: the new
credit.test.mjs against the old index.mjs, 9 of 9 red.
Real account (Premium, merged weekly, cursor-agent's sign-in, read only):
GetCurrentPeriodUsage, GetUsageLimitStatusAndActiveGrants,
GetCreditGrantsBalance, GetClientVisibleCreditGrants read; it has no bonus
and no grant, and the new plugin's card for it is unchanged (Weekly, Grok
Bot, On-demand). Those replies are credit.test.mjs's REAL_ fixtures; the
#1868 team account's real bonusSpend 14151 now shows "+$141.51 on us".
Not tried: a real account with a grant or remainingBonus true (none at
hand), so the grant fixtures follow the schema, and whether Cursor
really serves a spent pool on bonus is Cursor's word ("free usage beyond
what you've purchased"), not a request made past a spent pool.
|
||
|
|
060722efcf |
cursor 0.2.32: a merged (newer) plan's included usage is one Weekly window for every model, no Other Models
majiang_ai on X: Cursor's newer plans have no third-party-model pool, while magpie's card still showed Cursor Models, Other Models and Total. What Cursor says: GetPlanInfo answers isMerged true and planInfo.includedUsagePeriod INCLUDED_USAGE_PERIOD_WEEKLY for such a plan (enum 1 MONTHLY, 2 WEEKLY, from cursor-agent 2026.10.22's proto), and GetCurrentPeriodUsage's billing cycle is then the week, with autoPercentUsed == totalPercentUsed and apiPercentUsed 0. The dashboard's usage page (cursor.com/v2/usage, chunk read on 10-29) draws one meter, "Weekly usage limit", from the period's totalPercentUsed. Now planOf reads isMerged and the period with the plan name (same hourly cache, last good answer kept). A merged plan's usage is one window, Weekly (span 7d; Monthly on a monthly merged plan, Included when not said), with no models list, so it counts every model; On-demand and Grok Bot as before; no Other Models or Total. A plan GetPlanInfo can't read, or isMerged false, keeps the two pools. Run: - HOME=$(mktemp -d) bun test (whole repo, on mote): 3229 pass, 8 skip, 0 fail - bun scripts/check.mjs: ok - Broken by hand: the merged branch turned off, 5 of the 6 new tests red (the 6th checks the unmerged case still has the pools). - Real account (owner's Cursor, a merged Premium plan, keychain token, read-only calls): the published 0.2.31 shows Cursor Models 7%, Other Models 0%, Total 7%; this change shows Weekly 7% (resets 11-03), Grok Bot, On-demand. Not tried: an old (unmerged) plan's real account; none is at hand, the unmerged path is unchanged and covered by the existing tests. A merged monthly plan was not seen for real. |
||
|
|
6a86762e26 |
cursor 0.2.31: Included usage only, a plugin option that stops an account once its included pools are used up (#485)
A new magpie plugin option, included_only ("Included usage only", off by
default), read through input.magpie.option at each usage reading, so a
change needs no restart. Modelled on Factory's standard_only (#349).
On: Cursor Models and Other Models drive routing (they lose `aside`), and
On-demand (fixed or unlimited) and Total are shown with `aside`, so a team
member whose on-demand could still pay is no longer kept in routing once
an included pool is used up. The Enterprise path does the same: the
Enterprise allowance stops the account and On-demand is shown only.
Off, or outside magpie, or an option that throws or isn't `true`: the
windows are exactly as 0.2.30 gives them.
Tests (included-only.test.mjs, new): Team accounts with a member's own
fixed limit, an org-wide fixed pool and unlimited on-demand, each with the
pools spent, left, and only Cursor Models spent, read with the switch off
and on; a fixed budget spent stops either way; no on-demand allowed is
unchanged; the switch flipped on one plugin instance between readings;
input missing/throwing/non-true; Enterprise unlimited and fixed-with-room;
the option's declaration fits host.js's limits (label 60, description 300).
Run on mote (mote-run):
- HOME=$(mktemp -d) bun test packages/cursor: 344 pass, 0 fail, 20 files
- bun scripts/check.mjs: ok
Broken by hand (each in mote's copy, included-only + usage tests):
- pools keep `aside` with the switch on: 8 fail
- fixed On-demand not set aside: 2 fail
- Enterprise allowance ignores the switch: 2 fail
- Enterprise fixed On-demand not set aside: 1 fail
- switch always on: 23 fail
- switch read once at plugin start: 1 fail
- a truthy non-true value taken as on: 1 fail
- option declared under another key: 1 fail
Not tried: a real Cursor Team account with the switch on in magpie (none
with on-demand here); the dashboard replies are fixtures shaped as
usage.test.mjs's. The option label is English only, as every plugin's
options are (magpie shows auth.options' label as given).
|
||
|
|
719de026e7 |
cursor 0.2.30: an Enterprise account's overall allowance from usage-summary (#391)
Fixes yetone/magpie#3288. An Enterprise account's GetCurrentPeriodUsage has no planUsage, so its card was empty. usage() now reads the website's /api/usage-summary with the same dashboard session the Grok Bot read builds, and shows an Enterprise window (amount/limit in USD, reset at the cycle's end) when the summary is Enterprise with overall enabled and used/limit real numbers. It is aside while team on-demand is unlimited or a measured budget has room, and a measured on-demand budget gets its own window. Anything else leaves the card empty, as before. Version 0.2.30. The reviewer pushed 9435f59 on top of e2f03a0: main merged in (the only conflict was the version line; main took 0.2.27 to 0.2.29 meanwhile), version 0.2.30. Run at 9435f59f0f0e4902e37f8634eebe8e41127cc9b1, on mote (mote-run, HOME=$(mktemp -d)): - bun test packages/cursor: 328 pass, 0 fail (19 files). bun scripts/check.mjs cursor: ok. - Full bun test: 3063 pass, 8 skip, 0 fail (257 files). - Broken by hand on usage.test.mjs, each red then restored: the old Number() reads of overall.used/limit (the can't-be-read test; null/""/false/[] read as 0 again), no room check on the on-demand budget (the 50000 and 60000 of 50000 cases), the summary read off (10 tests). - npm pack 0.2.30 and imported the packed index.mjs (CursorAuthPlugin, _internal). npm has 0.2.29. Not tried: a real Enterprise account (none here); the summary's shape rests on the author's account. Still unanswered from the review: whether an Enterprise seat's summary carries a personal on-demand cap (individualUsage.onDemand); a ms-string billingCycleEnd gives no resetsAt. #372 touches the same `if (!u)` branch and now has to rebase onto this. |
||
|
|
8f81a8aeb8 |
cursor 0.2.29: a native Run over HTTP/1.1 sends its history's blobs 16 at a time
ysm119 on Discord: Cursor models 30 s+ to first token, 1-4 min a turn.
0.2.28 (
|
||
|
|
944610f8c8 |
cursor: each test file mints sign-in tokens of its own
The publish run for
|
||
|
|
d9c858c3c0 |
cursor 0.2.28: a Run over HTTP/1.1 sends its BidiAppends 16 at a time, as cursor-agent does
Over HTTP/1.1 (where HTTP/2 can't open a Run) each client message goes up as a BidiAppend. openH1 sent them strictly one at a time, so a new Run's history (one blob a message, which Cursor asks for all at once) cost a round trip to api2.cursor.sh per message before the model could start: hundreds of round trips for a long conversation. cursor-agent 2026.10.01 (startAppendingInputs) keeps up to 16 appends in flight, numbered by seqno (`m.length>=16&&await Promise.race(m)`). openH1 now keeps up to atOnce (H1.atOnce, 16) appends on their way, in seqno order; past that a write waits for one to finish. A native session's Run passes 1: it counts a write as done only when Cursor answered that append, so a tool result is never uncertain (the native HTTP/1 tests hold that, maxInFlight 1). Seen from ysm119's report (33-36 s to first token on claude-opus-5-5); whether he is on HTTP/1.1 is not known. Run: bun test packages/cursor (314 pass, 0 fail) and bun scripts/check.mjs cursor (ok), on mote. Broken by hand: with openH1 back to one at a time, the new http1 test is red (most in flight 1, expected > 1). With runNative not passing 1, five native-http1 tests are red (maxInFlight 3, uncertain-append and writeWait cases), so the serial contract is held there; open.test.mjs's serial openH1 tests now ask for atOnce 1 by name. Not tried: a real Cursor account over HTTP/1.1; the serial cost was not measured against Cursor itself, only counted against a fake. |
||
|
|
fc1457162c |
cursor 0.2.27: a chat request no longer waits for a model list Cursor can't give
ysm119 on Discord: claude-opus-5-5 through the plugin takes 33-36 s to its first token on every request. A chat request picks its variant from the account's model list (AvailableModels, up to 30 s) before it opens its Run. A list Cursor couldn't give was never kept, so every request asked for it again and waited for the ask to fail before its Run; a list past its 10 minutes was waited for again too, and requests at once each asked. listFor now gives the chat path the list without waiting when it needn't: a list past its keep is used while a new one is asked for in the background, requests at once share one ask (listing), and after a failed ask requests go without the list for 5 minutes (LIST_RETRY), as the first one did. Only a token with no list and no recent failure waits. provider.models still fails when Cursor can't list, so magpie keeps its list. Measured against a fake Cursor (bun 1.4.2, on mote): with AvailableModels failing after 3 s, every request's setup was 3003 ms before, re-asked each time; the plugin's own setup is ~20 ms cold, ~4 ms warm, and stream chunks reach the client 0-7 ms after the server writes them. Run: bun test packages/cursor (314 pass, 0 fail) and bun scripts/check.mjs cursor (ok), on mote. Broken by hand: on the old index.mjs all three listwait.test.mjs tests are red; with only answerOf back on usable(), the failed-list and stale- list tests are red. Not tried: a real Cursor account (its token is in the Keychain); whether ysm119's AvailableModels fails or is slow is not confirmed. |
||
|
|
df4dfcd8f7 |
cursor 0.2.26: a picker model whose usable id is its other family goes as that id
ysm119 on Discord, after 0.2.25: claude-haiku-5-5-thinking still failed its Test with no answer. A Team account's picker can have Claude Haiku 5.5 with thinking as its default, while cursor-agent models lists Haiku only as claude-haiku-5-5 (no thinking). modelsOf looked up the usable ids of the default's family alone, found none, and every Haiku id went out as a picker variant (claude-haiku-5-5-thinking-high, -low, ...) the account doesn't have. modelsOf now falls back to the same model's family with thinking or without it, so each variant id goes as the id the account lists. Run: bun test packages/cursor (311 pass, 0 fail) and bun scripts/check.mjs cursor (ok), in a sandbox HOME. Broken by hand: with the fam lookup back to the default's family only, the new context.test.mjs test is red (17 pass, 1 fail). Not tried: a real Team account whose list has Haiku without thinking; the owner's Cursor account doesn't show this shape. The fixture is built from the report's ids, not captured bytes. |
||
|
|
cb776e2ebb |
cursor 0.2.25: a tiered family is named without its tier; a thinking id runs on the model without it
Reported by ysm119 (magpie Discord, 10-27, after 0.2.24): on the Team
account the Cursor list showed "Claude Opus 5 1M Medium Thinking",
"Claude Opus 4.7 1M Medium Thinking", "Claude Sonnet 4.6 1M Thinking",
"Claude Haiku 5.5" and so on, read as one fixed tier each ("没法设置模型
档位"), and the picked claude-haiku-5-5-thinking failed its test.
Cause:
- usableTitle (0.2.24) dropped effort words only at the end of Cursor's
name, so a name with "Thinking" or "(NO ZDR)" after the tier kept
"1M Medium". The entry already had the family's efforts as variants
(magpie's reasoning levels); only its name said Medium.
- claude-haiku-5-5-thinking is an id 0.1.x listed and is still in the
reporter's picks. When the account's list has no Haiku 5.5 with
thinking, named() found no family and the id went to Cursor as it was:
"AI Model Not Found".
Now:
- A usable-only family's name drops its default id's effort phrase, Fast
and 1M wherever Cursor puts them, and keeps words of the model's name
(GPT-5.1 Codex Max stays Max).
- An id with no family of its own runs on the same model with thinking
toggled (usable-only family or picker variants), at the id's effort,
before it would be sent as named.
Run:
- bun test packages/cursor: 310 pass, 0 fail; bun scripts/check.mjs
cursor ok.
- Three new tests in context.test.mjs, built on the reporter's literal
names; all three fail on 0.2.24's index.mjs (names kept "1M Medium",
claude-haiku-5-5-thinking sent as is, a picker thinking-only Haiku
asked as claude-haiku-5-5-low).
Not tried: the reporter's real Team list (their ids weren't sent; the
tests use Cursor's id pattern, claude-opus-5-thinking-high, for their
names), any real Cursor request, magpie end to end. A family whose ids
carry a suffix after the effort (the "(NO ZDR)" Fable, id unknown) may
still list one entry per tier.
|
||
|
|
fc2866fc9e |
cursor 0.2.24: a family only cursor-agent lists runs as its usable ids
Reported by ysm119 (magpie Discord): on a Cursor Team account, `magpie claude cursor/claude-opus-5-5@1m` waited and then failed with "AI Model Not Found", and `cursor/claude-opus-5-5` the same, while `cursor-agent models` lists claude-opus-5-5-low, -medium, -high, -xhigh, -max (and -fast of each), and `cursor/claude-opus-5-5-low` works. Cause: when the account's AvailableModels picker lacks a model (or a picker model has no variant the account can use), the plugin sent the family id or the literal `@<size>` id upstream, which Cursor doesn't know. Now: - A family GetUsableModels lists and the picker doesn't is listed once under its family id with its efforts, and a request goes as the usable id the effort and fast pick (claude-opus-5-5 + low -> claude-opus-5-5-low). - A picker model whose chosen variant isn't usable goes as its family's nearest usable id. - An `@<size>` id the list no longer has runs at the model's nearest size, in Max Mode past the model's window. An account whose picker covers every usable id lists and sends as before. Run: - bun test packages/cursor: 307 pass, 0 fail; bun scripts/check.mjs cursor ok. - Four new tests in context.test.mjs built on the reporter's literal ids (claude-opus-5-5-low ... -max-fast, "Claude Opus 5.5 1M Low"). - Broken by hand: the three tests for the new behaviour fail on 0.2.23's index.mjs; the "covered picker lists as before" test passes on both. - Real account (owner's, read-only token): with claude-opus-5-5 dropped from the real AvailableModels reply, 0.2.23 sends "claude-opus-5-5@1m" and "claude-opus-5-5" and gets Cursor's 502 "AI Model Not Found: Model name is not valid", the reporter's error. 0.2.24 sends a usable id and Cursor takes the model (429 weekly limit on this account for Opus 5.5). Dropping grok-4.7 the same way: grok-4.7@500k, grok-4.7 and grok-4.7-low answer 200 on 0.2.24; grok-4.7@500k is 502 Not Found on 0.2.23. With the real, unmodified picker: grok-4.7@256k and composer-2.5 answer 200. Not tried: a Team account (the reporter's), an Opus 5.5 reply that succeeds (this account's weekly quota is spent), magpie end to end. |
||
|
|
36d8902601 |
cursor 0.2.23: send cursor-agent's team in x-cursor-team-id (#231)
cursor-agent sends the team a request is billed to in `x-cursor-team-id`, from
cli-config.json's `authInfo.activeTeamId`. Without it, Cursor takes the
token's default team. In an organization that team may have on-demand spend
turned off, and the request then fails with "Team budget limit reached".
The plugin now sends the same header on Run (both the native and the stateless
path) and on the dashboard calls. It takes the team only when the token's
`sub` is the config's `authInfo.authId`, so an account signed in from magpie
never gets another account's team. GetHardLimit and GetCurrentPeriodUsage still
go out with `{}`, as cursor-agent sends them. GetFilteredUsageEvents names the
team only when there is one. The config's location (CURSOR_CONFIG_DIR, then
$XDG_CONFIG_HOME/cursor, then ~/.cursor) and the team check (a positive
integer) match cursor-agent 2026.10.01's paths.js and request.js.
Run at d4476ff merged onto main
|
||
|
|
f0bd94c4e2 |
cursor 0.2.22: a heartbeat keeps a counted tool batch open, and its failure says how much came (#377)
Okxdd123's grok-4.7 step counted its batch, thought, then wrote one long call for over 30 s with only heartbeats, and failed as "Cursor did not complete its declared native tool batch". batchWait was reset by a call, answered call, count or text, never a heartbeat, so a single long call's arguments could not outlast it. A heartbeat (InteractionUpdate 13) now resets it while the batch is open; silence stays bounded by idle (60 s) and a heartbeat-only stretch by quiet (240 s), as #2672 set. The failure now reads "N of M calls came, K answered here, none since X ms", the counts the report asked for. Not changed: the issue's third ask, a stateless rebuild for this failure. A streamed reply has already shown its reasoning by then, and the rebuild only runs before output is exposed. Run: the two new native-session tests and the updated #155 test are red on the old code (3 fail) and green after; bun test packages/cursor 291 pass in a sandbox HOME; bun scripts/check.mjs ok. Not tried live: it needs a real Cursor step writing one call for over 30 s. |
||
|
|
c9a0215f31 |
cursor: a continued Run that goes quiet after the caller's results ends (#364)
Test only. #364's tests covered the pause at a sealed batch but not the
resume after the submit: with resume() leaving the Run paused, every
test passed and a retained Run that went quiet on its second model call
would wait for lifetime again. This one is red with that break (times
out at 5 s) and green at
|
||
|
|
cf1873e292 |
cursor 0.2.21: a Run Cursor stops answering ends, retained or stateless (yetone/magpie#2672) (#364)
A Run Cursor stops answering mid-turn now ends with a 502 that says so,
on both the stateless path (runOnce/decode) and the retained path
(NativeSession.pump), instead of holding the reply open until the agent
gives up (yetone/magpie#2672: two composer-2.5 turns waited 305 s).
Quiet wraps a Run's frames: 60 s with no message at all, or 240 s with
only Cursor's heartbeats (InteractionUpdate.heartbeat), ends it. Only
time spent waiting on Cursor's next frame counts; a retained Run parked
for the caller's tool results is paused (resultWait bounds it) and
resumes from nothing after the submit. Each frame gets a fresh wake
promise, so frames already passed on are not held for the stream's life
(review of cbd5d3b). cursor 0.2.20 -> 0.2.21.
Run at the reviewed head 6a17d61 (base 79e383c; main
|
||
|
|
a41a8d3a57 |
cursor 0.2.20: the MCP server the caller's tools go to Cursor under is "tools", not "magpie"
What goes to Cursor named magpie in four places: the dynamic tool catalog
in the system prompt ('The MCP namespace "magpie" has the tools below' and
each <call> entry's "namespace":"magpie"), every CallDynamicTool call in
the history (args.namespace), each McpToolDefinition's provider_identifier
(field 4), and the server answered for mcp_state_exec_args (name and
identifier). magpie's LESSONS.md rule: text added to a vendor's prompt
names neither magpie nor the vendor's limits, with the care a header
change gets (5d33f060b / 3c4f8f9ae).
cursor-agent names a user's MCP server by its mcp.json label
(providerIdentifier = serverName) and a call by "<label>-<tool>"; read in
cursor-agent 2026.10.01-e373342. The plugin now does the same with the
generic label "tools" (NS), in all four places. Calls are read back under
NAMESPACES = ["tools", "magpie"]: a "<ns>-<tool>" name without field 5 is
stripped of either prefix, and a native exec's provider/server is accepted
as either, so a native session begun on 0.2.19 still has its calls served.
The non-native history is rebuilt from the caller's messages each request,
so it carries the new name at once.
Siblings in other packages that still name magpie upstream, filed, not
changed here: commandcode User-Agent and x-project-slug (#352), kimi-work
User-Agent (#353), qoder business.name (#354), autoclaw device_id (#355),
kimi-desktop's instructions tag (#356), opendesign's host fallback (#357),
layerfs tool descriptions (#358). Left alone as not upstream: X-Magpie-*
response headers, the x-magpie-cursor-session hook header (never sent to
Cursor), magpie_native/magpie_deferred usage fields, sign-in messages.
Test: upstream-words.test.mjs builds a Run (buildRun) from a conversation
with tools and a tool call, and checks that the catalog, every transcript
blob, the request bytes and the mcp_state answer contain no /magpie/i, and
that a call is read back as both "tools-read" and "magpie-read". Red on
the old index.mjs (2 of 3 fail: catalog, mcp_state); green now.
conversation, reasoning and native-test-wire expectations moved to
"tools"; native-e2e still sends provider "magpie", so the old name is
covered on the native path.
Run at this tree:
- bun test in packages/cursor: 279 pass, 0 fail (17 files).
- bun scripts/check.mjs: every package ok.
- Live, owner's Cursor account, sandbox HOME (scratchpad), the plugin's
loader.fetch with one read_file tool, http2 writes scanned for "magpie":
auto: turn 1 called read_file {"path":"notes.txt"}, turn 2 with the
result answered "Pelican"; 0 chunks named magpie (the old index.mjs
under the same scan: 2). grok-4.7-fast: the same two turns, 0 chunks.
claude-4.6-sonnet: 429, not in this plan's weekly usage.
Not tried: a native session resumed across the upgrade against real Cursor
(covered by native-e2e's "magpie" provider against the fake server only).
|
||
|
|
c845b17e9c |
cursor: http1.test counts a Run when its first message comes, not when its stream is read (#272)
Cause: the fake agent counted runs++ when the server's "stream" event fired. In the region test the first Run stalls (mode "stall"), the plugin gives up at H2.wait and goes on over HTTP/1.1, and the test then sets mode "answer". On a loaded machine the server can read the stalled Run's HEADERS only after that switch, so the stale stream was taken as a second Run: ag.runs 2, expected 1. "Runs kept on HTTP/1.1 try HTTP/2 again once H2.retryAfter has passed" has the same stall-then-answer shape. The plugin is right; the fake miscounted. A Run now counts once its first message arrives (the plugin writes it only after the head, so a stream whose client gave up never brings one), and a stream already destroyed when it is read isn't answered. Run on macOS arm64, bun 1.4.2: - Injected: the fake held the first stream and emitted it the moment the test set mode "answer". origin/main's test: red, Expected 1 Received 2, the issue's output. With this change: green. The retryAfter test under the same injection: red on origin/main, green now. - Loaded: 8 parallel `bun test --rerun-each 15 packages/cursor/http1.test.mjs` at load average ~50: 8 x 240 pass, 0 fail. - `HOME=$(mktemp -d) bun test` from the root: 1920 pass, 0 fail. `bun scripts/check.mjs`: ok. Test-only, no version bump. |
||
|
|
0a2496bb3a |
cursor 0.2.19: conflicting native batch counts rebuild once from history before any output (#207, nicegui)
A Cursor native Run whose step lists two different tool counts (a Codex-to-Cursor failover hit "inconsistent native tool count") now retires the owner instead of throwing. When no native result was submitted to that Run and no Chat output was exposed, the request is rebuilt once from Chat history (the same stateless rebuild the missing-count case uses), with reason=inconsistent-batch-count in X-Magpie-Cursor-Continuity. A Run that had a result submitted, or a stream that already sent output, still returns the error. The decoder stops reading the failed Run at once. Cursor 0.2.19. Reviewed at c43b93c (on main |
||
|
|
2ea25b925b |
cursor: the latency test's far events show once their step has answered, and a step's wait is counted in asks, not ms (#159, #162, #165)
#159 and #162: the "far from Cursor" fake showed a Run's usage event SHOWS (225 ms scaled) after the Run's stream closed. The step's wait takes its last look about 180 ms after that close, so only ~45 ms stood between "the event is not there yet" (what the test means) and "the event is already there" (the step owns it and the sum moves). A loaded machine eats 45 ms. #162's title guessed an earlier test's cached usage; it was the step's own event showing inside its wait. The fake now holds a far Run's event until the step whose Run it is has answered, and shows it at once if that step already has: the state the test is about, not a duration. #165: test 1 bounded each step's wait in milliseconds, which load stretches. Each wait asks once and the round trip is most of it, so the bound is now at most 2 asks per step (its own event, plus what earlier steps owe). Run (bun 1.4.2, load average 280-295 throughout): - Old test, cause injected by showing the event earlier (SHOWS - 50 ms): #159's failure; SHOWS - 80 ms: #162's. New test with the same injections: green. - packages/cursor/latency.test.mjs: 9 of 9 green. - packages/cursor whole package (HOME=$(mktemp -d) bun test): 3 of 3, 272 pass, 0 fail. - Broken by hand in index.mjs, each turned the new test red: the step waiting for its own event removed; owed() not gathering at the end; the ask bound raised (a step asking 3+ times). Not run: the whole-repo suite (test-only change in one file). |
||
|
|
0c35adbf03 |
cursor 0.2.18: a failed tool result tells Cursor isError, and a refused keychain read is not asked again for ten minutes
Two things magpie's built-in Cursor did that the plugin didn't, ahead of
the built-in's retirement:
- The stateless path (conversation) sent every tool result with
isError false. A chat tool message with is_error: true (what magpie now
sends for a failed tool, as the built-in's cursorResult told Cursor
isError) is marked isError, as the native path already did.
- cliToken ran `security` on every call. It now reads the Keychain as the
built-in's cursorKeychainToken (internal/provider/cursor.go; magpie
#746, #2408): a read is kept 10s; a read that failed with anything but
exit 44 (no such item) may have been a dialog the user said no to, and
is not asked again for 10 minutes; reads go one at a time, so callers
at once share one run. A sign-in and the read after `cursor-agent
status` read afresh, as forgetCursorStatus / cursorTokenOf(true) did.
README's "read on every request" says so now.
What was run (bun 1.4.2, macOS, load average ~280-300):
- parity.test.mjs (new, 5 tests): green. Broken by hand, each watched
red, then restored: is_error ignored (1 red), cache check removed
(3 red), denied backoff at 10s (1 red), exit 44 treated as refusal
(1 red), no read serialisation (1 red).
- `security find-generic-password` for a missing item gives execFile
err.code 44 (number) on this Mac, as the mapping assumes.
- Full `bun test` in packages/cursor, 7 runs: 272/272 green in 4; the
other 3 red only in latency.test.mjs ("events never show in time",
#159; "nothing naming the session", #162), which the change doesn't
touch. On clean origin/main
|
||
|
|
3dbaa0b16f |
cursor 0.2.17: a tool-result continuation in a Run's last minute rebuilds before writing results, not 502 at the lifetime (#157, nicegui)
Run at this commit: packages/cursor `bun test` (isolated HOME) 267 pass, 0 fail; `bun scripts/check.mjs` ok. Version bump only. |
||
|
|
0b821908bc |
cursor: a tool-result continuation in a Run's last minute rebuilds before writing results, not 502 at the lifetime (#157, nicegui)
The 15-minute absolute lifetime spans all of a retained Run's tool
roundtrips. A tool-result continuation that arrives with no more than
min(60s, lifetime/10) left now retires the owner (410 "retired before
lifetime deadline") and rebuilds from the supplied history before writing
any result, instead of resuming and failing mid-segment with "native Run
lifetime expired". Replays of an already submitted batch keep their path.
Merging main resolved a conflict with
|
||
|
|
a7614aa2ff |
cursor: the lifetime-expiry test brings a Run's lifetime in after its first answer, not before it starts (#143)
The native retention test set NATIVE_LIMITS.lifetime = 65 before the
first ask. The lifetime counts from the Run's start, so on a loaded
machine the first Run expired before it answered: 410 where the test
wants 200. NativeSession now sets its deadline through expireIn(ms), the
constructor giving it the whole lifetime as before, and the lifetime case
calls owner.expireIn(65) after the first answer. The resultWait case
still sets its limit up front, since that wait counts from the answer.
The plugin's behaviour is unchanged, so there is no version bump.
Run:
- Injected: on the old test, a lifetime of 0–10 ms is red ("Expected: 200
Received: 410"); 15 ms and up is green. The new test is green.
- HOME=$(mktemp -d) bun test, whole repo: 10 runs in a row, 0 fail
each. On current main
|
||
|
|
2dd4328d5a |
cursor 0.2.16: a multi-step turn's last step reports its own share of usage, and a step's calls get batchWait from the latest one (#156, #155)
Run at this commit: packages/cursor `bun test` (isolated HOME) 266 pass, 0 fail; `bun scripts/check.mjs` ok. Version bump only. |
||
|
|
c7c6498d85 |
cursor: a multi-step turn's last step reports its own share of usage, and a step's calls get batchWait from the latest one (#156 erzay, #155 midmirror)
#156: a native Run of N tool steps ended with TurnEndedUpdate's totals as the final step's prompt_tokens (1,105,934 on erzay's ~21-step turn, where the real context was ~61K), and Codex compacted at once. The final step now keeps its last model call's share, max(that call's chars/4 prompt estimate, turn total / model calls), split proportionally across input, cache read and cache write; the rest goes into usage.magpie_deferred (merged with any settled stateless debt), so magpie still bills the whole turn. On erzay's numbers that is ~52.7K reported, ~1.05M deferred. #155: waitForBatch armed once, at a step's first call, so a step whose calls arrive one by one as the model writes them (13 calls, 9 long-arg) failed 502 "did not complete its declared native tool batch" ~30s after the first call even though it never paused that long. The deadline now restarts on every call, answered call, count and text/reasoning frame. Run at this commit: packages/cursor `bun test` (isolated HOME) 266 pass, 0 fail, three times; `bun scripts/check.mjs` ok. The three new tests fail on 4e64f26's source (prompt 1105934; sealed step failed at 300ms; stall failed 303ms after the first call instead of after the latest). |
||
|
|
2b67811af8 |
cursor 0.2.15: calls the bridge answers itself count toward Cursor's tool count, and KV replies wait for a slow link instead of failing the Run (#142, Evopower)
Run at this commit: packages/cursor `bun test` (isolated HOME) 263 pass, 0 fail; `bun scripts/check.mjs` ok. Version bump only. |
||
|
|
1bf9113390 |
cursor: calls the bridge answers itself count toward Cursor's tool count, and KV replies wait for a slow link instead of failing the Run (#142, Evopower)
Cursor's tool_requests_listed (InteractionUpdate 27) counts every call of
the model's step, and is sent after them. That count includes calls the
plugin answers itself: a tool the request doesn't have (0.2.14's native
path refuses those) and Cursor's get_mcp_tools (exec 36). 0.2.14 counted
only the calls it accepted. A step with a refused call then either waited
30s for a call that never came (502 "did not complete its declared native
tool batch") or met the next step's count with the stale one (502
"inconsistent native tool count", the reporter's error). The stateless
decoder had the same miscount and hung. Both paths now count answered
calls toward the step and end a step whose calls were all answered without
one.
503 "native outbound messages limit reached": a long history goes out as
one blob per message, and Cursor asks for every blob at once. The native
transport caps its pending writes at 256 messages / 16 MiB and failed the
Run when a slow link backed them up past that. KV replies now wait for
room (NATIVE_LIMITS.writeWait, 30s) and fail only if the link doesn't
drain for that long. The stateless path writes directly and has no cap.
The fixtures are real Cursor frames captured on 2026-10-15 (model auto,
cursor-agent's agent.v1): get_mcp_tools plus a refused WebSearch in one
step followed by read_file, which gave 0.2.14 the reporter's exact
"inconsistent native tool count"; and read_file, refused WebSearch,
read_file under a count of 3, which gave 0.2.14 the batch timeout.
Run at this commit (on origin/main
|
||
|
|
e543ab1ae8 |
cursor 0.2.14: Run tool calls stay on one native Cursor session, and a tool past Cursor's limit resumes stateless, not as a failed turn (#135, nicegui)
Run at this commit: packages/cursor `bun test` (isolated HOME) 258 pass, 0 fail; `bun scripts/check.mjs` ok. Version bump only. |
||
|
|
33cdf7c1a8 |
cursor: Run tool calls stay on one native Cursor session and resume stateless after a long tool, not a failed turn (#135, nicegui)
Cursor's Run (native) calls stay on one Cursor session across a tool result. With them, a tool that runs longer than Cursor's limit resumes stateless, not as a failed turn. The session pool lives in native-session.mjs. It applies to a conversation's first user turn, and a new user turn goes stateless (see the README). X-Magpie-Cursor-Continuity says which path a request took.
The dashboard-usage ledger counts two distinct events in one response that share a millisecond, as main did. Only timestamps claimed by earlier fetches are left out. A new deferred-usage test covers it.
Run at the reviewed head 398aeddc0186cfc38189b1f05577b181aa2d587d (merge base 5d5d86e; main has no packages/cursor change since):
- packages/cursor `bun test` 3 times: 258 pass, 0 fail each time.
- `bun test latency` 12 times with fresh HOMEs: 12/12 pass.
- Broken by hand: putting back `if (claimed.has(key + "\0" + ev.timestamp) || at >= before()) continue` makes the new test "distinct same-millisecond events in one response are billed together, not again on later fetches" fail (2 pass, 1 fail). The head's line passes.
- `bun scripts/check.mjs`: all packages pass.
- `npm pack`, extracted into a fresh dir: index.mjs, native-session.mjs, package.json, README.md. `import("./index.mjs")` exports CursorAuthPlugin and _internal, and native-session.mjs imports.
- CI: test and on-npm green.
Not tried: a real Cursor account. The owner's stored plugin sign-in has no access token. The author reports a real Claude Code run through an isolated gateway: a child resumed stateless after a 125s tool, and all 6 requests returned 200.
|
||
|
|
3351e47715 |
cursor 0.2.13: a Run cancelled while it opens is closed upstream (#130), and dashboard usage is counted per account (#131)
#130: a cancel that landed between the HTTP/2 head and runOnce's abort listener left the Run streaming upstream with its heartbeat, for nobody. #131: claimed/owed/flights are keyed by account and conversation, so one account's Run no longer collects another's debt from its own dashboard. Run at this commit: full `bun test` (isolated HOME) 1292 pass, 0 fail; `bun scripts/check.mjs` ok. Version bump only. |
||
|
|
7c49260ac1 |
cursor: isolate dashboard usage accounting by account (#131)
Cursor's dashboard usage accounting is kept per account, not per conversation.
claimed, owed and flights were keyed by conversation_id alone. When one
conversation's steps ran on two accounts (magpie moving a session between
Cursor accounts), account B's Run collected A's debt from B's own dashboard:
B's own event was counted as A's earlier Run's usage (magpie_deferred) and
B's turn-ending step polled for a debt its dashboard can't have. The keys
are now sha256(token) + conversation_id (usageKey), used by collect, owe,
ledger and the flights cleanup alike. A token change starts a new identity,
as misses/unreadable already were keyed.
Reviewed at 19bbdf8d7162735d7ddafd015d8dfadbb233c3bd, then merged main
(
|
||
|
|
ca6415f959 |
cursor: cancel and clean up stateless Run transports (#130)
A Chat cancelled while its Run opens is closed upstream, not left running.
Before, a cancel that landed after the HTTP/2 head arrived but before runOnce
subscribed to the signal was never seen ({once:true} listener added to an
already-aborted signal): the Run kept streaming upstream for nobody with its
5s heartbeat interval, and the session was never closed. open/openH2/openH1
now check the signal at each hand-off, close what arrived, and remove their
abort listeners; runOnce checks again before starting the heartbeat. HTTP/1's
write callback now waits for its BidiAppend, so backpressure and close see
the pending upload. A cancelled open answers 410 instead of 502.
Reviewed at a4e1db1b0d734c1a1b15c1fe0cafb0f9cb5313c0 (on main
|