7b42e404f5f656d7bfb4aa5c7ddbcd1031264a86
6
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
944610f8c8 |
cursor: each test file mints sign-in tokens of its own
The publish run for
|
||
|
|
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).
|
||
|
|
08614da5c5 |
cursor 0.2.8: an empty reply says what the Run sent before it (#60, congee949)
An "an empty reply" (502) said nothing of why, so #60's 14 empty replies on grok-4.7-fast over seven days can't be told apart: a turn of thinking only, a turn spent asking for Cursor's own tools (which the plugin refuses), something Cursor now sends that decode doesn't read, or an end frame that carried words without a Connect code (which failure() treated as a clean end and dropped). Its message now names them, e.g. an empty reply (Cursor ended the turn; after 31 chars of thinking, no text and no tool call; Cursor counted 41 output tokens; Cursor's own tools asked for and refused: #14; try again) and, when the stream itself ended, the end frame's JSON (cut at 300 chars). Field numbers are agent.v1's. Status, retry and behaviour are unchanged: magpie's gateway retries on the 502, not on the words. Run: HOME=<tmp> bun test, 1103 pass, 0 fail (a first run under load average 16 had 7 bun 5s timeouts in other packages' CLI/login tests, #65's class; the rerun was green); bun scripts/check.mjs cursor passes. The two decode tests go red with the old index.mjs. Through the plugin's loader against a local HTTP/2 fake Run (thinking, an own-tool exec, TurnEnded, no text): the unstreamed 502 and the streamed error frame both carry the message above. Not tried against real Cursor: no cause is proved; this is to name it on the next occurrence. |
||
|
|
93aa1671aa |
cursor: write each catalog entry as its CallDynamicTool call; a thinking-only turn is an empty reply (#11)
GLM-5.3 read the catalog's <tool name=...> entries as tools of its own and called them by bare names, which went nowhere. Each entry is now the CallDynamicTool call itself (namespace, toolName, arguments) — the change infinitr0us proposed in #11, thanks! A turn that ends with only thinking, no text and no tool call, is answered as an empty reply so the client asks again, as the stream's end already did. 0.1.8. |
||
|
|
3ae3e4393e |
cursor 0.1.7: a model Cursor serves only in Max Mode is asked for in Max Mode, and the models Cursor's picker offers beyond the CLI's list (GLM-5.3, GLM-5.3 Flash) are listed (ARNO on Discord: "Cursor: Max Mode Required: The model "gpt-5.6-luna-low" requires Max Mode to be enabled"; "cursor provider 里少了 glm-5.3 和 glm-5.3-flash")
The Run's model went as ModelDetails and RequestedModel with its id alone, never max_mode (ModelDetails field 7, RequestedModel field 2), so a model Cursor serves only in Max Mode was refused. cursor-agent (2026.10.01) turns Max Mode on for such a model itself: requiresMaxMode is supportsNonMaxMode === false or a variant's isMaxMode in AiService/AvailableModels, and a usable model's own maxMode is kept. Now the list notes Max Mode from GetUsableModels' maxMode and from the picker (AvailableModels with useModelParameters, as the CLI asks for it), the Run sends it, and a model neither says it of is asked once more in Max Mode when Cursor answers "Max Mode Required" (the CLI's MAX_MODE_REQUIRED), and in Max Mode from then on. An account Max Mode isn't open to gets Cursor's own answer. The list was GetUsableModels alone, which is `cursor-agent models`; Cursor's picker offers models it leaves out. The picker's models that no usable id, name or slug names are added: one per variant with a legacy slug, else the model by its name with its default variant's parameters, sent as RequestedModel.parameters; hidden, chat-only, Tab-only and non-agent models, and the four the CLI drops, stay out. A picker Cursor can't give leaves the list as it was. The tests now import nonet.mjs first: fetch and HTTP/2 reach only this machine, so a test without its fake, or work still running after it, can't send a token to Cursor. maxmode.test.mjs (fake API and agent API: the list with GLM-5.3 and its Flash and Max Mode marked, the picker down, the Run's max_mode and parameters, the retry after Cursor's refusal) fails without the change (5 of 5) and passes with it; bun test packages/cursor (27 pass) and bun scripts/check.mjs pass. No request was made to Cursor. |
||
|
|
15e66f6792 |
cursor 0.1.6: a conversation's Runs keep one conversation_id, so Grok's and Opus's prompt cache on Cursor sticks, and Cursor's usage no longer counts the cache twice (#6, the port of yetone/magpie#498's 0f415708 the plugin missed)
buildRun gave every Run a new random AgentRunRequest.conversation_id, so Cursor's backend sent each turn to whichever machine and the prompt cache hit only by chance (congee949: cache_read 0, 1152, 0, 0, 0, 0 over six turns of one Grok conversation). The id is now made as the built-in's cursorConversation makes it: a UUID hashed from what names the session — the request's prompt_cache_key (Codex's thread id), else the session magpie (or OpenCode) tells the new chat.headers hook, which the hook hands the loader's fetch in x-magpie-cursor-session and which goes no further — together with the conversation's first user message, so subagents under one session are conversations of their own. With nothing naming the session it stays random per Run: magpie's own "magpie-<24 hex>" session, made of the first message alone when the agent names none, is taken as none, as the built-in's nativeSessionOf does. The hook only marks requests to cursor, as every plugin's chat.headers sees every provider's. TurnEndedUpdate.input_tokens counts the whole prompt, the cache read and written included; it was taken as the uncached input and the cache added again for prompt_tokens. Now, as cursorUsage: input = max(input_tokens - cache_read - cache_write, 0), reasoning_tokens (field 5) given as completion_tokens_details.reasoning_tokens. The prompt is guessed only when Cursor counted nothing at all, not when it was all read from the cache. conversation.test.mjs runs the plugin against a fake Cursor (its API a stand-in fetch, the agent API an HTTP/2 server on 127.0.0.1, any other connection refused): a session's turns keep one id, another session or another first message gets its own, prompt_cache_key wins over the host's session, no session gives a new id each Run, the hook leaves other providers alone, and the issue's numbers come out counted once. All five fail against 0.1.5. |