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.
The app's sign-in stores the account ZCode is signed in to, and stateOf
read ~/.zcode/v2 again for every request. After ZCode switched to account
B and the app's sign-in was added again, both entries read B's
credentials: A's sent B's requests and its usage card showed B.
stateOf now follows ZCode's own credentials only when ZCode's user is the
entry's accountId. Otherwise (ZCode signed out, or on another account) it
uses the snapshot saved at sign-in, which holds the coding plan key, the
Start Plan JWT, the team project and the device. A snapshot whose JWT has
run out says EXPIRED (sign in again), as a lapsed sign-in already did,
instead of borrowing B's session.
own.test.mjs: two app sign-ins (A, then B) with ZCode on B; A's request
carries A's key and no request (messages, plan, usage) carries B's key or
JWT; and A with only an expired JWT says sign in again without sending
B's. Both fail on 0.1.15 (A sent idB.secretB; the expired case was served
with B's JWT). The first test now keeps the account's user_info as ZCode
signs in again. HOME=$(mktemp -d) bun test packages/zcode: 79 pass.
bun scripts/check.mjs zcode passes.
Found beside #86. A Go key's chat completion goes to /alpha/generate with
the CLI's config, which said workingDir: homedir() and isGitRepo: false
whatever folder the agent worked in. It now takes the folder and the git
state magpie tells the plugin's fetch (x-magpie-work-dir,
x-magpie-work-git). Untold, it is the CLI's config outside a project in
the home, as before (a git word without a folder means nothing). The
headers are taken off every request, the Provider API's too.
Run: bun test in packages/commandcode (33 pass, new workplace.test.mjs),
bun scripts/check.mjs commandcode. With the old index.mjs both new tests
fail. Not tried with a real Go account.
The plugin runs in magpie's plugin host, so process.cwd() is magpie's own
folder (C:\Users\<user>\.config\magpie on Windows). The Start Plan's
"# Environment" section said it as "Primary working directory", with a
constant "Is a git repository: no" and magpie's shell, and the model went
looking in magpie's folder.
Now the folder and the git state are the agent's, as magpie tells the
plugin's fetch in x-magpie-work-dir (percent-encoded) and
x-magpie-work-git (yes/no) (yetone/magpie, provider.WorkDirHeader). Each
line is left out when magpie doesn't tell it (an older magpie, an agent
that names no folder, a folder not on this computer). The Shell line is
gone: the agent's shell isn't known here. Platform and OS Version stay;
they are this computer's, as the X-Os-* headers already say. The headers
are taken off before anything is sent, on the coding plan too.
Run: bun test in packages/zcode (77 pass), bun scripts/check.mjs zcode.
With the old index.mjs the new tests fail (6 fail). One real request
through the plugin with the owner's z.ai account (coding plan; its Start
Plan balance is empty, so the dressed Start Plan path was not tried
against the real service): 200.
cdredfox: with several WorkBuddy accounts in one smart routing group, the
account whose credits expire soonest should be used first. WorkBuddy's own
client lists each package with its end (the billing page's paid and free
package lists); the plugin now reads them too.
- /billing/meter/get-user-resource-paid-packages and -free-packages, asked
as the client asks: PageSize 200 up to 10 pages, Status [0,3], its
COMMODITY_CODES (without them the API answers 10001 "PackageCodes
required"), NeedRenewInfo / today's SlicePeriod (UTC+8).
- A package's end is DeductionEndTime, else ExpiredTime, else CycleEndTime
read as UTC+8 (the API's own DeductionEndTime for the same package says
so). Only packages the summary counts, with credits left; the daily Free
Plan slice (CapacityType 4, code 001) is left out, since it ends at the
same midnight on every account.
- The soonest end goes on the Credits window as runsOutAt (RFC 3339) and
the credits lost then as runsOut. A list that can't be read leaves both
out; the card stands as before.
Run: HOME=<tmp> bun test in packages/workbuddy, 63 pass (3 new); with
index.mjs back at 0.1.13, 2 of the 3 new go red. Tried live on a real
WorkBuddy AI account: packagesOf + runsOutOf gave the Bonus Pack's 232.4
credits ending 2026-10-12T16:39:27Z, before Pro's 10-28T16:40:52Z, with
the Free Plan slice left out. Not tried on a CN workbuddy account (its
stored token here is stale); the paths and body are the same on both.
* grok 0.1.12: a model Grok lists at two windows is offered at each
context_window stays the plain id, so a saved grok-4.7 keeps the default
256k window. Each other size in context_windows is listed beside it
(grok-4.7@500k) with that window. A request for it sends the plain model
and x-grok-context-window: 500000, which is the window a client such as
Claude Code compacts against. The proxy serves up to its largest window
either way and refuses past it.
* grok: a window model's api.id keeps its @size, so x-grok-context-window is sent
The models hook gave grok-4.7@500k the api.id grok-4.7. magpie
(internal/provider/plugins.go, modelAPIID + withModel) and OpenCode's AI
SDK both put api.id in the request body, so the plugin's fetch only ever
saw grok-4.7 and never sent x-grok-context-window. api.id is now the
offered id; fetch strips the window (modelOf) before Grok sees the body.
Run: HOME=$(mktemp -d) bun test packages/grok (35 pass);
bun scripts/check.mjs grok. The new round-trip test (models hook ->
api.id -> fetch) is red on f4872fb and red again with the body rewrite
removed by hand. Real use against the owner's Grok account (copied
home): /v1/models lists 4 models at 256k and 500k; grok-4.7 and
grok-4.7@500k each answered 200, the latter with x-grok-context-window:
500000 and model grok-4.7 in the body.
---------
Co-authored-by: chenguoqing <chenguoqing@kemai.cn>
Co-authored-by: yetone <yetoneful@gmail.com>
Releases #82 (126b105): a Chat request's assistant reasoning_content (or
reasoning) goes into the next Run's transcript as an AI SDK reasoning part,
beside the text and tool calls, also when a turn's parallel calls are split
over two assistant messages; the input estimate counts it.
Run: bun test packages/cursor (83 pass), bun scripts/check.mjs. Live with a
real Cursor Pro account through this fetch: a tool continuation carrying
reasoning_content answered 200 on auto, claude-haiku-5-5-thinking and
gpt-5.5.
#76: Zen's free models sometimes call a tool by a name the agent never
declared (tkhs101's table: bedit, bcp, ash, mcp__netcatcatty__unused,
beside declared edit, bash, mcp__netcatty-external__list_hosts). The
guard answered each with "Upstream called a tool not declared by the
client", which failed the whole turn. The rows without a name are from
before 0.1.1 (published 10-10 11:51 UTC), which added the name.
Now such a call (or one with no name) is left out of the reply instead:
- chat: dropped from tool_calls/function_call; the reply's content says
"(The model called a tool this agent doesn't have: "bedit". The call
was left out.)"; kept calls are renumbered from 0; finish_reason
becomes "stop" when no call is left, including a repeated finish.
- responses: the function_call item becomes a message item with the
note (added, text deltas, done, and in response.completed); its
argument events are not passed on.
- anthropic: the tool_use block becomes a text block with the note; its
input deltas are not passed on; stop_reason tool_use becomes end_turn
when no call is left.
A call of an unsupported type (custom tools, non-object input) still
fails as before.
Run:
- bun test packages/zen-free: 155 pass, 0 fail; node --test
packages/zen-free/*.test.mjs: 155/155; bun scripts/check.mjs zen-free.
- The new tests on the old tool-response.mjs: 35 fail.
- Breaking the finish rewrite by hand: 5 fail.
- Chat stream fixtures use the shape a live step-5-preview-free stream
sent (name whole in the first delta, arguments in pieces, two
tool_calls finishes). Zen sends names whole, so the names in #76 are
the model's own; a real misnamed call was not reproduced live.
The market card showed the generic agent glyph: neither the registry nor
the package gave a picture. package.json's magpie.icon gives it to the
market card (magpie reads it from npm), and agent.icon to the agent magpie
adds. Ran: bun test packages/aider, bun scripts/check.mjs; the URL answers
200 image/png.
magpie (cb406c84) lets a plugin add an agent it has no setup of its own
for. This one writes Aider's ~/.aider.conf.yml: the model under litellm's
openai/ prefix, magpie's /v1 and Aider's own key. check.mjs skips agent
packages as it does middleware; README gains an Agents section.
Run: bun test packages/aider (2 pass); bun scripts/check.mjs; the module
loaded through magpie's agentplug.Compile and its connect returned the
three keys. The same module, in a sandbox magpie, wired a real aider
0.86.2 that answered from a real DeepSeek account, and Disconnect put
the file back byte for byte.
Jeremy.Zhou asked that dropped free models leave the list by themselves
and new ones join it. The list was already read from Zen's /models each
time the host lists models (magpie's start, refresh, and now its hourly
relist), with the last list kept when Zen's can't be read. Two request-time
gaps remained:
- A model not in the list (Zen dropped it) threw, which the host reports as
a transport failure, so magpie rested the whole account. It is now a 404
not_found_error, "Model X is not available as an OpenCode Zen free model
now. Free models: ...", which magpie reads as that model alone refused.
- After the first list, a model not in it never asked Zen again, so one
made free since stayed refused until a relist. Now it asks again, at
most once a minute, so a hand-typed id doesn't list on every request.
A model on the wrong protocol still throws as before. README's Models
section says how the list stays current.
Run: bun test in packages/zen-free (32 pass; 3 of the new tests fail on
0.1.1's provider.mjs), bun scripts/check.mjs (ok). Real use against Zen
with the public key: glm-5-free gets the local 404 listing Zen's 11 free
models, big-pickle answers 200.
The test sends a 32 MiB SSE event through guardToolResponse twice (64 MiB
in all). On a loaded machine (load average ~110) it ran past bun's default
5s and failed, though it passes on an idle machine and on CI. The timeout
now leaves room for load; the assertions are unchanged.
Run: bun test in packages/zen-free (all pass).
Devin plans billed by quota have a daily and a weekly quota. GetUserStatus
answers in proto JSON, which leaves a 0 out, so a week with nothing left
came as no weeklyQuotaRemainingPercent at all beside the day's 100. usage
skipped a window whose share was left out, so the card showed "1 day 0%"
alone and magpie's routing, seeing no full window, kept sending to an
account Devin refuses until the week resets.
On a BILLING_STRATEGY_QUOTA plan a window with a reset time and no share
is now used up (100%, its reset kept), so routing holds the account until
then. A hidden quota and one with no reset are still not shown, and a plan
billed otherwise still has no quota windows from a share left out.
usage.test.mjs: the new test (the week left out beside the day's 100, and
both left out) fails on 0.1.13 and passes now; the old test that took a
left-out share for "no quota" on a quota plan is replaced.
HOME=$(mktemp -d) bun test packages/devin: 50 pass, 0 fail.
bun scripts/check.mjs devin passes. Against the owner's real Devin Teams
account (read-only GetUserStatus): both windows are read as before
(1 day 0%, 7 days 1%), so present shares are unchanged. A real account
with the week used up wasn't available; the left-out field is how the
reporter's card lost its week.
usage read /users/me/plan/usage-limits with .catch(() => null), so every
failure there (401, 403, 429, 5xx, a timeout, a {success:false} envelope)
looked like an account without ClinePass: the card showed the balance
alone and said nothing. Only a 404 means no ClinePass (AxonHub's Cline
checker reads it the same way); any other failure now sets the usage
error "ClinePass limits couldn't be read (HTTP n: ...)" beside the balance,
the sign-in kept. clineApi's errors carry the HTTP status for this.
When /users/me or the balance failed, usage returned an error alone and
dropped the limits already read. Now the windows read are returned with
no error when the balance can't be; a failed /users/me still tries the
signed-in account's uid for the balance, and only a lapsed /users/me is
the sign-in gone. With nothing read at all, the balance's failure is the
error as before.
Tests (real reply shape {success, data: {limits: [{type, percentUsed,
resetsAt}]}}, 404 for no ClinePass): limits failing with 403, 401, 500,
429, a refused envelope and a network error; balance failing with
limits read; /users/me failing with limits read; neither read. The 8 new
cases fail on 0.1.6 (bun test: 70 pass, 8 fail) and pass now (78 pass);
bun scripts/check.mjs passes. Not tried against a real Cline account
(none at hand).
Asked to write each call as {"name":…,"arguments":{…}}, a model on Trae
sometimes wrote the arguments wrapped again, {"arguments":{…}}, and the
plugin passed that on: bee2an's agent got
{"arguments":{"content":"P\n\n","path":"…/trail2.txt"}} for its write and
wrote nothing useful.
Every call, from a block in the text or from Trae's native tool_calls,
streamed or not, now goes through one step in parts(): a lone arguments,
input, parameters or args key holding an object (or a JSON string of one)
is taken off, up to three layers, when the request's tool has no
parameter of that name. A tool whose own parameter is called input keeps
it, and a call to a tool the request doesn't list is left as it is.
Run: bun test in packages/trae, 96 pass. unwrap.test.mjs uses the
reporter's arguments byte for byte; its three tests fail with the step
stubbed out.
Claude Code with the context-management beta sends context_management
(here clear_thinking_20251015, keep all). Factory's streaming route
answers it with 400 "context_management: Extra inputs are not permitted";
the same body with stream false, or without the field, gets 200 (the
reporter's three cases). A streamed /messages request now goes without
the field; an unstreamed one keeps it. The server then clears nothing,
and Claude Code's own compaction still runs.
The version bump also releases the previous commit's #72 fix.
Run: HOME=<tmp> bun test in packages/factory, 119 pass (1 new from the
reporter's body; the existing all-fields test now expects the field gone
on its streamed request). With the deletion disabled by hand both go red.
Not sent to Factory: no Factory account here.
Claude Code also sends the skill list as a standalone system message with
only its entries: no header, no <system-reminder> wrapper, no
<total_tokens> tail, as text blocks and (later in the same session) as a
plain string. The adapter only knew the headed and token-terminated forms,
so the update-config line went through unchanged and Factory answered
403; the reporter got 200 with only "not Claude" -> "not the assistant".
bareSkills applies that same known-line change to a system message that
opens with a "- " entry, both content shapes. User messages, quoted lists
and other skills' lines are left alone.
Run: HOME=<tmp> bun test in packages/factory, 118 pass (2 new, the
reporter's body byte for byte as fixture). With bareSkills made a no-op
by hand the new test goes red. Not sent to Factory: no Factory account
here.
WorkBuddy answers as the personal account unless a request names the
enterprise. Its own client (codebuddy.js in WorkBuddy.app: the auth
interceptor and buildAuthHeaders) sends X-Enterprise-Id and X-Tenant-Id,
both the account's enterpriseId, on every request; the plugin sent
neither, so /v3/config gave the personal plan's list.
- A browser sign-in keeps the enterpriseId /login/account names. When it
names a non-personal type without one, the id is taken from
/v2/plugin/accounts the way the client's mergeCurrentAccountDetails
picks (same uid and type, else the one last signed in to).
- Desktop's sign-in reads account.enterpriseId from the app's file.
- sign() (chats, /v3/config), the usage meter and the token refresh carry
the two headers; a personal account sends none.
Run: HOME=<tmp> bun test in packages/workbuddy, 60 pass (6 new). With the header
loop and the sign-in lookup removed by hand, 4 of the 6 new tests go red.
Not tried against a real enterprise account (none here); the field names
are the ones WorkBuddy's own client reads.
Zen's models open multi-step work with OpenCode's own todowrite, while
DeepSeek Harness declares todo_write. The guard folded names only for the
five core tools the plugin injects, so with an agent that declares all
five nothing was injected, nothing folded, and the whole turn died with
"Upstream called a tool not declared by the client" - without saying
which tool.
Now any call is given the agent's tool whose name differs only in case,
or else only in case and separators (todowrite -> todo_write, webfetch ->
web_fetch, BASH -> bash), when exactly one declared tool folds to it; a
name two declared tools fold to is still refused rather than guessed.
A refused call's error ends with the tool's name.
Run: bun test and node --test in packages/zen-free (141 pass; under a
load average of ~140 bun's 32 MiB buffer tests sometimes hit their 5s
timeout, the same on the old code, one run fully green); the new #76
tests fail on the old tool-response.mjs (6 red). bun scripts/check.mjs
zen-free. Live against Zen (step-5-preview-free, chat, stream): calls
pass with the folded names; the model didn't emit todowrite in 6 tries,
so the mapping itself is shown by the tests.
A Cursor team (or personal plan) with on-demand spend allowed keeps being
served once Cursor Models / Other Models reach 100% of the included usage.
The usage read gave only those pools, so magpie counted the account used
up: smart routing put it last, and any failure while a pool read 100%
rested it until the billing period renewed (held to 8 days).
usage now also reads GetHardLimit and the period's spendLimitUsage, and
derives the On-demand state exactly as cursor-agent 2026.10.01's usage
view does (fixed limit, unlimited, disabled, unavailable). When on-demand
is fixed or unlimited, the pools are still shown but marked aside, and an
On-demand window ($used / $limit) is the allowance: used up at its limit,
never when there is none (then aside too). Disabled or not known: the
pools are the allowance, as before. Bot stays before Total.
Verified: bun test (77 pass); the three new on-demand tests fail on the
old index.mjs (pools not aside, no On-demand window); bun
scripts/check.mjs cursor. Fixture shapes come from cursor-agent's own
protobuf schema (GetCurrentPeriodUsageResponse.SpendLimitUsage,
GetHardLimitResponse); not tried against a real enterprise account.
* cline: preserve ClinePass prompt cache across requests
* cline: limit task ID omission to affected models
* cline: reuse one task ID per chat session
Grok Bot has an allowance of its own, apart from Cursor's monthly usage,
and it shows on cursor.com's dashboard only. auth.usage now also reads
https://cursor.com/api/dashboard/get-sand-usage-status with the sign-in
as the dashboard session (WorkosCursorSessionToken, as Cursor's dashboard
and CodexBar's CursorSandUsage.swift send it), and adds a "Grok Bot"
window: a paid grant with its weekly reset, a live trial as
"Grok Bot (trial)" without one. The window is aside, so Bot running out
never stops Cursor model requests, and it comes before Total so it is
among the Usage card's three rings. No grant, an expired trial, a
non-2xx, a redirect (not followed), a hang past 5 s or a reply that
isn't JSON each leave Cursor's own windows as they were.
Rebased onto main after cursor 0.2.4 (7516d63); package version is 0.2.5.
Optional pins for the 5 s AbortSignal.timeout and the Origin header are
not in this commit (Codex CLI unavailable for the edits); the runtime
guards stay.
Tests: usagePercent 130 is shown as 100 (and -5 as 0), and a 307 to a
login page is refused rather than followed; each fails with its guard
removed from botUsage.
HOME=$(mktemp -d) bun test packages/cursor: 73 pass, 0 fail.
HOME=$(mktemp -d) bun test (whole repo, on this commit atop main
7516d63): 1033 pass, 0 fail. bun scripts/check.mjs: all 15 ok. Checked
by hand once before an earlier squash: a Free Cursor account linked to
SuperGrok showed the Bot ring in magpie. Not tried with a paid Cursor
grant.
The model list offers Grok 4.7 only at its context sizes, grok-4.7@256k
and grok-4.7@500k, while a routing group picked before the list had sizes
still asks for bare grok-4.7, which named() runs at its default size.
usage() built the Cursor Models window's models (and Other Models'
notModels) from the listed ids only, so magpie counted bare grok-4.7 in
Other Models: used up, 0% left on the Routing page, ranked last, while
Cursor Models had ~84% left. The pool now also names each listed id's
bare name; inPool still decides which pool it is in.
magpie 99009b93 makes the same match on its side for every plugin (a bare
id and its id@size count as one); this release covers magpie versions
before it.
Verified: the new usage.test.mjs case fails on 0.2.3's index.mjs ("Grok
4.7" counted false/true) and passes now; packages/cursor 67 pass;
check.mjs green. The whole-repo bun test needs HOME=$(mktemp -d) (CI does
it), not run here that way.
Where a proxy or network blocks HTTP/2, a Cursor Run goes over HTTP/1.1 on api2: RunSSE down, a BidiAppend for each client message up. A failure that says HTTP/2 itself can't be had keeps later Runs on HTTP/1.1 for 10 minutes; a refused connection or a reset stream falls back for that Run only. Reviewed at f5c11b7, merged onto 0437abb: cursor 66 pass, whole repo 1026 pass, check.mjs all 15; each guarded piece broken by hand turns http1.test.mjs red.
After /compact, Claude Code 2.1.280 sends the files it restores and the
session's runtime context as one system text block with no reminder
wrappers and no opening token marker: restored-file notes ("Note: <path> was
read before the last conversation was summarized…"), "Called the Read tool
with the following input: {…}" and its result, "# Environment\nYou have been
invoked in the following environment:", the model line, token and date.
The reporter's bisect shows Factory 403s on each of those fixed fragments,
and 0.1.21 matched none of them: SYSTEM_ENV_CONTEXT is anchored at the
block's start, COMPACT_READ / COMPACT_FILE need a standalone wrapped
reminder, and the token-prefixed bundle path needs a leading token marker.
restoredContext recognizes the complete turn: its first paragraph is a
generated restored-file note or Read call (as COMPACT_FILE / COMPACT_READ
would match it wrapped), and a later paragraph, before any hook output, is
the generated environment paragraph or a token marker. Then
announcedContext adapts every paragraph from the first on, with the
existing compat spellings (Previously read file…, # Runtime context / The
session environment is:, Current model name / Model ID / Model knowledge
cutoff) and the lossless JSON encoding of Read results; everything else
stays byte-for-byte. It runs for system-role strings and text blocks and
for the same block folded into user text. An adapted turn no longer opens
with the generated note, so a second pass is byte-for-byte.
Quoted, incomplete (no environment or token), hook-owned and assistant
forms are left untouched.
Run: bun test (packages/factory: 116 pass; repo: 1010 pass, 0 fail),
bun scripts/check.mjs (all pass). The two new tests use the issue's literal
fragments (several notes, Read call + result, environment, model line with
claude-opus-5-5[1m], token, date); the adapting one fails on 0.1.21's
index.mjs, and removing the env/token requirement, the hook guard, the
user-text path or starting at paragraph 1 each turns a test red. PR #66
applied on top passes too (119 factory tests). Stubbed fetch only; no
request was sent to Factory (no Factory account here).
Yayoi_no_yume on X: a request made right after signing in came back
"Qoder: the sign-in lapsed — sign in again" (401), and only installing and
signing in to Qoder CLI made it work. failure() replaced whatever Qoder said
with that fixed text, so the real reason for the refusal could not be seen.
The message is the same, with "(Qoder said <status>: <its message>)" added
when Qoder gave one; the account is still left unmarked (X-Magpie-Sign-In:
kept), as before.
usage.test.mjs gains the case (a 401 whose body says why); it fails on
0.2.11 and passes. bun test (89 pass) and scripts/check.mjs qoder under a
scratch HOME pass. Not tried against Qoder itself (no Qoder account here),
so the cause of the reporter's 401 is not known yet.
Releases #61 (13e813d), which merged without a version bump: Grok's
Responses backend turned these requests away with 422 unknown item type
"agent_message". Sealed tasks are still sent as they came.
Verified at #61's head merged onto e1efc3d: bun test packages/grok 31 pass,
the whole repo 1007 pass, bun scripts/check.mjs ok. Without the change in
index.mjs, agent-message.test.mjs fails 2 of 4. Sent through
loader().fetch to a local fake of cli-chat-proxy.grok.com: main gives 422,
this version gives 200.
Trae's usage page books a request under the name of the list it was served
through, and its lists name a model differently: chat_v3 calls
deepseek-v4.1-flash "DeepSeek-V4-Flash 正式版", where the SOLO lists call it
"DeepSeek-V4.1-Flash" (yetone/magpie#681). On 2026-10-09 Trae renamed its
official entries — DeepSeek-V4-Flash-Official is "DeepSeek-V4-Flash" now —
which left chat_v3 the only list still calling deepseek-v4.1-flash by
another's name, so the collision the misnamed test leans on no longer
matches and chat_v3's entry won on list order alone: the page then showed
"DeepSeek-V4-Flash 正式版" for every request, where Trae's own client, served
through a SOLO list, shows "DeepSeek-V4.1-Flash".
A model's name is now the one most of its lists give it — the name Trae's
own client is served under — and the entry carrying it is preferred for the
model's window, reply limit and serving function, as is the Max entry asked
for it. deepseek-v4.1-flash goes back to "DeepSeek-V4.1-Flash", a 200K
window and a 32K reply limit (was 116K/16K from chat_v3's entry), asked
through the SOLO list that names its __dev/__max models.
Co-authored-by: 李 <oncwnuKMG1gRkPtw27nJROKWWRUM@git.weixin.qq.com>
Kiro answers a tool name longer than 64 characters "Invalid tool use
format." (REQUEST_BODY_INVALID), and has declined to raise the limit
(kirodotdev/Kiro#7684). Claude Code names a plugin's MCP tools
mcp__plugin_<plugin>_<server>__<tool>, e.g. the Cloudflare plugin's
mcp__plugin_cloudflare_cloudflare-docs__search_cloudflare_documentation
(71), so every turn that offered it failed. The plugin passed t.name
through as it was.
toolName keeps a name of [a-zA-Z0-9_-]{1,64} as it is; any other becomes
its head (other characters as _) plus _ and 12 hex of its sha256, at most
64 characters. It is the same each turn, so the declaration, the history's
toolUses and the tools declared for the history all agree without state.
toolNames maps each such name back from the request's tools and history,
and reply gives the caller's name on tool_use blocks, streamed and not.
Results pair by toolUseId, which is unchanged.
tool-names.test.mjs (the reporter's 71- and 70-character names) fails 3
of 3 without the change and passes; HOME=$(mktemp -d) bun test: 1003
pass, 0 fail across the repo; bun scripts/check.mjs kiro passes. Not
tried against Kiro itself: no Kiro sign-in on this machine.
* trae: one conversation keeps one session_id
The plugin gave every request a fresh `randomUUID()` for both `request_id`
and `session_id` (chatBody), so each request of one agent turn reached Trae
as a different session. Trae counts a conversation by the session its
requests name: a user send that takes several steps (a tool result sent back,
a retry, another function answering) was counted as several conversations,
each a row of its own in the usage detail with no conversation under it —
which is what showed as "Prompt" where the IDE's own sessions show their
title.
`session_id` is now the conversation's, as the IDE keeps one per
conversation: the session magpie (or OpenCode) names the request by, carried
from a new `chat.headers` hook, else the chat's first user message, which
every later turn repeats. Nothing is made up when neither names one — a
made-up conversation of the request's own is the splitting this ends — and
the caller then makes a fresh id per request, as before. The id is salted, so
it says nothing of the words it was made from, and keeps the UUID shape
`randomUUID()` returned. `request_id` stays the request's own.
The title column is not this fix: the IDE's titles are generated by its agent
(`session_title_message`) and reported through its hub, which has no call on
the path this plugin takes. With the session stable, Trae has one
conversation to hang a title on, once it is sent one.
* trae: a conversation is named with the account answering it too
The id a chat's session_id is made of was the conversation alone, so when
magpie failed over, or rotated, between two Trae accounts inside one
conversation, both accounts were sent the same session_id — an id the fresh
random one before it never linked, and one Trae can read one account's
conversation as another's. The account (its uid, else its name) is now part
of what the id is made of: conversationID(req, session, who), who being the
account already resolved just above the request.
The cost, as the comment says: a conversation answered by two accounts is
counted as two again, which is what it did before it was named at all.
Two tests: two accounts of one conversation (named by magpie's session and
by the chat's own first message, and an account named by its name alone) are
two conversations to Trae, and one account's two conversations stay two.
The first fails with the account left out of the id.
---------
Co-authored-by: tearslee <16331052+tearslee@users.noreply.github.com>
Co-authored-by: 李 <oncwnuKMG1gRkPtw27nJROKWWRUM@git.weixin.qq.com>
0.2.0 stopped listing a model's -fast one and takes fast as the request's
service_tier, so magpie, which offered its Fast switch (the agent picker's
lightning, a group member's 标准速度/快速) for a model with a -fast one,
offered it for none. The runtime model now says fast: true when a variant
the account is served at that context size has fast=true (Opus 5.5 @ 300k,
Composer 2.5, Grok 4.7), and nothing otherwise (a size with no fast variant,
a model with no fast parameter, an account the usable list doesn't serve the
fast variants). Requests are unchanged.
Tested: new context.test.mjs case, which fails on 0.2.1 (no model says
fast); the whole package (50 tests) and scripts/check.mjs pass. Not tried
with a real Cursor account.
Tested on the owner's real account (Token Plan Lite, no app membership): mimo-pro, mimo-flash (streamed) and mimo-auto answered 200 through the loader's fetch; usage shows Token Plan Lite with the "Token Plan" window. bun test (990 pass) and scripts/check.mjs under a temp HOME; 3 of the new tests fail on 0.1.8.
An old id names a branch of a model's variants (claude-opus-5 is the Opus 5
without thinking). When the effort asked for exists only in the other branch,
no variant matched and the request went as the default's legacySlug with the
parameters it had been given: cursor/claude-opus-5 at xhigh went as
claude-opus-5-thinking-high with thinking=false, effort=xhigh. On this
account Opus 5 without thinking stops at high, so it happens today: 40 of
5040 old id × effort × fast combinations, all claude-opus-5. 0.1.11 sent
claude-opus-5-high there.
Now, for an old id, a request no variant matches goes as the variant of
its own branch (every parameter but the effort as asked) at the nearest
effort it has (branch()): claude-opus-5 at xhigh or max is claude-opus-5-high,
-fast at xhigh is claude-opus-5-high-fast, as 0.1.11 sent them. Where the
default differs from what is asked in the effort alone, the effort still goes
as asked. A listed id is not changed.
context.test.mjs adds a picker shaped like this account's Opus 5 and checks
those cases and that every id sent agrees with its parameters (which holds
where the default's branch is complete, as in this picker; see Not covered);
it fails on 8cd5a0f's index.mjs. HOME=$(mktemp -d) bun test packages/cursor:
49 pass, 0 fail; check.mjs cursor passes. Offline against this account's
picker and usable list: the contradicting requests go from 40 to 0.
With a real Cursor account, this version installed into magpie (packed from
this code plus one temporary line logging what request() returns):
cursor/claude-opus-5 at reasoning_effort xhigh (max_tokens 16) went as
claude-opus-5-high with thinking=false, context=300k, effort=high,
fast=false, maxMode=false, and answered 200 ("ok", 14 in / 4 out, 5.2s;
magpie's usage log: effort xhigh, status 200). On 0.2.0 the contradicting
request cursor/claude-opus-5-low at xhigh also answered 200, so it failed
silently.
Not covered. branch() steps aside when what is asked differs from the
default variant in the effort alone, so that an effort goes as asked, as
for a listed model (the existing claude-opus-5-5-xhigh test expects
effort=xhigh). So when the branch that stops short is the default's own,
the request still goes as the default's slug with the effort asked: with a
default of m-high (no thinking, low to high) and a thinking branch up to
max, m at xhigh goes as m-high with effort=xhigh. Dropping that early
return fixes it (effort=high) and changes that one assertion; left for the
maintainer to decide. On this account no model's default branch is the
shorter one (of 20 models with two or more branches, only non-default
branches stop short: claude-opus-5's without thinking, and gpt-5.4's fast
one after the usable list).
* cursor 0.2.0: the list is Cursor's picker, a model once for each context size with that window (claude-opus-5-5@300k, @1m), and effort and fast are the request's, sent as the variant's parameters
The usable list (AgentService/GetUsableModels) names a model once for each effort and speed, and the window was read off the name: 1M when it said 1M, else 200K. The names say 1M of models Cursor serves at 300K outside Max Mode ("Claude Opus 5.5 1M"), and nothing of the 300K Sonnet and Haiku or the 256K Grok have, so on this account 110 of 153 names gave a wrong window: Opus too large, Sonnet, Haiku and Grok too small, and the agents compacted at the wrong point. The request carried no context parameter either, so the window Cursor ran at was its own choice, not the one magpie reported. The same id could go to a 300K and a 1M variant.
Now the list is Cursor's model picker alone (AiService/AvailableModels, asked as the CLI asks it: useModelParameters, doNotUseMarkdown), the way pi-cursor-sdk lists Cursor's catalog. A model with a context parameter is offered once for each size, as <model>@<size> named "<name> @ <size>", its window that many tokens; one without is offered once, its window Cursor's contextTokenLimit (Max Mode's for a model served only there), 200K when Cursor gives none. Effort is not a model of its own: the model's efforts (effort / reasoning_effort / reasoning; extra-high is xhigh) are its variants, the request's reasoning_effort is fitted to the nearest and sent as that parameter, and none turns a Claude's thinking off. Fast is not one either: a service_tier of priority or fast sends fast=true, anything else fast=false, so it is paid for only when asked. A request goes as the variant those parameters pick, by the variant's legacySlug (claude-opus-5-5-medium): the agent API refuses the picker's base name with 502 "AI Model Not Found: Model name is not valid". It goes in Max Mode when that variant is Max Mode's (a 1M size; Opus 300K with fast), or, with no variant for the size, when the size is over Cursor's limit outside it; the "Max Mode Required" retry stays. Hidden, Tab-only and chat-only models stay out, as in the CLI.
The ids change (cursor/claude-opus-5-5 is cursor/claude-opus-5-5@300k; the -fast, -low and -thinking models are gone), so 0.2.0: a model picked in magpie or an agent's config has to be picked again. An id the list doesn't have goes to Cursor as it is named, with the default window. poolBase and firstParty take the @size off, so usage pools as before (grok-4.7@256k Cursor Models, claude-opus-5-5@300k Other Models).
context.test.mjs (new) covers the list, the windows, the variants and the request's parameters and mode; maxmode.test.mjs (rewritten) checks what reaches a fake agent API; usage.test.mjs adds the sized ids. HOME=$(mktemp -d) bun test: 45 pass, 0 fail; check.mjs cursor passes. Tried with a real Cursor account: claude-opus-5-5@300k goes as claude-opus-5-5-medium with context=300k and answers, grok-4.6 as cursor-grok-4.6-high, and pi -p --model magpie/cursor/claude-opus-5-5@300k answers; the base name got the 502 above.
* cursor 0.2.0: an id 0.1.x listed still runs as the variant it stood for, and a variant the account hasn't got is neither offered nor asked for (review of #51)
An id the new list doesn't have went to Cursor as it was named. The ids 0.1.11 listed are families of the variants' own ids (claude-opus-5-5, claude-opus-5-5-fast, claude-haiku-5-5-thinking, cursor-grok-4.6), and they are saved in agents' configs, magpie's picks and routing groups: request(raw, "claude-opus-5-5", "high") was {id: "claude-opus-5-5", params: [], maxMode: false}, the bare name the agent API answers 502 "AI Model Not Found" for, with the effort dropped.
Now an id the list doesn't have is read as one of Cursor's own (named): a variant's legacySlug is that variant; a family of them, taken apart as 0.1.x's splitID did, is the family's variant nearest the default, fast for a -fast family, thinking as the family says, at the effort the id names when the request names none; the picker's name for a model, one of its legacySlugs or idAliases, is its default. Each is at the variant's context size, the default's when two sizes share the id. The request's reasoning_effort and service_tier count as for a listed model. The family is tried before the picker's name, so claude-haiku-5-5 stays the Claude without thinking it was in 0.1.11 where Cursor has variants named so; where it has none it is the model's default. Anything else still goes as it is named.
The usable list (AgentService/GetUsableModels) is read again, beside the picker: a variant whose legacySlug isn't in it is dropped, the model's efforts and sizes are the ones its remaining variants have, and a request no remaining variant matches goes as the nearest of them, not as the default's id with parameters the account hasn't got. A model the usable list has nothing of is the picker's alone (GLM-5.3, as 0.1.7 found) and is kept whole; a usable list Cursor can't give leaves the picker as it is.
answerOf's comment says what pick does with no service_tier (fast off). context.test.mjs checks the PICKER_SKIP names stay out (claude-4.5-haiku, claude-haiku-4-5), each id 0.1.11's offered() gives for the fixture's slugs, variant ids and a model's legacy slug, and the usable list's filter; maxmode.test.mjs checks claude-opus-5-5 reaches the fake agent API as claude-opus-5-5-medium. On b33ec2f's index.mjs the three new context tests and that maxmode test fail. HOME=$(mktemp -d) bun test: 48 pass, 0 fail; check.mjs cursor passes. Not tried with a real Cursor account, and not read against cursor-agent's source (neither is on this machine): the old-id rules follow the review's description and 0.1.11's splitID.
Trusted publishing can't create a package, so #39's block-patterns,
merged before its first version was on npm, left every publish run on
main red after it (8 runs, the last 37781353941), and a real refused
publish would have hidden behind it. pr.yml runs bun test and check.mjs
on each pull request, and scripts/new-to-npm.sh names any package npm
doesn't know, so its first version is published by hand and its Trusted
Publisher set before the merge. The README's market section says so.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
After pi compacted a session, every turn on factory/claude-opus-5-5 was 403
"Factory: Forbidden". The reporter's replays through magpie found the
refused part: the sentence pi opens its summary message with,
"The conversation history before this point was compacted into the
following summary:" (pi-coding-agent dist/core/messages.js
COMPACTION_SUMMARY_PREFIX, the same in 1.0.4 and 1.1.0), whole; with it
removed, reworded or halved the request was answered.
A user text that is pi's whole summary message (the sentence, a blank line,
<summary>, and </summary> last) now opens "Earlier conversation context is
summarized below:", the summary itself unchanged. pi's other fixed summary
opening, BRANCH_SUMMARY_PREFIX ("The following is a summary of a branch
that this conversation came back from:"), is reworded the same way; that
Factory refuses it is not confirmed. On Messages (string content and text
blocks), chat completions and Responses user messages alike. The sentence
quoted by a user, without pi's summary around it, or in an assistant turn
goes on as it is.
pi.test.mjs: 3 new tests; the two adaptation tests fail on 0.1.20
(Expected/Received differ on the summary text), the third checks what is
left alone. bun test (114 pass) and bun scripts/check.mjs factory pass.
Not tried against Factory itself (no Factory account here).
0.2.9 (#49) looked for the CLI's cached runtime in ~/.qoder/.bin/umid-<platform>-<arch>-*/ on every platform. qodercli 1.1.66 (npm) and the worker in Qoder desktop 0.4.3 (extractBinary) make that folder only on Windows (umid-win32-<arch>-<hash>\runtime-info.exe with sgsdk.dll); on macOS and Linux they write a file, ~/.qoder/.bin/runtime-info-<platform>-<arch>-<hash>. And the Linux desktop installs to /opt/Qoder/resources/umid/runtime-info (Qoder 0.4.3's .deb and .rpm), which wasn't looked at. So a macOS user with only the CLI, and every Linux user, got HTTP 502 on the international check-in, while Qoder CN (which needs no runtime) checked in.
campaignRuntime now looks at /opt/Qoder on Linux, reads the CLI's cache as the CLI writes it (the newest matching file, a .tmp being written skipped), and follows the CLI's own folder settings (QODER_CONFIG_DIR, QODER_CLI_HOME, QODER_CONFIG_DIR_NAME). Windows and macOS desktop lookup is unchanged.
checkin.test.mjs lays out the CLI cache as qodercli writes it on win32/x64, darwin arm64/x64 and linux x64/arm64, plus /opt/Qoder and the config-folder variables: 6 of the new tests fail on 0.2.9 (the Windows case passes on both, as 0.2.9 had it right), all pass now. bun test packages/qoder (87 pass) and scripts/check.mjs qoder under a temp HOME pass. On this Mac the real lookup returns /Applications/Qoder.app/Contents/Resources/umid/runtime-info. Not run: the runtime itself against a real account, or on Linux/Windows.
SWE-2 names a call after its tool and turn ("Bash:0#a65b6a5e02194b87bbc796c4428c946d"), and the plugin passed that on as the call's id. Claude Code takes a tool_use id only of [A-Za-z0-9_-]: it dropped every such call and the turn failed with "The model's tool call could not be parsed (retry also failed)". Codex and pi take any id and were fine.
An id with any other character, or one that begins "dv_", now goes out as "dv_" and its base64url (stateless, so it holds across restarts and accounts); build() turns it back into Devin's own id on the assistant's call and on the tool result that answers it, so Devin still sees the id it gave. A safe id goes both ways as it came. magpie passes a chat tool_call id through unchanged to Anthropic's tool_use.id, Responses' call_id and Chat, so the one mapping covers all three.
tool-ids.test.mjs builds Devin's reply frame from the reporter's literal id: with the change taken out, both the whole and the streamed test fail (Received: "Bash:0#a65b6a5e02194b87bbc796c4428c946d" against /^[A-Za-z0-9_-]+$/); with it, the id out is safe and the call and its result reach Devin as "Bash:0#a65b…". HOME=$(mktemp -d) bun test packages/devin: 45 pass; the 4 CLI tests in identity.test.mjs time out at 30 s on this Mac with and without the change (a script just written under $TMPDIR doesn't start: exec of a fresh /bin/sh script hangs here), and pass in CI. bun scripts/check.mjs devin passes. Not tried against a real Devin account.
WorkBuddy AI answers 11133 "Invalid request parameters" (the model
provider rejected them) when a tool's parameters or name are of a shape
its model turns away. Tried on the owner's account through magpie:
deepseek-v4.1-flash and -sg refuse each of a pattern's \0, a root anyOf,
parameters with no type, empty parameters, a tuple's items, and a name
holding . : / a space or CJK; Kimi, GPT, Gemini and GLM refuse some;
MiniMax none. Every client protocol reached the same error, so it is the
tools, not the protocol.
fitTools now gives each the shape that passes: an object root (unions
merged as magpie's provider.ObjectRoot does), \0 as \u0000, a tuple's
items as one anyOf, and a safe name, with the model's calls named back in
JSON and streamed answers and the history's calls named as sent. A clean
chat goes as the same bytes.
Run: HOME=$(mktemp -d) bun test packages/workbuddy (54 pass), bun
scripts/check.mjs workbuddy; through a sandbox magpie gateway with this
package, deepseek-v4.1-flash, -sg, glm-5.3, gpt-5.4, gemini-3.5-flash and
kimi-k3 answer 200 to every shape above (400 before), and an Anthropic
Messages call of a tool named fs.read, streamed and not, comes back as
fs.read. wyh's own ZCode/DeepSeek Harness tool set was not seen.
buildKiro already joins consecutive assistant messages, so #1275's request
reaches Kiro with both calls in one assistantResponseMessage and both real
results after; a call that went unanswered is still answered for. The test
keeps it so. Test-only, no version bump; HOME=$(mktemp -d) bun test (30
pass, 0 fail) and bun scripts/check.mjs pass.
An agent can send one turn's tool calls in two assistant messages in a
row, answered together after. build() answered the first message's calls
at the second one: toolu_a went to Devin as "Tool use was interrupted and
did not produce a result." and its real result A! was dropped.
joinSplitCalls now joins an assistant message onto an assistant message
before it that made tool calls, as Anthropic reads consecutive assistant
messages and as magpie's built-in buildDevin does since 7067fce5. A call
of the split turn that really went unanswered is still answered for; two
text-only assistant messages stay two.
split-calls.test.mjs is #1275's request in Chat form: 3 of its 4 tests fail
on 0.1.10 and pass now. HOME=$(mktemp -d) bun test (43 pass, 0 fail) and
bun scripts/check.mjs pass. Not tried against a real Devin account.
An agent can send one turn's tool calls in two assistant messages in a
row, answered together after. conversation() answered the first
message's calls at the second one: toolu_a went to Cursor as "Tool use
was interrupted and did not produce a result." and its real result A!
was dropped. joinSplitCalls now joins an assistant message onto an
assistant message before it that made tool calls, as Anthropic reads
consecutive assistant messages and as magpie's built-in does since
7067fce5, so the calls are pending together. A call of the split turn that
really went unanswered is still answered for; two text-only assistant
messages stay two; the caller's messages are not changed.
split-calls.test.mjs is #1275's request in Chat form: 3 of its 5 tests fail
on 0.1.10 (trace user assistant(toolu_a) tool(toolu_a=interrupted)
assistant(toolu_b) tool(toolu_b=B!)) and pass now. HOME=$(mktemp -d) bun
test (43 pass, 0 fail) and bun scripts/check.mjs pass. Not tried against
a real Cursor account.
objectRoot dropped any anyOf/oneOf branch that was itself a union. Codex
desktop's automation_update (zod 4: root anyOf of view, delete, and create
and update, each a union on kind) folded to only view's mode and id, both
required, so the model was offered a tool that could only view. Found
while fixing the same fold in magpie's built-in for #1271.
A nested union branch is now folded first (up to 8 deep); a field the
root doesn't define takes every distinct schema the branches give it, as
anyOf when they differ; a field every branch requires stays required.
Verified: schema.test.mjs's new test fails on 0.1.9 (no "name" among
[id mode]) and passes now; HOME=$(mktemp -d) bun test in packages/devin:
39 pass, 0 fail.
xiaocui12: Codex on Grok failed every turn with "[invalid_client_tool_schema]
mcp__codex_app__automation_update: tool parameter root must be an object
type (root schema is an anyOf/oneOf union with a non-object branch)".
Codex desktop's codex_app automation_update has an anyOf at its
parameters' root (ChatGPT.app 26.930 builds it with zod 4's toJSONSchema),
and its create and update branches are unions themselves.
rewrite() now folds a function's parameters to an object root as magpie's
built-in provider.ObjectRoot does, nested union branches folded first so
their fields (name, prompt, rrule, kind...) are kept and only "mode" is
required. Before, the plugin sent the union as it came; magpie's grokBody
folded it for requests through magpie, but not for OpenCode's own.
Verified: the real schema (testdata, rebuilt with zod 4.1.8) sent to the
real Grok subscription raw gets 400 with the reporter's exact message;
folded it gets 200 and a correct create call
({"mode":"create","kind":"heartbeat",...,"rrule":"FREQ=MINUTELY;INTERVAL=30"}).
schema.test.mjs: 2 of its 3 tests fail on 0.1.9 and pass now.
HOME=$(mktemp -d) bun test: the rest of the package matches main (login and
refresh tests time out here on main as well; CI runs them on Linux).
Releases #49: international campaign requests carry Qoder's native device
identity (Cosy-MachineToken, Cosy-MachineType) from its own runtime-info
helper, as Qoder.app 0.4.3 does. Without it Qoder answers 200 with only
VIEW_DETAILS.
Verified with a real international account (GET only, no claim):
CLAIM_BENEFIT/CLAIMABLE/100 with the identity, VIEW_DETAILS only without.
bun test packages/qoder: 82 pass; check.mjs qoder passes.