Commit Graph
286 Commits
Author SHA1 Message Date
yetone b015ee515e factory 0.1.29: Claude Code on GLM and other /api/llm/o models goes without the phrases Factory refuses, not "403 Factory: Forbidden" (Echoo on magpie's Discord)
Echoo, with Factory moved onto this plugin, got "API Error: 403 Factory:
Forbidden" from Claude Code on GLM-5.3-Flash, while Codex worked on the
same account and model. GLM is a chat model Factory serves on /api/llm/o,
so magpie translates Claude Code's Messages request into chat completions
(or Responses) before the plugin gets it. Only anthropicBody, the
/api/llm/a route, adapted Claude Code's fixed phrases Factory refuses (its
identity line, "You have been invoked in the following environment", "You
are powered by the model", update-config's "not Claude, so memory", tool
output quoting them). droidBody, for /api/llm/o, only added droid's line,
so all of them went to Factory as they were. The headers, the model and
the account are the same for both agents; Codex's prompt has none of the
phrases.

anthropicBody's per-text adapters are now functions of their own
(claudeIdentity, promptText, systemMessageText, userBlockText), and
droidBody applies them to chat completions and Responses:
- chat's first system message and Responses' instructions as a system
  prompt; other system and developer messages as system messages;
- user text as a user block; a chat user string, where magpie joins a
  turn's blocks with nothing between them, also reminder by reminder;
- chat's tool messages and Responses' function_call_output as tool output.
The Messages route is unchanged: the refactor kept every earlier test
green before the new code went in.

testdata/claude-code-2.1.300-glm-{chat,responses}.json are magpie's
translations of a real Claude Code 2.1.300 request, captured in a sandbox
HOME (paths changed to /Users/me, tools left out).

Run: bun test in packages/factory, 143 pass. With index.mjs at 0.1.28 the
new claude-chat.test.mjs fails 4 of 5 (the Codex one passes on both).
bun scripts/check.mjs factory: ok. Routed the captured request through the
plugin: each refused phrase is 0 in the chat and Responses bodies now, as
on /api/llm/a (1 each with 0.1.28).
Not tried against Factory itself: there is no Factory account to try with.
2026-10-15 12:53:14 +08:00
yetone cbff94eb43 zen-free 0.1.8: the free models Zen lists are offered again when OpenCode's docs or catalog can't be read, and the docs are read from where they moved (yetone/magpie#2305, MiniFullC)
The reporter, on 0.1.7 with the public key, saw only Big Pickle, Space
Bunny Free and Muse Spark 1.3 Free: the three models the plugin knows
offline. Two causes:

- DOCS pointed at packages/web/src/content/docs/zen.mdx, which OpenCode
  removed on 2026-10-12 (anomalyco/opencode#54761, "replace old Zen and Go
  pages with V2 console docs"). It answers 404, so every discovery since
  was partial. The endpoint table now lives in
  services/www/src/docs/content/console/models.mdx; parseProtocolDocs
  reads its rows as they are.
- A listed model the catalog (models.opencode.ai) didn't describe and the
  docs didn't name was left out. When the catalog can't be read, that is
  every listed model but the three in bootstrapProvider, which is the
  reporter's list exactly. bootstrapProtocols is now a snapshot of the
  console docs' free rows (2026-10-15), used under whatever the docs say,
  and bootstrapProvider gains the catalog's metadata for Cat Jam, Step 5
  Preview, LongCat 2.5 Preview, MiMo-V2.6-Flash and Nemotron 3.5
  Lightning Free.

Not changed, on purpose: jev-1.13-free is a SystemOne decision model
(docs: endpoint /v1/systemone, no AI SDK package), which can't answer a
chat, so it stays out as SystemOne models always have. exo-free is
"deprecated" in the catalog and not in Zen's /models list now.

Tests (no network; the fixture server): "listed free models are offered
when the catalog and the docs can't be read" (catalog 503, docs 404,
listing big-pickle, step-5-preview-free, cat-jam-free, jev-1.13-free,
paid -> the three free chat models only) and "reads the console docs'
endpoint table, and Jev stays out as SystemOne" (literal rows from the new
page). Both fail on 0.1.7's models.mjs/provider.mjs (2 fail, 170 pass)
and pass with the change; bun test: 172 pass. bun scripts/check.mjs ok.

Real use (live Zen, public key, this checkout): discovery now lists
big-pickle cat-jam-free longcat-2.5-preview-free mimo-v2.6-flash-free
muse-spark-1.3-contributor-free nemotron-3.5-lightning-free
space-bunny-free step-5-preview-free, not fallen back (0.1.7: the same
eight with the docs 404 marking it partial). A request to cat-jam-free
through the plugin's fetch streamed 200; step-5-preview-free answered
Zen's own 429 "Upstream request failed: Endpoint is unavailable." twice.
The reporter's catalog failure itself wasn't reproduced from here.
2026-10-15 12:08:28 +08:00
yetone 157c7c0f88 devin 0.1.17: a tool whose schema has a list type, an array with no items, or properties or an enum with no type goes to Gemini models in a shape they take, not "There is an issue with this request" (7eleven on Discord)
7eleven, in ZCode on devin/gemini-4-argon, got every turn refused:
"Devin: There is an issue with this request, please try a different
model." (invalid_argument). It is the request content, on Gemini models
only. On a real account, gemini-4-argon, gemini-3-1-pro and
gemini-3-8-flash refuse a request offering a tool whose schema has, at
any depth:
- a list type: ["string","null"], ["string"], ["string","number"];
- type "array" with no items, items true, or items that are a list;
- properties with no type;
- an enum with no type.
claude-sonnet-4-6 and swe-2 take all of them. Nullable written as anyOf,
items {}, nullable:true, const, $ref/$defs, additionalProperties and
format all go through on Gemini.

geminiSchema rewrites them, for a Gemini uid only:
- a list type becomes its one type, nullable when it had "null", or
  anyOf of each type;
- such an array's items become {} (a one-schema list becomes that
  schema);
- a schema with properties gets type object;
- an enum gets its values' type, and an enum of mixed values is dropped.
The caller's schema is not changed. Claude and swe-2 requests are byte
for byte what they were.

What was run:
- HOME=$(mktemp -d) bun test packages/devin: 80 pass.
- gemini-schema.test.mjs, with the gemini line in build() turned off by
  hand: 10 red, one per refused shape.
- bun scripts/check.mjs: ok.
- Real account: each refused schema, sent as built here, went through on
  gemini-4-argon-medium and gemini-3-1-pro-high.
- build() end to end with a search tool holding a list type, an array
  with no items and an untyped enum: gemini-4-argon called the tool, where
  0.1.16 got invalid_argument. claude-sonnet-4-6 called it on both.

Not tried: ZCode itself against the plugin. The reporter's exact tool is
not known; ZCode's own zod 4 tools write anyOf, so it is likely one of
their MCP or plugin tools.
2026-10-15 11:08:07 +08:00
yetone 5d5d86e225 qoder 0.2.16: a tool call written into the text that can't be read, or that the stream ends inside, ends the turn as an error, never as the answer (#132)
A <tool_call> block whose JSON wasn't whole ({"path":}) was reprinted as
text, and one the stream ended inside was flushed as text; either way the
turn finished "stop" with a 200, the call lost and nothing to fail over on.
Mirrors trae since 0.2.5 (#38): a block on its way to being a call (its
content starts with "{" or holds "<function=") that can't be read, or is
cut short at the end, ends the turn as an error: the stream with the error
frame and no finish, a request not streamed (or one with nothing before the
block) a 502. A block whose JSON (or XML function) is whole when the stream
ends without its close is still the call. A tag in a code fence or inline
code, or one that isn't call-shaped (<tool_call>incomplete), stays text.

Siblings: only trae (already fixed) and qoder parse calls out of the text;
grep for tool_call/function=/invoke/DSML across packages/*/index.mjs finds
no other parser.

Run at this head:
- textcall.test.mjs (new, the issue's literal frames: closed with bad JSON,
  stream ends inside, readable control, whole JSON without its close, XML
  form, look-alike text; streamed whole and 3 chars per frame, and not
  streamed): 7 of 9 red on the 0.2.15 code (the control and look-alike
  tests passed there), all green after.
- packages/qoder: 118 pass, 0 fail.
- Whole repo as CI runs it: HOME/TMPDIR in a scratch dir, bun test:
  1320 pass, 0 fail; bun scripts/check.mjs: ok.
Not tried against a real Qoder account; the frames are the reporter's.
2026-10-15 07:10:01 +08:00
yetone 8a28086bf1 opendesign tests: the real fetch is put back after each test, so every package's tests after it pass again (publish red since #84)
bun test runs every package's files in one process. opendesign's tests
set globalThis.fetch directly, and mock.restore() doesn't undo that, so
every file after it (minimax, trae, zcode, zen-free: 148 tests) got
opendesign's stub and failed. The publish run at 3db704a went red at its
test job, so neither dist nor npm ran. #84's review saw these failures
and wrongly put them down to load.

Run: `bun test packages/opendesign packages/minimax packages/zen-free
packages/trae/usage.test.mjs` with HOME in a temp dir: 234 pass, 0 fail.
Without this change: 34 fail.
2026-10-15 06:57:55 +08:00
dbydd 3db704a677 opendesign 0.1.4: Open Design Cloud (Design Plan) as a provider (#84, dbydd)
New package @magpie-community/opencode-opendesign-auth 0.1.4, provider id `opendesign`: an Open Design Cloud account's Design Plan as a magpie provider (dbydd, #84).

Reviewed at this head (37ef688), as in the PR's last review: `HOME=<temp> bun test` for packages/opendesign, 19 pass; `bun scripts/check.mjs opendesign` ✓; the package loads under Node and Bun; `npm pack --dry-run` packs 5 files; a stubbed usage call sent its User-Agent to amr-api.open-design.ai only. The only hosts in it are amr-api.open-design.ai and amr-link.open-design.ai, with no install script, child process, or write outside OpenCode's auth store.

It no longer waits on its first npm publish: the publish workflow packs it onto the dist branch, and magpie 0.1.1243 and later install it from there until npm has it.
2026-10-15 06:44:45 +08:00
yetone da27d87de5 README: magpie 0.1.1243 is the first release that installs from dist 2026-10-15 06:44:09 +08:00
yetone f5308cdb0f publish: every version is packed onto the dist branch, so a new plugin merges without waiting for npm
A new package's first npm version can't go through trusted publishing
(a Trusted Publisher is set on a package that exists, with an owner's
2FA), so reviewed plugin PRs (#84 and others) sat unmerged until an owner
published by hand. Now publish.yml's dist job packs every package's
version (scripts/dist.mjs, npm pack --ignore-scripts) onto the dist
branch: tgz/<file> and index.json with each tarball's sha512. magpie
installs a @magpie-community package from there when npm doesn't have
the version. A new package without NPM_TOKEN is a notice, not a failed
run; a version npm refuses still fails it, now naming the stage-only
default of trusts made since 2026-09-03 and --allow-publish.

Run: node scripts/dist.mjs into an empty folder packed all 22 packages
(index.json 164K); the zed tarball's sha512 equals npm pack's integrity;
a second run packs nothing. The workflow itself is tried on main after
this push (workflow_dispatch).
2026-10-15 04:42:51 +08:00
yetone 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.
2026-10-15 04:15:31 +08:00
nicegui 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
(ca6415f, #130) into the branch at 74578e51e4214b75056746aa81ecc8fcba104ed2;
the only conflict was the _internal export line (both openH2 and usageKey
kept). Diff against main unchanged (168+/34-).
- full `bun test` (isolated HOME/TMPDIR): at 19bbdf8 1267 pass/0 fail; at
  74578e5 (with #130) 1292 pass/0 fail; `bun scripts/check.mjs` ok; PR CI
  green at 74578e5.
- own test: A owes one Run on conv, the next step runs on B whose dashboard
  shows B's own event. On main B's owed(true) returns B's event as A's debt
  and polls B's dashboard; here it returns null with no request, and A later
  collects its own event.
- broke by hand: usageKey back to conversation alone fails the three new
  stepusage tests.
Not tried: real Cursor accounts. A conversation moving accounts leaves the
first account's collected-but-unreported carry under that account (expires
after owedFor) instead of reporting it on the other account's row.
2026-10-15 04:15:03 +08:00
nicegui 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 5fc0a75):
- full `bun test` (isolated HOME/TMPDIR): 1288 pass, 0 fail (main: 1265/0);
  `bun scripts/check.mjs` ok.
- own plugin-level test (fake HTTP/2 session, abort a microtask after the
  200 head, upstream never ends): on main the request hangs, req never
  closed or destroyed; at this head it answers at once, req closed once.
- broke by hand: dropping runOnce's aborted check fails "the plugin: head
  abort ..."; reverting the H1 write callback to an immediate cb() fails
  three openH1 append tests.
- checked: destroying the H1 Duplex with a write in flight emits no
  'error' (bun and node); 410 "the request was cancelled" doesn't match
  magpie's modelRetired words.
Not tried: a real Cursor account or a real proxy (offline fakes only).
2026-10-15 04:13:01 +08:00
yetone 5fc0a75292 zen-free 0.1.7: free models answer again, asked at opencode.ai/inference/v1 with stand-in tools that take a parameter (c9cu on Discord)
c9cu on magpie v0.1.1239: "opencode muse 1.3 又不行了". Every free model
answered 403 FreeTierError "OpenCode's free tier can only be used from
within OpenCode" through 0.1.6 and magpie's built-in alike.

Found against the real upstream on 2026-10-15, with OpenCode 1.19.0's
own requests captured through a local proxy under a sandbox HOME:
- OpenCode now asks https://opencode.ai/inference/v1 (models.dev gives
  it this URL). Its own captured request, replayed word for word, is
  200 there and 403 at /zen/v1.
- Zen also refuses bash or read offered with no parameters, as the
  stand-ins here were ({"properties":{}}); one property is enough.

Now:
- DEFAULT_BASE is the inference API. A request still sent to a model
  listed at /zen/v1 is accepted and asked at the inference API.
- Each stand-in takes OpenCode's own first parameter (bash command,
  read/edit filePath, glob/grep pattern), still "Never call this tool".

Run:
- bun test in packages/zen-free: 170 pass. With 0.1.6's provider.mjs
  put back by hand: 13 fail (the 12 tool-guard tests on the stand-ins'
  parameters, and the new inference-API test).
- bun tools-smoke.mjs against the real Zen: big-pickle,
  mimo-v2.6-flash-free and muse-spark-1.3-contributor-free, streamed and
  not, all 200 with a Bash call.
- npm shows 0.1.1 as latest: publish runs refused this package (no
  Trusted Publisher), so 0.1.2 to 0.1.6 never reached users; 4ef68fb's
  NPM_TOKEN path is what publishes this one.
2026-10-15 02:00:11 +08:00
yetone 4ef68fbf3f publish: an NPM_TOKEN secret publishes what trusted publishing can't, a new package's first version and one with no Trusted Publisher, so nobody publishes by hand
Every publish run on main since 13:27 UTC 10-14 is red: opencode-zed-auth
0.1.7 and opencode-zen-free-auth 0.1.6 answer 404 because their Trusted
Publisher isn't set, and a new package (opendesign-auth, AstraFlow) can't be
created by OIDC at all. Each of those needed an org owner's OTP by hand.

npm tries OIDC first and falls back to the token in .npmrc, so publish.yml
now hands setup-node's NODE_AUTH_TOKEN the repository's NPM_TOKEN secret.
publish.sh publishes a new package when the token is there instead of
passing it by, and its errors say which of the two is missing or that the
token expired. The PR check now notes a new package instead of failing,
since the merge publishes it. README gains a Publishing section with the
one-time token setup.

Run: sh -n on both scripts; scripts/new-to-npm.sh against npm (every
package is on npm); scripts/publish.sh with GITHUB_ACTIONS=true and a fake
npm on PATH (zed-auth "new"): token -> published with the token, exit 0; no
token -> ::error naming it, exit 1; token refused -> ::error saying replace
the token, exit 1.
Not tried: a real publish with a token, since the secret doesn't exist yet.
2026-10-15 01:58:21 +08:00
yetone 9cfc18ae52 grok 0.1.15: a sign-in without Grok Build says GROK_BIN_DIR takes one put in a folder of your own, not only the curl installer (yetone/magpie#2223, evier12345)
In magpie's Docker image there is no curl to run xAI's installer, and a
grok binary dropped on PATH outside a .grok folder isn't taken (isGrokBuild
keeps another program named grok out). GROK_BIN_DIR already took one as it
is; the error now says so, and the README says where the CLI is looked for.

Run: TMPDIR=<scratch> HOME=<scratch home> bun test in packages/grok (41
pass, 0 fail); bun scripts/check.mjs grok (✓). With index.mjs put back to
0.1.14, import.test's "no Grok Build … is refused first" fails on the new
GROK_BIN_DIR assertion. Not tried in a real container from this commit;
magpie's own fix (installing Grok Build before `magpie plugin login grok`)
is in yetone/magpie.
2026-10-15 00:33:49 +08:00
yetone f2f4ff4014 cursor 0.2.12: Grok Bot is among magpie's three panel rings ahead of an On-demand with no limit (yetone/magpie#2213, Morganwan90)
The usage windows went Cursor Models, Other Models, On-demand, Grok Bot,
Total. magpie's tray panel draws an account's first three, so on an
account that may spend on-demand without a limit, the On-demand ring
(always 0%, only a dollar figure) pushed Grok Bot out, while an account
with no on-demand showed Bot third.

An On-demand with no limit (aside) now goes after Bot, beside Total. One
with a limit keeps its third place ahead of Bot: it is the window that
can stop the account's requests, with the pools aside.

Run: bun test in packages/cursor (89 pass), bun scripts/check.mjs (all
packages ok). The new test fails on 0.2.11's index.mjs (Bot fourth,
On-demand third). Not tried with a real Cursor account that has Grok Bot
and on-demand.
2026-10-14 23:22:05 +08:00
yetone e8fdbdb616 cline 0.1.8: a model takes images where Cline's catalog says it does, not "text only" for every model (silent on Discord)
runtimeModel said input.image false for every model, so magpie, which
takes a plugin's said capability over models.dev's, treated ClinePass's
DeepSeek V4.1 Flash and GLM 5.3 Flash as text-only: the image tick stayed
off and images went to a describer model.

/ai/cline/models already carries architecture.input_modalities (Cline's own
client reads images from it). fetchCloudModels now keeps it; a feed model
gets its own entry's, else the entry of the model after its prefix
(cline-pass/deepseek-v4.1-flash is deepseek/deepseek-v4.1-flash; :batch
variants count as the model) when every such entry agrees. Where the
catalog says nothing, image is left unsaid, so magpie asks models.dev
instead of being told no. attachment follows image.

Run: bun test packages/cline (80 pass); the new hook test fails with the
old hardcoded input (79 pass, 1 fail); bun scripts/check.mjs cline passes.
The models hook against Cline's live public catalog (no sign-in) gives
cline-pass/deepseek-v4.1-flash and glm-5.3-flash image true, glm-5.3 and
deepseek-v4-pro false, qwen3.8-max unsaid. Not tried with a signed-in
ClinePass account sending a real image.
2026-10-14 23:10:01 +08:00
yetone 9803210691 trae tests: a stream that breaks off breaks after the caller has its first event, not 30 ms after it was sent (#124)
The test's fake server sent one event, waited 30 ms and errored the body.
The plugin reads its first part before it answers. Under the whole repo's
`bun test` that read sometimes started after the reset, and Bun then drops
the event it had already received. The read threw ECONNRESET out of the
plugin's fetch instead of reaching the mid-stream path the test covers
(1259 pass, 1 fail at a6bed5e). The reset now waits until the caller has
read "half", so the plugin has always read it first. Only the test
changed. index.mjs is untouched, so there's no version bump.

Run at a6bed5e + this change, TMPDIR and HOME set to a scratch dir:
- before the change, repo-root `bun test`: 1259 pass, 1 fail (this test).
  A 200 ms pause put by hand before the plugin's first read failed it
  every time when run alone.
- after: repo-root `bun test` 1259 pass, 0 fail, 1 skip (exit 0);
  packages/trae `bun test` 129 pass; stream.test.mjs alone 3/3;
  `bun scripts/check.mjs` exit 0.
- with the same 200 ms pause in place: passes.
- broke it by hand: index.mjs ending a broken stream with finish "stop"
  and no error turns this test red.
- grep found no other test that resets a body on a timer.

Not tried: CI's Linux runner. CI's publish runs had passed this test so
far (e.g. 38572309548). Their red was the zed and zen-free Trusted
Publisher 404s.
2026-10-14 22:12:50 +08:00
yetone 95af6cf375 factory 0.1.28: the Fast Mode models are listed last, so a provider with nothing picked shows GPT-5.3-Codex, Grok and GLM again (#119, psylch)
magpie shows a provider with no models picked only the first 24 of its
list. 0.1.27 placed each Fast Mode model beside its base model, which
pushed GPT-5.3-Codex, Grok 4.7, Grok 4.6, GLM-5.3 and GLM-5.3-Flash past
24 ("not exposed"). The six Fast Mode models now come after every other
model, so the first 24 are 0.1.26's again. Asking a base model for fast
still reaches its Fast Mode model (fastBody), and a Fast Mode model can
be picked by name.

Run: bun test packages/factory (138 pass), bun scripts/check.mjs (all
plugins pass). The new fast.test.mjs case fails on 0.1.27's order (put
back by hand: 3 pass, 1 fail) and passes with this one.
Not tried: a real Factory account; magpie's exposure was not run against
the published package, only the list order checked.
2026-10-14 22:12:00 +08:00
yetone a6bed5ec54 workbuddy 0.1.22: an MCP server's tool schemas reach Kimi and DeepSeek, not 400 11133 "Invalid request parameters" (#122, clearmann)
Cause: Kimi's tool-schema check (kimi-k3-1, also kimi-k2.7) turns away
schemas that MCP servers and plugins commonly send, with 400 11133
"the request parameters were rejected by the model provider". It is
the request's content, not the account: on the owner's China account
each shape alone in an otherwise plain chat failed every time, and the
same chat with it mended passed. Shapes refused: an enum with no type
(all strings too, under items, anyOf, an unused $defs), an empty enum,
an enum whose type lists two types besides null, true/false where a
schema goes (properties.x, items), a required that isn't a list, and an
unknown type ("any", "String"). Claude Code's own 24 tools have none of
these, which is why tool-less side requests passed for the reporter.

fitShape walks schema positions only (a property named enum or type is a
name) and gives each the shape Kimi takes, meaning the same: an untyped
enum takes its values' type, or [T, "null"]; several types become an
anyOf of typed enums; true is {}, false is {"not": {}};
additionalProperties booleans are left. An empty enum (which nothing
fits) is left out. It runs for every model, as fitTools already does.

WorkBuddy 5.5.6's own CLI (codebuddy.js, read-only) only cleans schemas
for Gemini and only drops temperature for kimi-k3, so it would hit the
same 400 with such an MCP tool.

Ran, real account (China build, plugin loader fetch, old vs new):
- 14 refused shapes on kimi-k3-1: each 400 11133 before, 200 after.
- one MCP-like tool holding all of them: kimi-k3-1 and kimi-k2.7 400
  11133 -> 200; deepseek-v4.1-flash and deepseek-v4-pro 400 11129 ->
  200; glm-5.3 400 11133 -> 200; minimax-m3 and hy3 200 both.
- HOME=$(mktemp -d) bun test in packages/workbuddy: 89 pass; the new
  tests go red (4 fail) with the fitShape call taken out.
- bun scripts/check.mjs: ok.
Not tried: WorkBuddy AI (international) models, and a real MCP server
through Claude Code end to end. glm-5.1 answers 11150 to every chat on
this account (unrelated, also before).
2026-10-14 21:15:24 +08:00
yetone a810ee7e88 zen-free 0.1.6: a free-model request carries exactly the headers OpenCode 1.19.0 sends to Zen, and none of the caller's (xiaoxiaofeixz on magpie's Discord, #100, #108)
Since 10-13 Zen answers 403 FreeTierError ("OpenCode's free tier can only
be used from within OpenCode") to a free-model request that isn't
OpenCode's. npm still serves 0.1.1, which gets that 403 on every model;
0.1.5's OpenCode-form session id (9074723) fixed it but never reached npm.
The owner allows mimicking OpenCode's client on this route (client
mimicry is allowed for every vendor but Claude Code), so this reverses
643ef50's README note.

Diffed against the release binary itself: OpenCode 1.19.0
(anomalyco/opencode v1.19.0) run in a sandbox HOME with the opencode
provider's baseURL pointed at a local capture server, on chat, responses
and messages. It sends accept */*, content-type, user-agent
"opencode/1.19.0 ai-sdk/provider-utils/<v> runtime/bun/1.3.14" (4.0.23
chat, 4.0.40 responses, 4.0.46 messages), x-opencode-project, -session,
-request, -client, -session-id, and the key (authorization, or x-api-key
with anthropic-version). It sends no x-session-id or x-session-affinity
to its own gateway (session/llm/request.ts). 0.1.5 differed in: those two
extra headers, accept text/event-stream, the chat UA on every protocol,
and every header the caller sent going on (through magpie: the agent's
own User-Agent, x-stainless-*, anthropic-beta...).

0.1.6 builds the upstream headers from that list alone: the caller's are
read only for the session and project, anthropic-version/-beta kept on
messages. The new per-protocol test checks the exact set and fails on
0.1.5 (4 fails); the forced-streaming test now expects no
x-session-id/x-session-affinity.

Run:
- bun test in packages/zen-free: 169 pass, 3 runs; bun scripts/check.mjs
  zen-free passes.
- Real opencode.ai, anonymous key "public": npm's 0.1.1 gets 403
  FreeTierError on big-pickle, mimo-v2.6-flash-free and
  muse-spark-1.3-contributor-free, streamed and not. 0.1.6's
  tools-smoke.mjs: 200 with a Bash call on all three streamed and on
  big-pickle not streamed; muse non-streamed 200 without a call;
  mimo non-streamed timed out at 90s, the same on 0.1.5.
- magpie 0.1.1208 in a sandbox HOME (scripts/try.sh zen-free): sign-in
  with public, then `provider test opencode-zen-free`: chat (big-pickle)
  and responses (muse-spark) both pass.
Not tried: a messages-protocol free model (Zen has none free now), Windows.
2026-10-14 18:57:57 +08:00
yetone 98911ae4d4 trae 0.2.13: publish #106 (the call a service left mid-wrapper in a native call's name)
#106 merged as 0.2.12, which main had already published for the cache
fix (4df82ce), so it needs its own version to reach npm. Version bump
only. Ran: bun test in packages/trae, 129 pass.
2026-10-14 18:36:53 +08:00
YuCreateandyu b32b510c9d trae 0.2.12: the call a service left mid-wrapper in a native call's name is read as the call (#106)
trae-cn/glm-5.3 under DSH (2026-10-13): over three turns, 28 of 54 native calls
arrived with the model's call in `function.name` instead of `function.arguments`
— the JSON wrapper the tool prompt asks for, with GLM's own
<arg_key>/<arg_value> tags where Trae's service stopped reading it, and a value
whose close left off:

  {"name":"bash","arguments":{"command</arg_key><arg_value>ls -la</arg_value>
  {"name":"bash","arguments":{"command":"grep -n x a.ts | head -3</arg_value>
  {"name":"bash","arguments":{"command":"grep -n "x" a.ts","description":"…"}}
  bash_abstract_command_0>{"name":"bash","arguments":{"command":"…scan.mjs</description>Re-run scan</arg_value>

Each went out under a name no request declares, so the agent answered "unknown
tool" and the call was lost — twelve steps in a row before the model recovered.
All 28 sit in the context the session compacted at the end of turn 8: turn 9's
input went from ~5k to 94.5k tokens. Whether the compaction is what makes the
service hand a call back this way is not established — only that the two line
up, and that the session's earlier turns on workbuddy-ai/hy4-preview-f and
group/auto-hy4-preview-f sent 270 whole calls and none of this shape. No
workbuddy/glm-5.3 call was routed that day, so nothing is claimed about it.

- A name holding the wrapper is read as the call: the tool, then the fields the
  text between the tags still spells out. The tags are the service's own
  handoff, so what stands between them is the model's text as the model wrote
  it: a quote left unescaped is read as the quote it is, a value the service
  cut at its tag keeps the text it got, a comma inside a value is the model's
  own (`sed -n 1,9p` reads whole), and a closing tag that is a field's own
  (`</description>`) ends the value before it — what follows such a tag is the
  service's text, not the model's.
- A field the tool's schema says is no string is its JSON where the text is
  one, and its text where it isn't.
- The native call's own arguments are kept, and the name's fields are filled in
  beside them: the service moves the arguments it read into the call and leaves
  the rest in the name, so the two halves are one call (command in the name,
  description/workdir in the call).
- A name whose tool the request doesn't have, or one no field can be read from,
  goes on as written, as any other unknown tool does — including one the
  service cut before it wrote a value (at a key, at a colon, at an open quote),
  where an empty call read out of it would be a call the model never wrote.
  Calls already written into a session's history under a mangled name still go
  back on as that name; the plugin reads what it is handed and cannot rewrite
  what was already sent.
- What main already read of a whole name keeps reading the same (`input`,
  `parameters`, arguments given as a string, the flat fields, a wrapper written
  with a space), and a call's own arguments that are not a set of fields — text
  the service cut, a value that isn't a call's fields — go on as they stand, as
  main passed them, for the agent to answer.

The wrapper and the tags are upstream's; the plugin reads what it was handed.
The same shapes are already handled by the DSH-ecosystem relays (trae2api's
_ARG_KEY_VALUE_RE takes a key whose opening <arg_key> was dropped) and by
@ai-sdk-tool/parser's GLM-5 name resolution (a declared name followed by a
structural tag is that tool), which is where the fail-closed reading of an
unknown name comes from.

Run: namecall.test.mjs (16 tests; the real payloads, a name in front of the
wrapper, a field's closing tag cut into a value, a comma inside a value, the
whole-name shapes main reads, the shapes the reader must leave alone, and the
streamed path) — 11 of 16 fail on main's index.mjs, the five that pass being
the ones that pin what main reads.
HOME=<tmp> bun test, 125 pass 0 fail; bun scripts/check.mjs trae green. The 28
payloads this was drawn from were replayed through NativeCalls.take: 28
recovered into calls to tools the request declares, and the 270 calls that
arrived whole in the same session unchanged, byte for byte. Against the same
names and calls main can take (187 pairs) the only differences are the fields
the name's side fills in beside the call's own, and the names main could not
read at all.

Co-authored-by: yu <wowyuarm@users.noreply.github.com>
2026-10-14 18:36:39 +08:00
unship a6f09a0e9a qoder: add PAT (Personal Access Token) sign-in method (#103)
* qoder: add PAT (Personal Access Token) sign-in method

Add a new auth method that exchanges a PAT for a job token via
/api/v1/jobToken/exchange, bypassing the OAuth device flow. PATs are
long-lived (up to 1 year), avoiding the ~3-day re-authentication cycle
of OAuth refresh tokens.

Changes:
- Add patSignIn function for PAT → job token exchange
- Add "Sign in with Qoder PAT" method with password prompt
- Handle PAT accounts in usage (no device token available)
- Add pat.test.mjs with 10 tests covering both sites
- Update vpc.test.mjs for new method count

* qoder: use text prompt type for PAT (magpie has no password type)

magpie's prompt system only supports "text" and "select" types.
Change the PAT prompt from "password" to "text" to match.

* qoder: use password prompt type for PAT input

Now that magpie supports "password" prompt type, use it for PAT input
so the token is masked when typed in both GUI and TUI.

* qoder: address PR review — PAT kept, fields read as Qoder's client does

1. Store the PAT on the credential; when the job refresh lapses
   (SignInGone from refreshJob), re-exchange the PAT instead of
   marking the account signed out. The PAT lasts a year, the refresh
   two days.

2. Read the exchange response as Qoder's client does:
   - token from token, device_token or access_token
   - refresh from refresh_token or refreshToken
   - expiry from expire_time or expires_at (date) first, then
     expires_in in seconds (not milliseconds)

3. Use the openapi() helper for the exchange (no custom User-Agent);
   400/401/403 say "refused the PAT" rather than passing through the
   raw body.

4. Try the usage endpoint with the job token for PAT accounts; fall
   back to the "PAT" plan label if it won't accept it.

5. Exclude the PAT method from Qoder CN: its CLI uses device chat
   directly and never makes a job token, so a PAT exchange may not
   produce one the chat endpoint accepts.

* qoder: fix expires_in unit — milliseconds, not seconds

The real exchange response shows expires_in: 86400000 (24h in ms),
not 86400 (seconds). The expires_at date field takes precedence in
exchangeExpiry, so the fallback was not hit in practice, but correct
it for completeness.

* qoder: drive the renew test through the real refresh path, usage through fetchUsage

The renew test called the PAT sign-in directly, so it never met the
fallback it was named for. It now loads a stored expired credential
whose job refresh is refused, and checks the exchange is asked with the
stored PAT, the request goes on with the new token, and the saved
credential still carries the PAT — and fails when the fallback is
taken out. A second case keeps no PAT on the credential and expects
the sign-in gone to come out.

The PAT branch of usage built fetchUsage's request by hand and turned
every error into a plan of its own; it calls fetchUsage now, its
errors surfacing as the device path's do. A live PAT account answered
the usage endpoint 200 with a qoder envelope on the job token from the
exchange, said so in the comment there.

* qoder: a refused PAT re-exchange ends the sign-in

The renew fallback let a refused PAT through as a plain error, which
magpie read as a server fault and kept the account on. A PAT lapses
like a device sign-in does — expired, or revoked — so renew turns the
exchange's refusal into a lapsed sign-in: usage says "expired" and the
request answers 401, asking for a new PAT. Interactive sign-in keeps
the plain error.
2026-10-14 18:34:37 +08:00
yetone e87ea310c3 zen-free tests: the other 32+ MiB guard tests get the CRLF test's 60 s timeout
"cumulative pending chat tools are limited across choices and calls" and
"chat: completed tool buffers release their cumulative budget" push 33-34
MiB through guardToolResponse and timed out at bun's 5 s default on a
machine at load ~200-280 (5104 ms, 5299 ms, 5525 ms). The CRLF test had
the same cause and already carries { timeout: 60_000 }; its two siblings
that also move 32+ MiB ("single SSE event limit is 32 MiB...", "text
streams larger than 32 MiB...") get it too. The work itself is the
point of the tests (the 32 MiB limit), so it isn't shrunk.

Run: bun test in packages/zen-free 3x at load ~200: 166 pass each time.
Before the change the same file failed at this load. Tests only, no
version bump, nothing published.
2026-10-14 18:28:35 +08:00
yetone 2170a3781e factory 0.1.27: droid's Fast Mode models, and fast asked of their base model goes to them (#119)
psylch on #119 (plugin 0.1.26): claude-opus-5-5-fast answered "Factory:
Not found.", and Opus 5.5 asked with speed "fast" was recorded as
tier_asked fast, tier_served standard, with nothing said.

The plugin now offers droid 0.240.0's Fast Mode models: Opus 5.5/5/4.8
Fast on Anthropic's API, GPT-5.5/5.4/5.3-Codex Fast on Responses, each
at its base model's limits and efforts. They go out as droid 0.240.0
sends them (read from its binary, saved in testdata/droid-0.240.0-fast.txt):
the Fast Mode id itself as the model, with speed "fast" and the
fast-mode-2026-02-01 beta for anthropicFastMode models, at service_tier
"priority" for the GPT ones (their apiRequest Ee). A request asking a base
model for fast (speed "fast" on Messages, service_tier "priority" on
Responses) is sent to its Fast Mode model, as droid's fast toggle
switches to it. A model with no Fast Mode model is sent as asked. Left
out: Opus 4.6/4.7 Fast and GPT-5.4 Mini Fast (base not offered), GPT-5.6
Sol Fast (unreleased:!0), GLM-5.2 Fast (feature flag, a Baseten id).

Run: the full bun test (1222 pass, 0 fail) with a sandbox HOME; the new
fast.test.mjs and the picker test fail on the old index.mjs (4 fail).
Not tried: a real Factory account (none signed in here), so whether
Factory serves the Fast Mode ids at fast speed to a plan, and what its
usage says about speed, is unverified. A non-stream request magpie
translates for a plugin account drops speed before the plugin sees it,
so there only the -fast ids reach fast.
2026-10-14 17:53:22 +08:00
yetone 779e9b2368 kiro 0.1.11: a thinking model offers xhigh as its own level, so Claude Code's xhigh isn't routed as max (#120)
The variants came from BUDGETS (low, medium, high, max), while thinking()
already read xhigh. magpie fits an effort the model doesn't offer to the
nearest it does, so Claude Code's xhigh on a moved Kiro was recorded and
sent as max: 166 of the reporter's requests on 10-14, after the built-in,
which takes xhigh, had served it as xhigh the day before.

BUDGETS now has xhigh at 50k, the budget thinking() and the built-in's
kiroThinkingBudget give it, so what Kiro is asked is unchanged; only the
level magpie records and passes is. Both configModel and runtimeModel
read BUDGETS.

Run: bun test across the repo (TMPDIR+HOME in the scratchpad), all pass;
the new effort.test.mjs fails on the old BUDGETS. Not tried with a real
Kiro account (none signed in on this machine).
2026-10-14 17:28:46 +08:00
yetone 15d16f5ff0 workbuddy 0.1.21: a model free only at night is never said free; a whole-day discount shows the price before it (#121)
WorkBuddy's /v3/config prices a model by its "credits" and by a
modelPromotions list the picker reads for its badges: Hy3 限时免费 (whole
days to 10-31), Step-5-Preview 独家限免 (10-12..10-25), Hy4 preview 夜间免费
(free 23:00–8:00 only), GLM-5.2 and DeepSeek 夜间折扣. The plugin read only
"credits", and magpie keeps a plugin's model list until it next asks, so a
list read at night said Hy4 preview was free all day (#121's screenshot:
免费 in magpie, 0.29x and 夜间免费 in WorkBuddy).

priceOf now reads both. A model under a promotion with daily hours is given
at its full price and never as free (unpriced when the credits read 0 under
a night discount). A running whole-day discount is the price now, with the
credits before it as rateWas, which magpie already shows struck through.

Run:
- bun test across the repo (TMPDIR+HOME in the scratchpad): 1219 pass. The
  new price.test.mjs, built from the promotions copilot.tencent.com gave on
  2026-10-14, fails 3 on the old code.
- The owner's real WorkBuddy and WorkBuddy AI accounts through liveModels
  (17:10 CST): Hy4 preview 0.29, Hy3 and Step-5-Preview free, the rest at
  their credits, matching WorkBuddy's picker.

Not tried: the config as served at night (whether "credits" itself reads
x0.00 then); the unpriced branch covers that case.
2026-10-14 17:16:39 +08:00
yetone 4df82ce1b5 trae 0.2.12: what Trae's token_usage says the prompt cache read and wrote reaches magpie (01huadalang on magpie's Discord: K3, 53 calls, every one 0 cache hits)
tokensOf kept only prompt_tokens, completion_tokens and total_tokens of
Trae's token_usage, so every request reached magpie with no cache count
and Usage/Routing showed 0 hits. Trae's event carries more: TRAE SOLO
CN 3.5.20's ai-agent (libai_agent.dylib, the serde field list of
infrastructure/adapter/llm/event.rs's TokenUsageEvent, read from the
binary's __DATA_CONST) is name, prompt_tokens, completion_tokens,
total_tokens, reasoning_tokens, cache_creation_input_tokens,
cache_read_input_tokens, prompt_tokens_total, completion_tokens_total.

cache_read_input_tokens and cache_creation_input_tokens now go on in the
OpenAI usage under those names; magpie's gateway (chat.go cUsage) reads
them beside prompt_tokens as it reads a relay's in front of Claude, and
judges there whether prompt_tokens counts them too. An OpenAI
prompt_tokens_details.cached_tokens, if Trae sends one, is kept as it
came, and reasoning_tokens goes as completion_tokens_details. No cache
count adds no field.

cache.test.mjs (stream and single answer with the TokenUsageEvent's
fields, OpenAI's details, none) fails 3 of 4 on 0.2.11 and passes;
bun test (113 pass) and bun scripts/check.mjs trae under a temp HOME pass.
Not tried with a real Trae account (none here): that Trae fills the
cache fields for K3 in particular is not known.
2026-10-14 17:05:06 +08:00
yetone cff78b3424 devin 0.1.16: SWE-2 is free, so a used-up day and week don't hold it
太陽と向日葵 on magpie's Discord: SWE-2 costs nothing, but with the
account's quota used up magpie said so and didn't send SWE-2 to the
account, while a test of the model worked.

Devin's GetCliModelConfigs gives each model a model_cost_tier (field 24;
the CLI labels 1-4 "Low cost", "Med cost", "High cost", "Free"). On the
owner's account on 2026-10-14, of 262 configs only swe-2-high, -medium
and -max were 4. The plugin now reads that (parseFree), lists those
models and the entries standing only for them (swe-2) with free: true,
and gives the "1 day" and "7 days" windows notModels with their ids, so
magpie's allowance no longer counts them. ACUs are unchanged. When
Devin's configs can't be read, nothing is marked free and the windows
count every model, as before.

Run: bun test in packages/devin (58 pass) with HOME and TMPDIR in a
scratchpad dir; bun scripts/check.mjs. Broke it by hand: FREE_TIER=5
fails 3 of free.test.mjs's tests; dropping notModels fails the usage
one. Not tried: an account whose quota is really used up (the owner's
had 100% of the day and week left), so that Devin itself serves SWE-2
then is the reporter's word, not checked here.
2026-10-14 17:03:50 +08:00
yetone 95f7b51737 devin 0.1.15: every account's model list is Devin's own for its token, so Gemini 4 Argon is listed on Windows and without the CLI (#115)
On Windows the devin CLI reads %APPDATA%\devin\ whatever folder it is
given (#17), so cliAnswersFor turned it away for every account before
looking at whose sign-in it reads, and an account without the CLI never
asked at all. Both kept the 2026-09-30 SNAPSHOT, which has no Gemini 4
Argon; moving a built-in Devin with it ticked then failed with "the
plugin doesn't serve Gemini 4 Argon" (NieiR).

The list now comes from GetCliModelConfigs, asked with the account's
token (the call the plugin already made for images): its configs carry
each model's label, context (18), output (model_info 13), family uid
(model_info 23) and family label (30.1). Read over Devin's real response
for the owner's account, parseConfigFamilies gives exactly the 52
families and 262 variants `devin models list --format json` prints, in
its order, less Adaptive and Fusion. When Devin can't be asked, the CLI's
list is used if the CLI names the account Devin names the token's, even
when it reads its own folder (the Windows case); else SNAPSHOT, now
refreshed from the CLI (Gemini 4 Argon and Claude Haiku 5.5 added,
Inkling and Claude Sonnet 4.5 kept for the accounts still offered them).

Run:
- TMPDIR/HOME in a scratch dir, bun test packages/devin: 54 pass, 0 fail.
  With index.mjs put back to 0.1.14, the 4 new identity tests fail
  (parseConfigFamilies missing; familiesFor without gemini-4-argon;
  "models list" never run for a same-account CLI reading its own folder;
  provider.models without gemini-4-argon).
- bun scripts/check.mjs devin passes.
- Real account (owner's Devin, sandbox HOME, no devin CLI on PATH):
  provider.models gave 85 models with gemini-4-argon (1048576/1000000)
  and claude-haiku-5-5; 0.1.14 gave the declared list only.
Not tried: the Windows box itself; the new path doesn't run the CLI.
2026-10-14 15:57:04 +08:00
yetone 5c0aebce8f zcode 0.1.18: ZCode app's sign-in reads ZCode 3.15's plan key from config.json, so a valid GLM Coding Plan no longer reads as "no plan" (yetone/magpie#2130)
What changed: ZCode 3.15 keeps no coding plan key in credentials.json any
more. The key it uses is in config.json, at provider["builtin:bigmodel-
coding-plan" / "builtin:zai-coding-plan"].options.apiKey; ZCode 3.15.3's
host reads that value as it is. ownSignIn found no key, so a signed-in
GLM Coding Plan account fell to the Start Plan and read as having no plan.

ownSignIn now falls back to config.json (configKey) when credentials.json
has no key: Z.ai's first, then BigModel. It also takes the provider ids
3.15 normalizes to (account:*-individual-coding-plan) and a value written
encrypted. A value that isn't a key, such as "{env:...}", is skipped. A key
in credentials.json and a team switch still come first. This matches
magpie's built-in (magpie 1d8e83a79, zcodeOwn/zcodeConfigKey).

What was run:
- The new own.test.mjs case uses the reporter's layout (BigModel sign-in,
  no key in credentials.json, key in config.json). It fails without the
  fallback ("j1" in place of "bm.secret").
- Every packages/zcode test file passes under a scratch HOME/TMPDIR:
  dual 25, gift 20, models 1, moved 1, own 6, signin 3, start 10, usage 15.
- bun scripts/check.mjs passes.

Not tried: a real ZCode 3.15 account.
2026-10-14 15:45:44 +08:00
yetone e7d37b0801 factory 0.1.26: Gemini 4 Argon and Gemini 3.x on Factory's Gemini route (yetone/magpie#2080), a 413 retried with older images left out and said as Factory's byte limit (yetone/magpie#2082) 2026-10-14 14:26:29 +08:00
yetone 1bd6d172c1 factory: a 413 is asked once more with older images left out, then said as Factory's byte limit (yetone/magpie#2082)
Ziqi-Cui's Codex session on Opus 5.5 gathered nine screenshots, ~4.5 MB
of data URLs, and Factory answered every request after with 413 "Request
Entity Too Large". The plugin passed the 413 on as it came, which reads
as the context window; it is Factory's limit on a body's bytes.

On a 413 from Factory the plugin now sends the request once more with
every image and file but the newest replaced, in place, by a line saying
it was left out (droid 0.239.0 removes older images/PDFs from large
requests the same way). Anthropic image/document blocks, Responses
input_image/input_file, chat image_url/file and Gemini inlineData/fileData
are found wherever they are, tool results included, so every tool call
keeps its result; a Gemini function response's parts, which take inline
data alone, drop the image instead. One retry, never more; none when
there is nothing older to leave out.

If the 413 stands, or nothing could be left out, the error (Anthropic's
request_too_large, else invalid_request_error) gives Factory's words,
says the limit is on the body's bytes and what was left out, and carries
magpie's gateway 413 hint word for word (compact, or start a new
session), so the gateway, finding it, doesn't add it twice and OpenCode
users get it too. The words avoid what the gateway reads as a context
overflow, so it stays a 413.

The caller's own session and files are untouched: only the body sent to
Factory changes, and only on the retry.

Run: bun test in packages/factory (134 pass), bun scripts/check.mjs.
Broken by hand: without the 413 branch, three of size.test.mjs's four
tests fail. Not tried: a real Factory account (none here) or Factory's
real limit, which neither droid's binary nor its changelog states; the
fake upstream refuses over a chosen size.
2026-10-14 14:26:08 +08:00
yetone 60c905410e factory: Gemini 4 Argon and Gemini 3.x reach Factory's own Gemini route (yetone/magpie#2080)
The plugin offered no Gemini model, so Gemini 4 Argon, new in droid
0.241.1's picker, and the Gemini 3.x models magpie's built-in has were
missing for everyone moved onto the plugin.

- Gemini 4 Argon, Gemini 3.1 Pro, Gemini 3.8/3.7/3.6/3.5 Flash and
  Gemini 3 Flash are offered on @ai-sdk/google at /api/llm/g/v1, with
  droid 0.241.1's names, total context 1M, output 65536, efforts and
  images. Each effort is a thinkingConfig thinkingLevel, as the zed
  plugin sends Gemini's.
- send() takes the Google package's models/<id>:streamGenerateContent
  to Factory's /api/llm/g/v1/generate, as the built-in does (pathOf
  Gemini, FactoryGemini): the model in the body, no stream field, the
  system instruction without a role and opened with droid's line like
  factoryDroidGoogle. x-api-provider is google; the Google package's
  x-goog-api-key is dropped. A rewritten body no longer keeps the
  caller's content-length.
- Gemini counts in standard's windows, not Droid Core's, as the
  built-in's factoryCore has it.
- Gemini 4 Argon is behind a Factory feature flag (featureFlag
  Gemini4Argon, unreleased) in droid 0.241.1; an account it isn't on for
  may be refused it.

testdata/droid-0.241.1-gemini.txt is droid 0.241.1's picker and Gemini
entries, byte for byte from @factory/cli-darwin-arm64@0.241.1 bin/droid
(each line checked present in the binary). muse-spark-1.2, also new in
that picker, is not added here.

Run: bun test in packages/factory (130 pass), bun scripts/check.mjs.
Broken by hand: without the route rewrite the three gemini.test.mjs
tests fail; without google in CORE's exclusion usage.test.mjs fails.
Not tried: a real Factory account (none signed in here), so neither
Factory's answer to these bodies nor Gemini 4 Argon's flag was seen.
2026-10-14 14:25:43 +08:00
yetone a4f81786a7 workbuddy 0.1.20: tool results followed by the user's message reach WorkBuddy AI's gemini-3.8-flash (#113)
WorkBuddy AI's gemini-3.8-flash answers 400 code 11153 "the conversation
must end with a user message" to a chat whose tool results are followed by
a user message. magpie sends exactly that for Claude Code's tool_result
plus reminder text, a user's words typed mid-task, and a tool's images, so
Claude Code on that model failed on its first tool result (wuasakura).

The loader now sends such a chat again with an empty assistant message
between the results and the user's message, and does so up front for a
model that refused it once in this run. Any other refusal, and a chat
ending with the assistant's message (a prefill), passes on as before.

Verified with the owner's real WorkBuddy AI account (direct to
www.workbuddy.ai through the plugin's loader):
- 17 models with tool results then a user message: only gemini-3.8-flash
  refuses (11153); the rest serve it.
- On gemini-3.8-flash: tool->user, tool->user(parts), two tools->user,
  tool->user->user and tool->user(image) are refused before, served after.
  With the empty assistant message the model follows the user's ask ("Red
  PINEAPPLE"); folded into the tool result instead, it ignored the ask, so
  folding was not used.
- Through magpie's gateway (main eb0d5750f, nogui build, sandbox HOME, the
  local package added): a Claude Code-shaped /v1/messages request
  (tool_result + system-reminder text) gave "WorkBuddy AI: the conversation
  must end with a user message" with 0.1.19's index.mjs, and "3 PINEAPPLE"
  with this one.

Tests: HOME=$(mktemp -d) bun test in packages/workbuddy, 80 pass; bun
scripts/check.mjs workbuddy passes. aftertools.test.mjs: with 0.1.19's
index.mjs the retry and up-front tests fail (Expected 200, Received 400);
with the remembering removed, the up-front test fails.

Not tried: WorkBuddy (China), whose model list has no Gemini.
A prefill to gemini-3.8-flash is still refused with the same 11153.
2026-10-14 13:14:32 +08:00
yetone 386a2ba5ad kiro 0.1.10: the caller's prompt-cache marks reach Kiro as cachePoints (#110)
What: buildKiro dropped every cache_control, so Kiro was never asked to
cache a prompt and its tokenUsage reported no cache reads ("kiro cli
cache 率为 0"). Kiro's generateAssistantResponse takes Bedrock's cachePoint
({"type":"default"}) on a userInputMessage, on an assistantResponseMessage
and as an entry of the tools: the CodeWhisperer streaming model's
UserInputMessage.cachePoint, AssistantResponseMessage.cachePoint and
Tool::CachePoint (aws/amazon-q-developer-cli's generated client), and
Kiro CLI 2.27's model list carries supportsPromptCaching and
maximumCacheCheckpointsPerRequest. A message holding a marked block now
gets a cachePoint on the entry it ends up in (merged turns included; a
marked system prompt marks the first message, where the instructions
go), and a marked tool is followed by a cachePoint entry, as kirocc and
AIClient2API send. Four at most, the last kept, as Anthropic allows.
conversationId is left per request: a cachePoint caches the prompt's
prefix, not a conversation.

Run: TMPDIR=<scratch> HOME=<scratch> bun test (1191 pass, 0 fail) and bun
scripts/check.mjs kiro. cache-points.test.mjs's first fixture places the
marks where a captured Claude Code 2.1.296 request had them (two system
blocks and the trailing system-role hook message; texts cut short); the
second is the shape magpie's buildAnthropic hands a plugin for a
translated request. With the two cachePoint lines taken out, 3 of its 4
tests fail. Not tried against a real Kiro account (none signed in here),
so whether Kiro then reports cacheReadInputTokens is not seen yet.
2026-10-14 12:54:44 +08:00
yetone 643ef5018e zen-free: README says the free tier now works only inside OpenCode itself (#100, #108)
Since 10-13 Zen answers free-tier requests from anything but OpenCode
with 403 FreeTierError. OpenCode limits it on purpose, so the plugin
won't get past it: the README now says so and points to an OpenCode Zen
paid key or OpenCode Go instead.

README only. No version bump, so the publish workflow (which runs on
packages/*/package.json) doesn't run, and 0.1.5 stays unpublished. The
code on main is left as it is.
2026-10-14 07:53:51 +08:00
yetone e4023d9912 factory 0.1.25: Haiku 5.5 and Mistral Large 4, in droid 0.240.0's picker, reach Factory through magpie (JL on Discord)
JL (Windows, droid 0.240.0, Factory desktop 0.197.1, magpie 0.1.1226,
plugin 0.1.24): droid and Factory desktop offer claude-haiku-5-5, droid
through magpie didn't, as the plugin's model table didn't have it.

How droid gets its models: its npm package (@factory/cli 0.240.0, the
platform binary @factory/cli-darwin-arm64) bundles the model registry in
bin/droid; the picker lists that registry (order `y`), gated by
availableInCLI, unreleased, feature flags and legacy grouping. Diffing the
registry of 0.233.0 (the release the plugin's table was last matched to)
against 0.240.0 gives three new models: claude-haiku-5-5, mistral-large-4
and gpt-6-astra-ultrafast.

- Haiku 5.5: Anthropic Messages, x-api-provider anthropic, context
  872000 / output 128000 (contextLimits ce, as Sonnet 5.5 and Opus 5.5),
  efforts low..max (droid's "off" is the request without a level).
- Mistral Large 4: generic chat completions, x-api-provider mistral, Droid
  Core (billingPool core), 524288 / 64000, images, effort high.
- GPT-6 Astra Ultra Fast stays out: droid offers it only once the user has
  accepted Factory's high-cost terms (explicitOptInRequirement high_cost).

models.test.mjs is new; its fixture (testdata/droid-0.240.0-models.txt) is
the registry's own bytes: the picker order, the context helper and the three
entries. It checks the two models as droid has them and that every model in
droid's picker is offered or on a named list left out (router, Gemini,
unreleased, opt-in, the older generations the plugin never offered). With
the Haiku 5.5 line removed both tests fail. usage.test.mjs's Core list
gains Mistral Large 4.

Run: bun test in packages/factory (126 pass), bun scripts/check.mjs factory;
a fake Factory saw /api/llm/a/v1/messages with x-api-provider anthropic for
claude-haiku-5-5 and /api/llm/o/v1/chat/completions with mistral for
mistral-large-4. Not tried against Factory itself (no Factory account here);
droid itself was not run.
2026-10-13 23:29:44 +08:00
yetone 65a76769d6 zcode 0.1.17: ZCode app's sign-in follows a ZCode whose data was moved to another folder
What changed: ZCode 3.14 has a 数据存储路径 (data storage path) setting.
Changing it copies ~/.zcode/v2 to <folder>/.zcode/v2 (all but setting.json,
copyDataDirectory's filter) and from the next start ZCode reads
credentials.json and runtime/provider from there. The choice stays in the
home folder's .zcode/v2/setting.json as dataBaseDir
(readBootstrapDataBaseDirFromDisk), and setting.json itself is always read
from the home folder (getSettingsFile: ZCODE_DESKTOP_HOME_DIR, HOME,
USERPROFILE). The plugin read credentials.json and runtime/provider from
~/.zcode/v2 only, so for such a user "ZCode app's sign-in" read the stale
copy left at home (or nothing). It now reads dataBaseDir as magpie's built-in
does (magpie 41972b25f, internal/appdir ZCodeDataIn: trimmed, ignored when
empty, not a string or not absolute) for credentials.json and the
zcode-builtin.json walk, and keeps reading setting.json (the team plan)
from the home folder. The credential key's seed is unchanged: ZCode builds
it from os.homedir(), not the data folder.

Read from ZCode 3.14.3's app.asar (a copy): out/main/index.js (bootstrap),
out/main/chunk-*.js and out/host/chunk-*.js (getDataBaseDir,
getAppConfigDir, copyDataDirectory, getCredentialsFile, the settings file
under the home folder, defaultCredentialSecret).

What was run:
- moved.test.mjs (new): with dataBaseDir set, ownSignIn takes the moved
  folder's key and session over the stale home copy, and a team plan named
  in the home setting.json; "", blank, relative, number and null keep the
  home folder. With zcodeDir put back on homedir() it fails (old key read).
- HOME=$(mktemp -d) bun test at the repo root: 1185 pass, 0 fail.
- bun scripts/check.mjs zcode.
- Not run: a real ZCode with a moved folder, Windows.
2026-10-13 16:33:29 +08:00
yetone c3bcb5cdf3 trae 0.2.11: what GLM leaves before </tool_call> is dropped, not sent as the answer, and a call whose JSON closed early is read whole or not at all (magpie#1945)
XcodeFish (trae-cn/glm-5.3-flash under Codex) saw eight texts of their own
beside real calls: ]</tool_call>, </tool_call>, }</tool_call>,
]}]}}"}}}}</tool_call>, }}</tool_call>, "></tool_call>. And an
exec_command's heredoc reached Codex cut wrong.

- After a call's JSON, braces, brackets, quotes, a > and blanks up to the
  close are taken with the close (held while only those have come).
- A close with no call open is dropped with that leftover before it: when
  nothing but blanks came since the start or the last call (the tail of a
  call Trae's service read itself), or when the leftover is right before
  it. A close a sentence names in passing, or one in backticks, stays.
- A call's object that ends early, with other text after it before the
  close, is a quote inside a string left unescaped: the block is read up
  to the close (quoteFix reads the heredoc whole), and when it can't be,
  the turn fails as unreadable, so the gateway can try again, instead of
  a cut command plus the rest as text.

Not reproduced: the issue's cmd that swallowed ","yield_time_ms":180000}.
No mutation of quotes and backslashes in a JSON or string-encoded call
(624 tried) gives it through this parser; it may have come from Trae's own
tool_calls. Asked the reporter for the raw stream.

Run: tailjunk.test.mjs (6 tests, the issue's tails at piece sizes 0/1/3/7,
a native call with its tail split across events, the heredoc) fails 5 of
6 on the old index.mjs; HOME=<tmpdir home> bun test for the repo, 1184
pass 0 fail; bun scripts/check.mjs green.
2026-10-13 15:45:53 +08:00
geoqiao 4aae1ce7b9 cursor 0.2.11: a step's usage is its own; what it collected of earlier steps is magpie_deferred (#101)
A tool step whose usage event shows after its wait reports 0, and the
conversation's next step collects it. That step used to add it to its own
prompt_tokens, which clients read as context occupancy: pi saw 366940 tokens
(181270 + 185670) on a 300k window and compacted, though 185670 were in use.

Now a step's standard usage fields are its own Run's only. What it collected
of earlier steps goes in usage.magpie_deferred (prompt_tokens,
completion_tokens, cached_tokens, cache_write_tokens), which magpie bills with
the step (yetone/magpie PR) and clients ignore. ledger() also splits collected
events by timestamp: an event stamped from the Run's start on (less 1 s) is
the Run's own; earlier ones and carried counts are deferred. Before, a late
event of an earlier Run could land in a step's own count through gather().

Verified: bun test on packages/cursor, 88 pass (86 before, plus
deferred-usage.test.mjs); bun scripts/check.mjs. With the old index.mjs the
new test fails with Expected 185670, Received 366940. Against real Cursor
(composer-2.5, STEP_WAIT shortened to force late events, 2 rounds) the
deferred totals matched the dashboard's usage events token for token.
The repo-wide bun test has 2 failures in packages/trae that fail the same on
9074723 without this change.
2026-10-13 14:51:26 +08:00
yetone 9074723932 zen-free 0.1.5: a request carries a session id OpenCode itself could have made, so Zen's free tier serves it again (#100, xqvvu)
Zen's chat endpoints now answer the free tier's requests 403 FreeTierError
("can only be used from within OpenCode") unless x-opencode-session looks
like an id OpenCode made. 0.1.4 sent a sha256 cut to the ses_ shape; Zen
decodes the id as OpenCode's identifier.ts lays it out (12 hex of
~(Date.now()*0x1000 + counter), then 14 base62) and turns away one whose
counter is not small.

Bisected against the real upstream by replaying 0.1.4's captured request:
- 0.1.4's ses_e9283da055b15JwOAra76bwUx4: 403. The same request with the
  session of a real OpenCode 1.19.0 run: 200. The real UA alone, or a real
  msg_ request id alone: still 403.
- Any timestamp passes (epoch 0, a year back, an hour ahead); the low 3 hex
  ffe/ffd/ff0 (counter 1/2/15) pass, f00/c00/800/001 get 403; 25 or 27
  characters after ses_ get 403.

Now:
- sessionID makes a real descending id with the current time and counter,
  kept per conversation (sha256 of the signal, at most 1000 kept) so a
  conversation's turns share one session. An id the caller sent through
  that OpenCode could have made is passed on unchanged.
- x-opencode-request is an ascending msg_ id, x-opencode-session-id is
  sent too, and the User-Agent is OpenCode 1.19.0's
  (opencode/1.19.0 ai-sdk/provider-utils/4.0.23 runtime/bun/1.3.14), as
  captured from the real client.

Run: bun test in packages/zen-free, 166 pass. With 0.1.4's hash put back,
the new session tests and the streaming header test go red (3 fail).
tools-smoke.mjs against the real opencode.ai: big-pickle,
mimo-v2.6-flash-free and muse-spark-1.3-contributor-free each 200 with a
Bash call, streamed and not; 0.1.4's provider.mjs in the same run: 403
FreeTierError.

Not done here: magpie maps this 403 to permission_error, which reads as a
sign-in problem; that is magpie's gateway, not this package.
2026-10-13 13:10:07 +08:00
yetone 169e4e607c workbuddy 0.1.19: an enterprise account's card shows its credits, from the enterprise meter WorkBuddy's usage page reads (magpie #1904, CnsMaple)
An enterprise (team) account's /billing/meter/get-user-resource-summary
answers with an empty Packages list, so the card had no window and no
error ("暂无额度数据"). WorkBuddy's own usage page reads
/billing/meter/get-enterprise-user-usage for such an account, which
answers credit / limitNum and the cycle's start and reset (UTC+8).

auth.usage now asks the enterprise meter when the summary gives no
credits, and shows a Credits window of credit used of limitNum, resetting
at cycleResetTime, with span from cycleStartTime; plan "Enterprise" when
the sign-in has none. A personal account's refusal of that meter (400
10001 "uid or enterpriseID is empty", seen on a real WorkBuddy AI account)
leaves the card as the summary said. An account with packages never asks
it.

Run: HOME=$(mktemp -d) bun test (1172 pass), bun scripts/check.mjs.
The new enterprise test uses the reporter's two answers byte for byte;
with the fallback turned off it fails (no window, plan Free). A real
personal WorkBuddy AI account's usage read through this index.mjs is
unchanged (same window, no enterprise request). Not tried with a real
enterprise account: none here.
2026-10-13 11:39:45 +08:00
yetone 7b09c423c8 trae 0.2.10: the sign-in page offers the enterprise (SaaS) sign-in (@shad70w0 on X)
@shad70w0 on X: "magpie + Trae 插件实测没办法走企业订阅" - a Trae enterprise
subscription couldn't be used through this plugin. The sign-in URL sent
hide_saas_login=true (copied from the relays in 6c048c7), which hides the
enterprise/SSO sign-in on www.trae.cn/authorization and
www.trae.ai/authorization, so an enterprise user could only sign in as a
personal account.

What changed:
- the authorization URL sends hide_saas_login=false.
- traeHost: a host a sign-in names is taken only when it is a well-formed
  https host (no port, credentials, query) on trae.cn, trae.ai or
  mchost.guru; anything else is ignored and the consumer host used, as
  before.
- Trae CN: a sign-in host on mchost.guru / trae-api-*, or another trae.cn
  host than www/api/grow*, is the account's model host. Trae Global: a
  trae.ai host other than www/api-*/grow* is too, after the existing
  US/coresg rules. Personal hosts (api.trae.cn, api-us-east, api-sg-central,
  growsg-normal, coresg-normal) route as before.
- the sign-in's host (host), a token host the callback names (authHost /
  auth_host / userInfo.AuthHost, on the realm's own domain only) and the
  userInfo's tenant/enterprise/login-type fields (account; no field that
  looks like a secret) are kept in the auth record. Renewal (sign-in and
  refresh) goes to authHost when one is kept. Nothing new is sent.
- README: enterprise sign-in is offered, not tried with a real enterprise
  account.

Run: bun test in packages/trae (103 pass, 6 new in enterprise.test.mjs);
the whole repo's bun test with HOME under a scratch TMPDIR (1168 pass, 0
fail); bun scripts/check.mjs. Each change broken by hand turns
enterprise.test.mjs red: hide_saas_login back to true, no enterprise CN
host, no domain check, http allowed, refresh at the consumer host, no
account kept, api.trae.cn taken as a model host, a secret-looking field kept.

Not tried: no real enterprise account. Which host(s) and fields an
enterprise sign-in sends back is unknown; the hosts in the tests are made
up, and whether the callback ever names an auth host is a guess.
2026-10-13 11:13:49 +08:00
yetone f98026557e grok 0.1.14: a window offered without a k (grok-4.7@131072) asks Grok for that model at that window (yetone/magpie#1679)
labelOf writes a window no multiple of 1000 as its digits alone, so
windowsOf offers grok-4.7@131072 beside grok-4.7@500k. modelOf read only
"<n>k", so that id went to Grok as an x-grok-model-override of its own
("grok-4.7@131072", a model Grok doesn't list) with no
x-grok-context-window. It now reads the digits as the window itself, and
a k as thousands, as the built-in's grokWindowed does after
yetone/magpie#1679 (ggbdpq's patch). An id with no model before the @,
or a window of 0, is no window, as the built-in reads it.

Not tried against Grok: today every window xAI lists is a multiple of
1000, so no real model is offered without the k.

Run: TMPDIR and HOME set to an empty scratch dir, bun test
packages/grok: 41 pass, 0 fail. The new test FAILs with modelOf put
back (expected { model: "grok-4.7", window: 131072 }, got the id as a
model with window 0). node --check packages/grok/index.mjs, bun
scripts/check.mjs grok and git diff --check are clean.
2026-10-13 09:53:12 +08:00
86b4760f55 factory 0.1.24: a session continued after Claude Code compaction reaches Factory (#66)
* factory 0.1.23: a resumed turn's restored skills reach Factory wherever they sit

#68 took 0.1.22, so this moves to 0.1.23.

Claude Code 2.1.292 session 1a2063e5 is the turn Factory answered 403.
Its transcript renders the post-compaction attachments, in order, as system
reminders: a token marker, a restored Read and its result, an omitted-file
note, the invoked-skills reminder, the agent-type list, MCP server
instructions, the environment paragraph and the model line. No token marker
follows the skills reminder. The snapshot's contextRendering is "announced",
so the same paragraphs also travel unwrapped in one system turn. The request
bytes were not in the routing log; the fixture is those rendered paragraphs,
unwrapped, in that order.

announcedContext used to reassemble the reminder only when a token marker
came right after it, and then treated everything up to that marker as skill
text. A reminder at the end of the turn, or followed by a Read, the
environment or a hook, kept the refused opening. A reminder with other
attachments and a later token swallowed those attachments into the skill
encoding.

The refused part is the fixed opening plus the complete IMPORTANT paragraph.
That complete reminder is rephrased wherever it sits. Skill text now ends at
the next paragraph the adapter already knows (token marker, hook, restored
Read, omitted-file note, Read result, environment, model line, skill-list
header, changed-file note, agent-type list, MCP instructions) or at the end
of the turn. Those following paragraphs stay themselves and are adapted on
their own. A second pass is byte-for-byte. Quoted fragments, an incomplete
IMPORTANT paragraph, a hook that owns the reminder and assistant content stay
untouched.

0.1.22 was not tried against Factory: the installed copy stayed 0.1.21, and
this change was not sent to Factory either.

Run: HOME set to an empty temp dir, bun test packages/factory: 120 pass,
0 fail. node --check packages/factory/index.mjs, bun scripts/check.mjs
factory, and git diff --check are clean. The new test covers the captured
order plus a reminder at the end of the turn, a reminder followed by Read,
environment and a hook, and a quoted skill body. Fetch is stubbed.

* factory 0.1.23: restored skills open a resumed turn without token metadata

A resumed turn can start with the complete invoked-skills reminder when no
files were restored and totalTokensReminder is off. restoredContext now
recognizes its exact opening and IMPORTANT paragraph through the existing
invokedSkillsMatch and attachment boundaries. A restored-file opening can
also use the complete skills reminder as evidence when it ends the turn.
Adapted openings, incomplete reminders, quotations and hook-owned output
retain their existing behavior.

Cover no-token system turns and folded user text on inference and token
counting, including standalone reminders, trailing tokens, omitted-file and
Read prefixes, exact skill decoding, cache metadata and byte-for-byte second
passes. Each of the six boundaries missing independent regression coverage
now follows a quoted skill directly. README documents the no-token forms.

Run with HOME set to an empty temporary directory: bun test packages/factory,
121 pass, 0 fail. node --check packages/factory/index.mjs,
bun scripts/check.mjs factory and git diff --check pass.
Removing each of the omitted-note, Read-result, model, skill-list, MCP and
changed-file boundaries makes the new independent regression test fail.
The whole-project test suite is left to CI. Fetch is stubbed; no request was
sent to a real Factory account.

* factory 0.1.24: main already published 0.1.23 (#71), so this change takes the next version

#71 shipped factory 0.1.23 while this PR waited, so npm has 0.1.23. This
only moves the version, so the squash publishes as 0.1.24.

Run: merged onto main a885a16, HOME=<scratch> bun test packages/factory:
124 pass, 0 fail; bun scripts/check.mjs: all pass.

---------

Co-authored-by: chenguoqing <chenguoqing@kemai.cn>
Co-authored-by: yetone <yetoneful@gmail.com>
2026-10-13 09:05:49 +08:00
yetone a885a16190 cursor 0.2.10: a Team member with no limit of their own spends the team's on-demand pool, which is shown and counted as the limit, not as unlimited (yetone/magpie#1868)
PaSSw0rds' Team account has on-demand turned on for the whole
organization: spendLimitUsage has no individualLimit, pooledLimit
"45120000" and pooledRemaining "38785730" are int64 strings, pooledUsed
6334270 a number, and GetHardLimit answers {"hardLimit": 451200} with or
without a team id. onDemandOf read that as "unlimited", as cursor-agent's
own usage view does, so the On-demand row showed only the member's own
$198.55 at 0%, and a spent team pool never counted the account used up.

Now a team member with no individualLimit and a pooledLimit > 0 gets a
fixed On-demand window on the pool: used = pooledUsed / pooledLimit,
display "$63,342.70 / $451,200.00 (you: $198.55)", not aside, so magpie
stops routing to it when the pool is spent. A hard limit that forbids
on-demand still reads as disabled; a team with no pool and a hard limit
still reads as unlimited. Dollar figures group thousands.

Run: bun test in packages/cursor (86 pass), bun scripts/check.mjs (exit 0).
The new test, built from the payloads quoted in yetone/magpie#1476, fails
on the old index.mjs (On-demand "$198.55", used 0, aside) and on a fix
that shows the member's spend against the pool instead of the pool's own.
Not tried against a real Team account.
2026-10-13 06:00:37 +08:00
yetone 9814cca34d workbuddy 0.1.18: a desktop sign-in WorkBuddy 5.6+ keeps encrypted says so and points to the browser sign-in, not "isn't signed in" (#18)
seavenlin on #18: on WorkBuddy desktop 5.8.1 the tokens in
workbuddy-desktop[-ai].info are sealed ({$wbEncrypted: 1, envelope}), so
the desktop sign-in failed as "isn't signed in" while the app was signed
in, and one made before the app sealed it fell back to the built-in list
and its chats failed.

The sealed tokens are not opened (only the app opens them; #18's way of
running the app's binary to take its key is declined). Sign-in, usage and
chats now say the app keeps its sign-in encrypted and to use the browser
sign-in. The app's file is still only read.

Run: the new test fails on the old index.mjs and passes here; HOME=$(mktemp
-d) bun test for the repo, 1155 pass 0 fail; bun scripts/check.mjs green.
Not tried with a real WorkBuddy 5.8.1 install; the file shape is the one
in #18 and seavenlin's comment.
2026-10-13 04:46:47 +08:00
yetone 6579c01711 cursor 0.2.9: when the default's own branch stops short, an id of it asked past that goes as its nearest, not the default's id at the effort asked (#55)
With the default on the branch without thinking (thinking=false, low to
high) and xhigh only with thinking, claude-opus-5-low asked at xhigh went
as the default's slug with effort=xhigh: an id and parameters at odds.
branch() returned early whenever what was asked differed from the default
in the effort alone.

Decided: that early return now holds only when no variant at all is named
for the effort asked, so claude-opus-5-5-xhigh (no xhigh variant
anywhere) still goes at xhigh as a listed model does, and an effort
another branch has makes the default's branch go to its nearest.

Run: the new test (the issue's picker, plus every id x effort x fast
agreeing with its parameters) fails on the old index.mjs and passes here;
HOME=$(mktemp -d) bun test for the repo, 1154 pass 0 fail; bun
scripts/check.mjs green. Not seen on a real account (as the issue says).
2026-10-13 04:45:03 +08:00
yetone 0e2a52efdc trae 0.2.9: <toolcall> without the underscore is read as <tool_call>, and a reply that ends inside an opener is cut short, not the answer (#38)
XcodeFish's two leaks on 0.2.6, still on 0.2.8: glm-5.3-flash wrote
<toolcall></toolcall>, and a reply ended at "<tool_call name". Both went
out as the answer with a 200.

- The opener, close, leftovers and held marks take <toolcall> and
  </toolcall> too; an empty block is dropped as <tool_call></tool_call>
  is, one with JSON or parameters is a call, one that can't be read is
  the error it is for <tool_call>.
- At the end of a reply, an opener still open (<tool_call, <tool_call
  name) outside backticks or a fence ends the turn with the cut-short
  error.

Run: the issue's repro (A-G) on main and on this; the new test fails on
the old index.mjs (1 fail) and passes here; HOME=$(mktemp -d) bun test
for the repo, 1153 pass 0 fail; bun scripts/check.mjs green.
2026-10-13 04:40:26 +08:00