Commit Graph
376 Commits
Author SHA1 Message Date
yetone 4564e890b2 factory 0.1.36: a content_policy_rejected 403 says Factory's check reads the whole conversation, and isn't sent again
doubl4door (Discord, factory 0.1.34): Claude Code on Factory's Opus got
403 "This request was blocked by Factory's usage policy check" (code
content_policy_rejected), and the plugin's hint pointed at the org's model
policy and plan. droid 0.245.0 tells this refusal apart by that code, only
when Factory sent no x-factory-upstream-error header, and says the check
covers the whole conversation. contentRefused does the same: explain()
says to start a new session or remove the quoted text, and mendOrg's
whoami-and-resend is skipped, since the same conversation is refused
again under any org. Other 403s are handled as before.

Run (sandbox HOME):
- HOME=$(mktemp -d) bun test packages/factory: 171 pass, 0 fail
- bun scripts/check.mjs factory: ok; git diff --check clean
- Broken by hand: without the mendOrg skip 2 of content-policy's 4 tests
  fail; without explain's branch 3 fail.
Not tried against Factory's server (no Factory account here); the body
shapes tested are code at the top level and under error.
2026-10-20 17:51:10 +08:00
Houpus 97aea1739a factory 0.1.35: escape client phrases Factory's proxy gate refuses, in every body (#258, RoacherM)
Factory's proxy gate refuses a request whose body carries certain client
phrases (pi's opening and compaction sentence anywhere; Claude Code's
identity, env line, billing header, compaction opening and
GLOBAL_INSTRUCTIONS inside tool output). The phrases now live in
client-phrases.json; sanitizeBody escapes each phrase's first character as
\uXXXX in every request body (only re-stringified when something changed),
and the Gemini path escapes them too. Version 0.1.35.

Run at the reviewed head f0e78b4 (sandbox HOME):
- HOME=$(mktemp -d) bun test packages/factory: 167 pass, 0 fail
- bun scripts/check.mjs factory: ok; git diff --check clean
- npm pack lists client-phrases.json
- Broken by hand: without sanitizeBody 5 new tests fail; without the
  Gemini escapeDeep 1 fails.
Not tried against Factory's server (no Factory account here); the author's
real-account A/B is in the PR.
2026-10-20 17:08:37 +08:00
yetone 57fc069410 autoclaw 0.2.3: usage-path signing remembers each sign-in, not the provider (#254)
With signinOnUsage on, maybeSignin remembered a day's success under the
provider id, so after the first AutoClaw account signed in, every other
account of that provider was skipped until the next day. #254's reporter
has four sign-ins under two default display names and saw exactly one
extra account signed this way. The key is now the sign-in's uid, or a
hash of its refresh token for an old account that has none, for both the
refresh and the usage path.

magpie's own daily check-in (the native checkin hook) skipping same-name
accounts is the main part of #254 and is fixed in magpie itself.

Run:
- bun test packages/autoclaw: 26 pass, 0 fail. The new test drives usage()
  for four accounts sharing one display name (two with uid, two without);
  on the old index.mjs it fails at the second account ("今日未签(+400)").
- HOME=$(mktemp -d) bun test (whole repo): 1865 pass, 1 fail + errors in
  packages/devin's CLI tests (30s timeouts) and a trae stream connection
  reset, at load average ~168; neither package is touched here. Rerun of
  devin+trae alone: 252 pass, 1 devin timeout.
- bun scripts/check.mjs: all packages ok.
2026-10-20 16:26:17 +08:00
yetone bb688ea81a qoder: test that auth.checkin claims on a PAT account's job token (#262)
#262's check-in tests went through the loader's campaigns fetch; the daily
check-in magpie presses is auth.checkin, whose PAT change nothing covered.
One test claims on qoder and qoder-cn with a PAT account (job token, no
deviceToken refresh); one checks a 403 is "failed", not rotated.

Run on 0a8e5ab + this: bun test packages/qoder 157 pass, 0 fail; bun
scripts/check.mjs passes. With the checkin hook's PAT lines reverted by
hand both new tests fail. Test only, no version bump.
2026-10-20 16:15:34 +08:00
hspnick 0a8e5abd00 qoder 0.2.21: Qoder CN PAT sign-in, and a PAT account checks in on its job token (#262, sphuang1030-prog)
Qoder CN offers the PAT sign-in too (its /api/v1/jobToken/exchange takes a
personal_token as qoder.com's does; the prompt names qoder.cn's console),
and a PAT account, which has no device token, signs the campaigns pages and
the daily check-in with its job token instead of rotating a device token it
doesn't have. The account keeps the name its browser sign-in takes
(email || uid), so a renewed PAT sign-in replaces its lapsed row.

Run at d7db9f2b987c46cbf100cda9d89a8a546e374fb6:
- bun test packages/qoder: 155 pass, 0 fail; bun scripts/check.mjs passes.
- The PR's check-in tests go through the loader's campaigns fetch, not
  auth.checkin. Two local tests calling auth.checkin with a PAT account
  (qoder and qoder-cn: claimed on the job token, no deviceToken refresh;
  a 403 is "failed", not rotated) pass on this head and both fail with the
  checkin hook's change reverted by hand. They follow on main.
- Probe: POST openapi.qoder.com.cn/api/v1/jobToken/exchange with an
  invalid pt- token answers 400 BadRequest, as openapi.qoder.sh does (an
  unknown path answers 401), so the endpoint exists on CN and a bad PAT
  maps to "refused the PAT". qoder.cn/account/integrations redirects to
  sign-in, as qoder.com's does.
- Not tried: a live qoder.cn PAT exchange, chat or claim; that rests on
  the author's live run.
2026-10-20 16:15:12 +08:00
yetone c7186858da zen-free 0.1.13: a later null or empty tool-call id keeps the id already streamed (#188, zhengguangzhuo)
Releases ec884d0 (#259). Only the version changes here.

Run on origin/main 915f143 plus this bump: bun scripts/check.mjs passed;
packages/zen-free bun test (temp HOME): 195 pass, 0 fail. #188's literal
repro script (node) prints call_0/call_1 for both null and "" and exits 0.
2026-10-20 16:14:01 +08:00
Euraxluo 915f14324e qoder 0.2.20: keep unnamed native tool deltas out of history (#256, Euraxluo)
A Qoder reply's native tool-call deltas no longer become a tool with an empty name. An empty or null placeholder is skipped; an id or arguments that arrive before the name are held until it comes; each upstream index keeps its own output index, so interleaved parallel calls get their own arguments (streamed and non-streamed). A native call that ends without a name ends the turn as a 502 instead of being sent on, since clients persist the empty name and Responses providers then reject the history. Qoder and Qoder CN share this parser.

Run at the reviewed head 9c755fd62cfd11cb80a9d960862aad25c32fb97d:
- bun test packages/qoder: 150 pass, 0 fail
- bun scripts/check.mjs qoder: ok
- native-tools.test.mjs on origin/main 5b68df0 (old parser): 0 pass, 11 fail
- PR CI (test, on-npm): green
Not tried against a live Qoder account; the frames are synthetic.
2026-10-20 15:56:06 +08:00
zhengguangzhuo ec884d09dc zen-free: a later null or empty tool-call id keeps the id already streamed (#188, #259)
When a Chat Completions stream sends a call's id first and then id: null or
id: "" in a later delta for the same index, the buffered call kept the later
value, so the client got null/"" ids and a later request failed with
"Duplicate value for 'tool_call_id'" (#188). A later null or empty id now
keeps the id already buffered; an id that first arrives in a later delta is
still taken.

Run at the reviewed head 8f19ba1e6bf09f105a47e4fb2f7233de22a99b06 (base 5b68df0, main):
- packages/zen-free: bun test (bun 1.4.2, temp HOME): 195 pass, 0 fail.
- bun scripts/check.mjs: passes.
- #188's literal repro script (node 22.22.0): prints call_0/call_1 for both
  null and "" and exits 0; on main's tool-response.mjs it prints [null,null]
  and ["",""] and fails its assert.
- The PR's new test with main's tool-response.mjs: red (null, '' instead of
  call_0, call_1); green with the fix.
2026-10-20 15:56:03 +08:00
狗带带子 edd9e30c81 autoclaw: rewrite Claude Agent SDK identity lines, explain CN 406 (#253, isdoge)
Claude Code 2.1.30x opens its system prompt with "You are a Claude agent, built on Anthropic's Claude Agent SDK.". AutoClaw's gateways answer 406 to "Claude Agent SDK" anywhere in a system prompt. The author confirmed it on both CN (managed) and overseas (autoglm-api.autoglm.ai). FLAGGED now rewrites the identity line to "You are a coding assistant.", and any other mention, along with the "the " or "Anthropic's " before it, to "the agent framework". Only system and developer messages are rewritten. User, tool and assistant text, and identifiers like @anthropic-ai/claude-agent-sdk, ClaudeAgentSDK and claude_agent_sdk, are left as they are. The CN path's refusals other than 401/403 now go through explained(), so a 406 there carries REFUSED_HINT, which now lists Claude Agent SDK.

Run at the reviewed head a9bd38b1451b745d91019bf168e72f7d3c724779:
- bun test packages/autoclaw: 25 pass.
- index.mjs reverted to main: both new tests fail. index.mjs at 4ca51de: the exact-output test fails (it catches the "assistant.." double period). Restored: green.
- Probe of unflagged()/unflag() on the identity line, "running on" and "the" variants, upper and lower case, code identifiers, and every message role: output as described above.
- Full bun test in a temp HOME under $TMPDIR: 1855 pass, 0 fail. bun scripts/check.mjs: ok.
2026-10-20 15:53:01 +08:00
yetone 5b68df0057 zen-free 0.1.12: a null name or arguments in a streamed function delta adds nothing, instead of failing the turn (#252, ChuHanModel)
Releases 2ef6d6b (#252). Only the version changes here.

Run on 2ef6d6b plus this bump: bun scripts/check.mjs passed;
node --test packages/zen-free/ all pass. The PR's head was run in full
before the merge (HOME=$(mktemp -d) bun test: 1853 pass, 0 fail).
2026-10-20 03:54:57 +08:00
初寒 2ef6d6b62b zen-free: a null name or arguments in a streamed function delta adds nothing, instead of failing the turn (#252, ChuHanModel)
A Chat Completions stream whose tool_calls or function_call delta carries
`"name": null` or `"arguments": null` (some OpenAI-compatible vendors send
these) failed the whole turn with "Invalid upstream function delta".
appendFunction now treats a null/undefined name or arguments as no new
bytes and keeps the fragments already buffered. Other non-string types
still fail. The name is still checked on the whole concatenated value when
the choice finishes, so a call whose name stays null is still left out with
its note; skipping null can't let a call past the policy.

Siblings: no other package vendors tool-response.mjs (grep for "Invalid
upstream function delta" finds only zen-free); zed's tool-call merge
already appends only truthy arguments.

Run at the reviewed head 48a266070ed1ad3e63fa864e438af8163110f5f6:
- Fix removed by hand: 4 new tests red (tool_calls / function_call
  "ignores null fields..." and "still drops calls whose name remains null",
  failing on `!values.some(value => value.error)`), 104 pass. Restored:
  node --test packages/zen-free/tool-response.test.mjs 108 pass, 0 fail.
- HOME=$(mktemp -d) bun test: 1853 pass, 0 fail across 168 files.
- bun scripts/check.mjs: passed.

Version bump to zen-free 0.1.12 follows in its own commit.
2026-10-20 03:51:50 +08:00
yetone d34f78b69a raccoon 0.1.2: usage reads the whole bill history, not the newest 200 rows (plugins #223)
The bills endpoint ignores paging.offset and always reports total 0, so
it can only be asked for the newest N rows. 200 rows covered under a day
of an active account and left out the large grants a balance is made
of, so the usage card's limit was far too small. queryUsage now asks
for 1000 rows, then 5000 if the first page came back full.

Run: bun test packages/raccoon (30 pass); the new test fails on the old
index.mjs (1 fail); bun scripts/check.mjs raccoon ok; full bun test
1833 pass, 0 fail. Not tried against a real Raccoon account.
2026-10-19 20:46:11 +08:00
Euraxluo 3edbb18510 qoder 0.2.19: a model list that can't be read is a 502, so magpie falls back (#249)
A failed read of Qoder's model list during a chat (DNS, timeout, an HTTP
refusal) now answers 502 instead of 400, so magpie retries and falls back to
the next member of a group instead of ending the request. A lapsed sign-in
met on that read answers 401 with the sign-in mark, as the chat path does.

Run at the reviewed head fcdf173e1 (on origin/main ff13aac):
- bun test packages/qoder: 139 pass, 0 fail
- bun scripts/check.mjs qoder: ok
- with index.mjs put back to main, the two changed tests go red (2 fail)
- magpie's passing() retries 502 and falls back (internal/gateway/fallback.go);
  no magpie parity test pins the old 400
2026-10-19 19:47:00 +08:00
yetone ff13aac87d cline 0.1.9: pinUpstream pins GLM models to Z.ai's own API too (sdytman on Discord)
sdytman (#feedback, 10-19): "clinepass供应商现在可以勾选deepseek模型只走deepseek官方上游,建议glm也加一个勾选选项,只走z.ai上游".

With pinUpstream on, a request for a GLM model (cline-pass/glm-5.3,
cline-pass/glm-5.3-flash, any non-free id whose name starts with glm)
now carries "providerOptions":{"gateway":{"only":["zai"]}}, as a
DeepSeek one carries ["deepseek"]. cline-free/ models, other makers'
models and a body with providerOptions of its own go as sent. One
option covers both: it means "the maker's own API" for each.

The slug: Cline's gateway is Vercel's AI Gateway (the ProviderPin
author on linux.do/t/topic/2918145: "锁在Vercel的DeepSeek官转上";
providerOptions.gateway.only is that gateway's option).
ai-gateway.vercel.sh/v1/models/zai/glm-5.3/endpoints and
.../zai/glm-5.3-flash/endpoints list provider_name "zai" (and
deepseek/deepseek-v4-pro lists "deepseek", the slug already pinned).
Not tried with a real ClinePass key (none on this machine).

Run: bun test packages/cline/index.test.mjs, 75 pass; the whole suite
(TMPDIR and HOME under a scratch dir) 1825 pass, 0 fail; bun
scripts/check.mjs ok. Broken by hand, each goes red: no glm entry (3
tests), cline-free/ not skipped (1), every maker pinned to zai (3), the
client's providerOptions overwritten (1).
2026-10-19 18:40:54 +08:00
yetone 5f101a5447 commandcode 0.1.14: a Zero Data Retention switch sends x-cmd-zdr: 1 on the Provider API and Go's /alpha/generate (#246)
moonshardx (#246): Command Code keeps request content up to 30 days
unless Zero Data Retention is asked for (commandcode.ai/docs/resources/
zdr): CMD_ZDR=1 for the CLI, x-cmd-zdr: 1 on the Provider API. The
plugin had no way to send it.

- The plugin declares a "Zero Data Retention" switch (auth.options,
  magpie #2038, off by default, with a cost note to confirm). magpie
  shows it in the provider's editor; the plugin reads it through
  input.magpie.option at each request, so no restart is needed.
  CMD_ZDR=1 in the plugin process's environment also turns it on, as for
  the CLI; only "1" does, as the CLI's isCmdZdrEnabled reads it.
- While on, the Provider API request and Go's /alpha/generate request
  each carry x-cmd-zdr: 1. For /alpha/generate this mirrors the CLI: its
  1.84.0 bundle (npm pack, read, not run) adds [CMD_ZDR]:"1" in
  buildCommandAuthHeaders, and the installed CLI 1.74.1, run with
  CMD_ZDR=1 in a sandbox HOME through a logging pass-through proxy
  (COMMANDCODE_SANDBOX=true, COMMANDCODE_API_URL), sent x-cmd-zdr=1 on
  /alpha/generate and on every other request.
- A model with no ZDR upstream: the Provider API's 422 cmd_zdr_no_providers
  goes on as it came. On /alpha/generate Command Code answers 200 with an
  error line ({"type":"cmd_zdr_no_providers","code":
  "CMD_ZDR_NO_PROVIDERS","statusCode":400}); the agent gets that 400 and
  message as before, and now the error's type cmd_zdr_no_providers
  instead of commandcode_error.

Run: zdr.test.mjs is new (6 tests, fixtures are Command Code's literal
bodies from today). Broke each by hand and watched red: no option, no
Provider header, no generate header, CMD_ZDR read as truthy, the switch
read once, the 422 rewritten, the type dropped: 1 to 3 fail each.
bun test packages/commandcode: 55 pass, 1 skip, 0 fail.
bun scripts/check.mjs commandcode: ok. HOME=$(mktemp -d under $TMPDIR)
bun test: 1822 pass, 0 fail.
Live, with the owner's GOAT key, the plugin's fetch with the switch on:
Provider API deepseek-v4-flash 200 with x-cmd-zdr: 1; Provider API
poolside/laguna-s-2.1-free 422 cmd_zdr_no_providers, body as it came;
/alpha/generate (plan forced to Go) deepseek-v4-flash 200 with the header,
laguna 400 cmd_zdr_no_providers; with the switch off neither had the
header. Not tried: a real Go account (none here), the switch in magpie's
editor itself (driven by a stand-in for input.magpie), OpenCode.
2026-10-19 18:24:20 +08:00
lokic7123-star 24b08da95c raccoon 0.1.1: the browser sign-in comes back through a 127.0.0.1 listener (#242, lokic7123-star)
On Windows, with no office-raccoon:// handler registered, confirming the
browser authorization never finished the sign-in: the method was "code" and
asked for a callback URL the browser never reached. The browser method now
uses the authorize page's desktop_callback=loopback contract (checked
against the live page's validator: login_source=desktop, 64-hex state,
http://127.0.0.1:<port>/auth/callback, port >= 1024). A listener on
127.0.0.1 and a random port takes one GET with the exact Host, path and
state, and exchanges the code once. It closes on success, denial, exchange
failure or the 10-minute timeout. The authorize URL is built before
listening, so a bad RACCOON_MAIN_SITE_URL leaves no listener. The pasted
callback/token way stays as method 3; the desktop session stays method 1.

Run at the reviewed head f84c6d0 (merged with origin/main cdf4513), bun 1.4.2, macOS:
- bun test packages/raccoon/: 29 pass, 0 fail; bun scripts/check.mjs: all ok
- HOME=$TMPDIR/pr242home bun test: 1823 pass, 0 fail (1824 tests, 167 files)
- broken by hand, each turns a test red: replay guard (409), Host check,
  state check, URL built after listen. Removing clearTimeout turns nothing
  red; the timer is unref'd and finish() is idempotent, so it has no
  observable effect.
- RACCOON_MAIN_SITE_URL="not a URL" and "http://[bad": browserSignIn
  rejects, lsof shows no listener in the process
- magpie 0.1.1290 plugin host, sandbox HOME, fake `open`: `magpie plugin
  login raccoon` method 1 gives the loopback URL and offers the paste
  fallback. The listener is on 127.0.0.1 only. Wrong Host gives 404, wrong
  state 400, POST 405. A correct-state callback with a made-up code reached
  the real vendor (200035). The CLI failed with "授权码已失效" and the
  listener closed.
- Not tried: a full real sign-in with an account (needs the owner's login).
  The author reports a live Windows round trip in the PR.
2026-10-19 18:06:13 +08:00
yetone cdf45137d6 factory 0.1.34: Claude Code's re-read instructions reminder reaches Factory after compaction (#243)
zygs1083-dotcom (#243): after compaction, a long Claude Code session went
403 Forbidden on all three Factory accounts. Claude Code renders its
instructions attachment two ways (n_t in 2.1.292 to 2.1.303):

- first copy: "Codebase and user instructions are shown below. …"
- changed copy (changed: true, reason compaction and others):
  "Instruction files were re-read after the conversation was compacted;
  these differ from their earlier copies — each replaces its earlier copy,
  and the instructions preamble above still applies:" (or "These
  instruction files changed — …" without a reason)

Both list "Contents of ~/.claude/CLAUDE.md (user's private global
instructions for all projects):", the phrase Factory refuses (magpie#634).
Only the first opening was matched, so the changed copy went out as it was.

- INSTRUCTIONS_REMINDER matches both openings, requiring the changed
  copy's full sentence and the "Contents of " that follows it. The rename
  is limited to the reminder itself: text joined after its close (chat
  completions' joined user text) stays as written. String user turns on
  /llm/a get it too; before, only text blocks did.
- quotedToolText encodes tool output that quotes the phrase (the
  reporter's session read Claude Code's renderer source and went 403
  from then on), losslessly, as for the other phrases.
- A 403 the plugin rebuilds keeps Factory's request id (x-request-id,
  request-id, x-amzn-requestid, cf-ray, or the body's request_id) and the
  error's code and type in the message, and request_id on the Anthropic
  body. Headers already went back as they came.

The fixtures are the literal texts the 2.1.303 bundle's n_t/Mje/bMr build
and id() wraps; 2.1.301 and 2.1.302 have the same strings, and the
2.1.292 darwin-arm64 npm package has the same sentence pieces.

What was run at this commit:
- bun test packages/factory/: 161 pass, 0 fail.
- bun scripts/check.mjs factory: ok. git diff --check: clean.
- Broken by hand: with the old startsWith-only opening, the 4 changed-
  wrapper tests fail; without the phrase in quotedToolText, the tool-result
  test fails too; with upstreamIds returning nothing, the 403 test fails.
- Not tried: a real Factory request with the changed reminder (no live
  account was used), so that Factory accepts the renamed copy is inferred
  from the first copy's fix in 0.1.12, not seen.
2026-10-19 17:42:37 +08:00
yetone dff29df402 autoclaw 0.2.2: ZCode's and pi's identity lines are rewritten for the CN managed gateway (#245, #236)
autoclaw-cn's managed gateway (autoglm-acceleration-api.zhipuai.cn) answers
406 when the system text carries an agent identity line FLAGGED doesn't
cover. Two more entries, in the table's own style:

- "You are ZCode" (any case, anywhere; #245's probes) -> "You are the ZCode
  agent". #245 found "You are an interactive ZCode agent ..." answered 200,
  so the gateway reads the literal run, which the rewrite breaks.
- "operating inside pi, a coding agent harness" -> "operating inside the pi
  coding agent harness" (#236). pi's line wasn't probed, so the rewrite
  breaks both "inside pi" and "pi, a coding agent harness" and keeps pi's
  name for the model.

Both rewrites are fixed strings, so the same prompt always leaves the same
way and a cached prefix stays put. Only system and developer messages are
rewritten, as before. Claude Code's entry is unchanged. REFUSED_HINT names
ZCode and pi.

No general fallback: agents such as opencode put the user's own AGENTS.md
into the system text, so a pattern like "You are X, a ... agent" would
rewrite the user's words, and nothing shows the gateway matches that shape.

Tests use each reporter's literal line: unflagged, unflag's role scoping
(ZCode in a system part rewritten, the same line in a user message and pi's
in a tool message untouched), and the CN managed path end to end.

Run (worktree at origin/main 47fbf63):
- bun test packages/autoclaw/: 23 pass, 0 fail
- bun scripts/check.mjs autoclaw: ok
- HOME=$(mktemp -d) bun test: 1808 pass, 1 fail, the trae stream.test
  "connection reset" under the full suite (#124, open); packages/trae/
  alone 160/160 three times
- broken by hand: ZCode entry removed -> 3 red; pi entry removed -> 2 red;
  unflag's role check removed -> 2 red
- not tried against the real gateway: no autoclaw-cn account is signed in
  here
2026-10-19 17:42:06 +08:00
yetone 47fbf634e7 grok 0.1.17: the sign-in page opens once, not twice (andyfmyth on X)
"magpie里的grok 登录验证 在mac下 似乎每次都会弹两次验证, 在浏览器窗口里":
`grok login --device-auth` (Grok Build 1.0.50, the webbrowser crate)
opens the device page itself, and magpie opened the same URL again.

Reproduced in a sandbox HOME/GROK_HOME on macOS: grok's own device-code
tab appeared in Chrome with magpie not involved, with and without
SSH_CONNECTION set. What decides grok's own open, from the binary's
strings and webbrowser 1.2.4's source:
- macOS: NSWorkspace, $BROWSER never read (the macOS binary has no
  "BROWSER" string);
- Windows: ShellExecuteW, no $BROWSER either;
- Linux and the rest: $BROWSER, else xdg-open, skipped with no display.

So the sign-in now says `opened: true` on darwin and win32 (magpie then
opens nothing; magpie >= the commit that raises the grok mover min reads
it), and elsewhere gives grok BROWSER=true, a no-op, so the opener stays
the only one to open the page. OpenCode ignores the extra field.

Tests: login.test.mjs runs the sign-in as darwin/win32 (opened, $BROWSER
untouched) and linux/freebsd (not opened, BROWSER=true reaches grok).
Both fail on 0.1.16's index.mjs (10 pass, 2 fail).

Run: HOME=<scratch> bun test packages/grok: 49 pass, 0 fail;
bun scripts/check.mjs: exit 0.
2026-10-19 11:29:05 +08:00
yetone ab38da681a workbuddy 0.1.25: WorkBuddy AI's "x0.34 credits" rates are read, not unknown (#216)
WorkBuddy AI's /v3/config gives fast-model, balanced-model and
primary-model their credits as "x0.34 credits", "x0.59 credits" and
"x3.31 credits". 0.1.24 read those as unknown, so the three had no rate.
0.1.25 carries c89cee5 (#216).

Run on c89cee5 + this bump: packages/workbuddy HOME=<tmp> bun test 99 pass
0 fail; bun scripts/check.mjs ok. The full repo run is in c89cee5's body.
2026-10-19 06:33:37 +08:00
lokic7123-star c89cee5b2b workbuddy: a model's credits given as "x0.34 credits" keep their rate (#216, lokic7123-star)
WorkBuddy AI's /v3/config gives some models' credits with a unit:
"x0.34 credits", "x0.59 credits", "x3.31 credits" (fast-model,
balanced-model, primary-model). creditsOf passed "0.34 credits" to Number,
got NaN, and so treated a known rate as unknown. It now strips a trailing
whitespace-separated "credit"/"credits" before the same strict conversion.
Any other trailing text ("x0.34 bananas"), "credits" alone, "x-1 credits",
"xNaN credits", "xInfinity credits" and "" stay unknown, never free.

Reviewed at head 2dda6eb5d42e271e948e4fb5aef6d3e5db7627b5, merged with
origin/main 5a83674 (clean):
- Real catalog: read www.workbuddy.ai/v3/config with the owner's WorkBuddy
  AI sign-in (config read only, no inference). Its cli models carry exactly
  "x0.34 credits", "x0.59 credits", "x3.31 credits", default-model "" and
  the rest "x0.77"-style. main's creditsOf parses the three as unknown;
  this one as 0.34 / 0.59 / 3.31, default-model unknown. CN WorkBuddy's
  config has no unit strings and parses the same on both.
- packages/workbuddy: HOME=<tmp> bun test, 99 pass 0 fail.
- Full repo: HOME=<tmp> bun test, 1802 pass 2 fail; bun scripts/check.mjs ok.
  The 2 reds are packages/cursor, untouched here, under load average ~400:
  latency.test "events never show in time" (#210) and stepusage.test
  "finds the Run's event ... once" (null at line 88: three polls at 10ms
  don't fit its 200ms window under load). Both pass in reruns of the
  cursor package.
- Broke it by hand: without the strip, both new tests red; with the strip
  widened to any trailing word, the unknown-values test red.
2026-10-19 06:31:09 +08:00
yetone 5a836745fb zed 0.1.10: the organization with a plan is the one asked under, not a default without one, and a 402 for the saved one moves the account (#232, ReneXiong)
ReneXiong's account has two organizations: the personal one on
zed_student and a non-personal default with no plan. orgOf() always took
default_organization_id, minted the model token for it, and /models and
/completions answered 402 "Organization does not have an active
subscription". planOf() fell back to the account's plan_v3, so the card
said Student over an organization with none.

What Zed's editor does (zed-industries/zed 56934ec): user.rs
update_authenticated_user starts in the default organization, else the
first; the title bar's organization menu calls set_current_organization,
which the LLM token's auth context (language_models cloud.rs
ClientTokenProvider) follows; plan() is plans_by_organization[current],
none when it has no entry (current_organization_has_no_active_subscription
treats a missing entry as no subscription; an unknown plan as Free). The
plugin has no switcher, so it now picks as a user switching would:
- the organization the sign-in saved, while it still has a plan that
  calls models (any but Free) and models aren't turned off for it;
- else the default, if it has one; else the personal one with one; else
  any with one;
- none with one: what Zed picks (saved, else default, else first).
planOf names the picked organization's own plan ("" without an entry);
only a reply with no organizations falls back to plan_v3.

A sign-in saved before this under the unsubscribed default is moved on
the first 402 (llm_tokens, /models, /completions) or empty list: the
account is read again, moved if another organization has a plan, the
move saved through client.auth.set (and kept in memory in case the save
doesn't land), and the request asked once more. The usage hook re-picks
the same way. The model-token cache and the model list are keyed by
organization now, so a move mints and lists anew. There is no explicit
organization choice in the plugin or in magpie to respect; the saved
organization is the sticky one.

Run (bun 1.4.2, macOS, worktree at origin/main 8cdf2d2 + this):
- packages/zed/org.test.mjs (new, no network: fetch stubbed): 11 pass.
  With the old index.mjs and the new tests: 10 fail, 1 pass (the
  no-plan fallback the old code also did).
- HOME=$(mktemp -d) bun test (whole repo): 1802 pass, 0 fail.
- bun scripts/check.mjs: every package ok.
Not tried against a real Zed account; the reporter's /users/me shape is
from the issue's sanitized read.
2026-10-19 01:04:57 +08:00
yetone 8cdf2d2020 grok 0.1.16: a sign-in with no email is kept by its xAI user id, and a login that leaves none says where it looked (llllleo9 on X)
llllleo9 couldn't add Grok: grok login --device-auth exited 0, and the
sign-in failed with "grok login finished without an account".

Grok Build 1.0.62 was run in a sandbox HOME. The stand-in auth.x.ai sat
behind an HTTPS_PROXY MITM, with its CA passed through
GROK_EXTRA_CA_BUNDLE, and sandbox-exec denied opening a browser. The CLI
takes email and user_id from the id_token's claims alone. With no email
claim (an xAI account signed in through X), it writes "email": null and
still prints "✓ Signed in". When Grok Build's own home is already signed
in, the plugin signs in beside it and demanded an email, so that sign-in
failed.

- An account is now told apart by its email, else its user_id, else the
  token's sub. saved() and the refresh path's remember() use the same
  account id.
- GROK_AUTH_PATH is now left out of the CLI's run. With it set, 1.0.62
  keeps the sign-in at that file, and the home the plugin reads stays
  empty (seen in the same sandbox). The login always runs with envFor(home)
  now, not process.env.
- A login that finishes with nothing readable now says what grok said,
  which file it read and what was there (no file, not JSON, no token,
  or no account). It also points to "Use Grok Build's current sign-in".

Run:
- TMPDIR and HOME set to a scratch dir, bun test packages/grok: 47 pass,
  0 fail. The six new login tests FAIL with 0.1.15's index.mjs.
- bun scripts/check.mjs grok: ✓.
- node --check and git diff --check are clean.
- The plugin was run against the real grok 1.0.62 and the stand-in x.ai,
  with the CLI home already signed in:
  - id_token without email: 0.1.16 returns success with accountId
    "user-1". 0.1.15 returns "grok login finished without an account",
    the reporter's message.
  - GROK_AUTH_PATH set: 0.1.16 returns success, 0.1.15 fails the same way.
- login.test's "a login's link is still handed on" timed out at 5s in 2 of
  10 runs alone, on 0.1.15's code too. That is #160, which another session
  has taken; the data point was added there.

Not tried with a real xAI account: whether xAI's token for llllleo9's
account lacks the email claim, and whether their Grok Build was already
signed in.
2026-10-19 00:22:52 +08:00
yetone 779388ba04 zed 0.1.9: a signed-in account whose model list was never read says why, instead of showing the six pre-sign-in models as its own (#229, ReneXiong)
ReneXiong's Zed Student account (an organization without an active
subscription) showed "zed (Zed, 6 models)" with no error: the six
models the config hook declares before sign-in, with their hard-coded
limits. provider.models handed those back whenever /models failed and no
list had been read for the account. The likely path for this account is
a 200 whose models are all disabled: parseModels throws "Zed lists no
models for this account", the hook returned the declared list, and
magpie's host, seeing the last fetch answer 200, didn't mark the list as
fallen back, so nothing said it wasn't the account's.

Now, with no list ever read for the account, the hook throws the reason
(Zed's own "Zed: ... (status)", "Zed lists no models for this account
...", or "Zed: this account's models couldn't be read: <cause>"). magpie's
host takes a thrown models error as fellBack with that message as
listError, and the editor and `magpie providers` show "couldn't list its
models: <reason>". A list read before is still kept on a later failure,
as it was. A 401 for the model token still marks the sign-in expired.

Tests (bun 1.4.2, packages/zed): models.test.mjs 7 pass. With the old
index.mjs and the new tests, 3 fail: "the list refused with the token
just minted", "Zed down before any list", "a 200 listing nothing
callable" (each got the declared models back). Whole package: 33 pass,
0 fail.

Siblings: minimax, qoder, trae, raccoon, workbuddy and opendesign also
return provider.models on a failed list. Each of those checks a
response status magpie's host sees, so a failed read is marked as
fallen back with its HTTP status; not changed here. Not tried against a
real Zed account.
2026-10-18 21:45:42 +08:00
yetone 0a998a8a7f antigravity-cloak 0.1.0: Claude Code and Claude Desktop on an Antigravity account
Antigravity answers a system prompt that reads as Claude Code's or the
Claude Agent SDK's with a 429 "Resource has been exhausted", whatever
quota is left (xzplzpl on X). Tried with a real account, it matches
"x-anthropic-billing-header:" and "You are a Claude agent, built on
Anthropic's Claude Agent SDK", and lets the same prompt through with a
U+200B inside each. This middleware puts one after the first letter of
both words, in system text only (Anthropic system, Chat/Responses system
and developer messages, Responses instructions, Gemini
systemInstruction), and only in what an Antigravity account is sent: it
uses magpie's new onProvider hook (v0.1.1283), so a Claude subscription
or any other provider in the same routing group gets the prompt as the
agent wrote it. Options: extraWords, accounts, off. The README says the
ban risk and what happens if Google changes its match. After hexiaolv's
magpie-antigravity-cloak (MIT), which changes every request.

scripts/middleware.mjs: a case's "provider" runs the request on through
onProvider with ctx.provider, and expect_request is that try's body.

Run:
- HOME=$(mktemp -d) bun test: 1783 pass, 0 fail (the package's 12 cases
  among them). bun scripts/check.mjs: every package ok.
- Real use: magpie built from e44b9aef3 in a sandbox HOME, a real
  Antigravity account, this package added from its folder. Claude Code
  2.1.302 `claude -p` on antigravity/gemini-3-flash answered; with
  {"off": true} the same run got the 400. /v1/messages with the billing
  line, the SDK line and Claude Code's three system blocks: 200 each on,
  400 each off.
2026-10-18 01:15:12 +08:00
yetone d556ef8dda zen-free 0.1.11: a call of a tool the agent doesn't have reaches the agent as called (#209, xiotbox)
#209: since 0.1.3 (#76) a call whose name the agent has no spelling of
(DSH with pwsh declared: psh, pash, ppwsh, pshh, bash, shell_command) was
left out with a text note, and a reply of only such calls was rewritten
to a plain stop. DSH read that as a finished answer: 16 of xiotbox's 19
cases ended an autonomous turn, and the model never saw an error it
could correct.

Now nameGuard answers the model's own name when no declared tool folds
to it, so every protocol (Chat JSON/SSE, Responses, Messages) hands the
call on with its id, arguments and tool-call finish, as every other
provider in magpie does. The agent answers an unknown name itself (DSH's
ToolRuntime, Claude Code's "No such tool available", Codex's
"unsupported call", OpenCode's invalid tool) and the model corrects it.
Case and separator folding (todowrite -> todo_write, bash -> Bash) is
unchanged, and an ambiguous fold is still never guessed: it goes on as
called. Only a call with no name is still left out with the note. Any
correction budget is the agent's, as with any provider; the plugin keeps
no per-turn state.

Tests: the #76/#209 names (bedit, bcp, ash, mcp__netcatcatty__unused,
psh, pash, ppwsh, pshh, shell_command) alone and beside a declared call,
JSON and streamed, in all three protocols: the call arrives with its id,
no note, no error, a tool-call finish; a Responses or Messages stream
comes through frame for frame. index.test's plugin-level case (loader
fetch against a local fake Zen) now expects an undeclared `edit` handed
on as a tool call. The leave-out machinery tests use a nameless call.

Run:
- packages/zen-free `bun test`: 174 pass, 0 fail. With nameGuard put
  back to `|| null`: 28 fail.
- `node --test` (Node 25.8.2 and 22.22.0): 171 pass, 3 fail, the
  "sends OpenCode's own headers" tests, red the same on origin/main
  0b58032: Node's fetch adds accept-language and sec-fetch-mode. magpie
  and OpenCode run the plugin in Bun. Filed as #212.
- Whole repo, TMPDIR and HOME in a scratch dir, `bun test`: 1771 pass,
  0 fail. `bun scripts/check.mjs zen-free`: ok.
- Not tried live against Zen or with DSH: the fix is in what the plugin
  hands on, shown against a fake upstream.
2026-10-17 21:46:41 +08:00
nicegui 0a2496bb3a cursor 0.2.19: conflicting native batch counts rebuild once from history before any output (#207, nicegui)
A Cursor native Run whose step lists two different tool counts (a Codex-to-Cursor failover hit "inconsistent native tool count") now retires the owner instead of throwing. When no native result was submitted to that Run and no Chat output was exposed, the request is rebuilt once from Chat history (the same stateless rebuild the missing-count case uses), with reason=inconsistent-batch-count in X-Magpie-Cursor-Continuity. A Run that had a result submitted, or a stream that already sent output, still returns the error. The decoder stops reading the failed Run at once. Cursor 0.2.19.

Reviewed at c43b93c (on main 0b58032, clean). Run there, HOME and XDG in a sandbox dir:
- packages/cursor `bun test`: 275 pass, 1 fail. The fail is latency.test "events never show in time", red 6 of 6 on untouched main 0b58032 under load average ~270; filed as #210.
- `bun scripts/check.mjs cursor`: ok.
- native-e2e -t "conflicting count": 4 pass. With index.mjs and native-session.mjs from main: 3 of 4 red (JSON and stream rebuild, submitted-result guard). With retentionIneligible forced true: the submitted-result test goes red.
- The fake Cursor is the test's HTTP/2 server on 127.0.0.1; no real account used. The conflict is injected; why Cursor sent two counts is still unknown.
2026-10-17 21:17:45 +08:00
lokic7123-star 0b58032fa3 qoder, workbuddy: README on credit-model refusals while credits remain (#201)
README sections for WorkBuddy and Qoder on why a request can be refused
while the account still shows credits. They cover:
- the exact model id versus the display name;
- WorkBuddy 5.6+'s encrypted desktop sign-in and the browser route around it;
- 11140, the restricted account (magpie#1849);
- Qoder's 10605, a queue answer, not a lapsed sign-in (#185, 0.2.18);
- a CLAIMED check-in that is not a new grant (magpie#2696).

This is docs only. Reviewed at 76cfb6d: two README files, +66 lines,
no code. Checked each claim against the source:
- packages/qoder/busy.test.mjs exists;
- workbuddy usage.test.mjs covers sign-in, usage and chat against a sealed
  desktop file, and asserts the file is unchanged;
- magpie's `plugin use` and `plugin list` exist (internal/cli/plugins_cli.go);
- magpie#2696 is the open native-check-in cache issue.
bun scripts/check.mjs qoder and workbuddy both pass. No version bump.
2026-10-17 18:18:48 +08:00
yetone 992cff84af trae: the README's check-in outcomes and the 9074 test name say what the code does
#178's README called 9095 done and 9074 failed. The code answers both as
ineligible, the same as magpie's built-in check-in, so that 9074 isn't
asked again that day. The test asserting ineligible was named "is failed".
Docs and a test name only, so no version bump. bun test
packages/trae/native-checkin.test.mjs gives 9 pass, and check.mjs trae is ok.
2026-10-17 18:07:22 +08:00
Euraxluo 1d58133eaa trae 0.2.17: Trae CN's daily check-in through the plugin (#178)
Trae CN's daily check-in moves into the plugin as auth.checkin. It asks
/trae/api/v2/ug/checkin_credits/status and then /claim through ownRequest,
so it carries the same JWT renewal, IDE headers, {req_source: 1} body and
16-digit ugDevice (#194) as every other ug page. Trae Global answers
inactive. 9095 on the claim is ineligible, the same as magpie's built-in
traeRefused. 9074 on the claim is an answer for the day: ineligible, with a
hint to check in in the Trae CN app. The built-in calls that own-app, which
the plugin protocol doesn't have. trae 0.2.17.

Run at the reviewed head 4e9bb87 (on top of origin/main 63a3d2a..c397e96):
- bun test packages/trae: 160 pass, 0 fail. The global.test.mjs and
  stream.test.mjs failures the author saw did not reproduce.
- bun scripts/check.mjs trae: ok.
- Broken by hand, one at a time, and each turned native-checkin.test.mjs red:
  9074 mapped to failed; the ugDevice line in ownRequest removed; the
  unreadable-claim guard removed.
- magpie's plugin host (yetone/magpie 85eef5d87 build, sandbox HOME, a copy
  of the package pointed at a fake Trae on 127.0.0.1:18764), via
  `magpie accounts checkin --json`. The results were claimed 100, 9074
  ineligible with the app hint, 9095 ineligible, and checked_in done 100
  with no claim sent. Status and claim both went out with
  x-device-id 2866487253502651 and {"req_source":1}.
2026-10-17 18:06:54 +08:00
yetone c397e96b77 qoder 0.2.18: a trimmed or wrapped 10605 is busy, not a lapsed sign-in
Releases #185. Run at this head: bun test packages/qoder: 138 pass, 0 fail; bun scripts/check.mjs qoder: ok; git diff --check clean.
2026-10-17 17:56:33 +08:00
yetone 29746c7c1e qoder: test that a BOM before a stream chunk's body doesn't drop its text
#185 trims a chunk's body before parsing it in events(), and nothing tested it. The envelope carries the BOM JSON-escaped, so the response's own decoding doesn't strip it.

Run: bun test packages/qoder: 138 pass, 0 fail. With JSON.parse(inner) back, the new test goes red (1 pass, 1 fail in stream.test.mjs).
2026-10-17 17:56:33 +08:00
lokic7123-star 656f3a1fb5 qoder: a trimmed or wrapped 10605 is busy, not a lapsed sign-in (#185)
`failure` parses the trimmed body, so a BOM-prefixed 10605 (the SSE envelope carries it as a JSON-escaped U+FEFF that `res.text()` doesn't strip) keeps its 503/Retry-After instead of reading as a lapsed sign-in. An outer body with no code, or code 401/403, whose message is a 10605 body is unwrapped to it; explicit 105/110/406 codes stay authoritative, and malformed or array messages are not unwrapped. Refs #167, #181.

What was run at c9e39e0 (reviewer, bun 1.4.2, macOS):
- bun test packages/qoder: 137 pass, 0 fail. bun scripts/check.mjs qoder: ok.
- Broken by hand: without the unwrap, the 8 wrapper tests go red; parsing `text` instead of the trimmed `msg`, the BOM test goes red; unwrapping regardless of the outer code, the explicit-code test goes red. The `inner.trim()` in events() had no test; a follow-up commit adds one.
- magpie (yetone/magpie main 85eef5d87) in a sandbox HOME, a copy of this package with api3/openapi pointed at a local fake, a planted plugin-auth.json, `magpie provider test qoder`: a 403 `{"code":403,"message":<10605 body>}`, the SSE `{"message":<10605 body>}` envelope and a BOM-prefixed 403 each gave 503 "Qoder is busy for efficient (this plan's queue: p3); try again in 30s"; a 105 still gave 401 lapsed. main's package gave 401 lapsed for the first two.
- Not tried: real Qoder accounts.
2026-10-17 17:54:35 +08:00
unisong a73237c74c codex-history 0.1.1: historical web_search_call replayed as text after reasoning is filtered (#204)
Historical native `web_search_call` items become a labeled assistant text message (recorded status, action, queries and sources; no item id, no internal turn metadata) once the filter has removed the reasoning they depend on. Other native tools keep their ids; tool call/result pairs, unsafe-reference rejection and passthrough for providers without the rule are unchanged. Split out of #168 as asked in its review. codex-history 0.1.0 -> 0.1.1.

What was run at 61b6f0b (reviewer, bun 1.4.2, macOS):
- bun test packages/codex-history: 29 pass, 0 fail. node --test packages/codex-history/web-search.test.mjs: 6 pass. bun scripts/check.mjs codex-history: exit 0.
- Broken by hand: with the web_search_call branch disabled, 5 bun tests and 4 node tests go red.
- magpie (built from yetone/magpie main 85eef5d87) in a sandbox HOME, middleware added from the PR's package, a custom Responses provider `demo` pointing at a local fake, options {"providers":{"magpie:demo":{"historyFilter":true}}}, gateway on 127.0.0.1:18763 (moejs). A Codex-shaped request with reasoning + web_search_call + function_call pair: the fake received the search as the labeled assistant text, no rs_/ws_ ids, no PRIVATE_TURN, the call pair intact, store false. With main's 0.1.0 file swapped in, the fake received the bare web_search_call.
- Not tried: a real Codex session or real vendors.
2026-10-17 17:54:06 +08:00
EuraxluoandHuHong_Tao f6adc99a9c autoclaw 0.2.1: CN managed gateway, request shaping on both paths, OAuth guide opened by the host (#197)
Brings together #191 (CN managed gateway), #196 (request shaping and identity lines) and the #183 sign-in fix.

- autoclaw-cn chat goes to AutoClaw 2.1.0's managed gateway (autoglm-acceleration-api.zhipuai.cn/autoclaw-proxy/proxy/autoclaw/chat/completions, on Zhipu's domain) with 2.1.0's headers and its four-model catalog. A 401/403 there marks the sign-in expired.
- Both providers get the same request shaping:
  - the official one-sentence system prefix, merged into the caller's system message (string or array);
  - max_tokens and max_completion_tokens dropped;
  - other agents' identity lines in system/developer messages rewritten (FLAGGED/unflag, from #196);
  - no X-Harness-Type.
- On the overseas path, a 406 explains itself and keeps the sign-in. Overseas chat now sends AutoClaw's own User-Agent instead of the host's. Its catalog drops zai_glm-5-turbo and the tdpsk models (400 upstream) and keeps the old limits.
- Overseas OAuth: authorize returns the loopback guide URL once the listener is up, and the host opens it, so there is no shell spawn any more. Navigating to the authorization page no longer aborts the session.
- autoclaw 0.2.0 -> 0.2.1.

What was run at 1fe91be (reviewer):
- bun test packages/autoclaw: 21 pass, 0 fail. bun scripts/check.mjs autoclaw: ok. git diff --check: clean. Merges cleanly onto main.
- magpie plugin host (magpie main cb05dc2d1), sandbox HOME, with a copy whose three hosts point at a local fake:
  - overseas: authorize gave http://127.0.0.1:18432/, the guide returned 200, and /open-auth plus /auth/callback-google finished the sign-in;
  - CN: SMS sign-in worked;
  - streamed chat on both providers returned 200;
  - the fake received the prefix with "You are Claude Code" rewritten and no max_tokens on both paths; User-Agent AutoClaw/2.1.0 on CN and AutoClaw/1.18.1 overseas; no X-Harness-Type.
- Not tried: real accounts or the live gateways (no credentials used).

Co-authored-by: HuHong_Tao <3596843010@qq.com>
2026-10-17 16:59:42 +08:00
K11n 571790bc22 factory: reword update-config's refused sentence in the guide agent's system prompt too (#198)
Factory refuses one sentence in Claude Code's built-in update-config skill description. The plugin reworded it only when the entry was a whole line in the skill-list reminders, and only without a slash. claude-code-guide's own system prompt renders the entry as `- /update-config: …` under "# User's Current Configuration", so its first request was 403.

This change matches the entry by name, with or without the slash. It rewords only "not Claude" to "not the assistant" inside that entry. The rewording now also runs on system prompt blocks (promptText) and at the existing call sites (bareSkills, announcedSkills, announcedContext, generatedContext, userBlockText). factory 0.1.32 -> 0.1.33.

What was run at af6422e (reviewer):
- bun test packages/factory: 153 pass, 0 fail. bun scripts/check.mjs factory: ok. git diff --check: clean.
- Broken by hand: with promptText's configSkillText call removed, 2 of the new tests fail.
- magpie plugin host (magpie main cb05dc2d1), with a copy whose API/WorkOS hosts point at a local fake:
  - API-key sign-in worked.
  - /v1/messages with a claude-code-guide-shaped system prompt went out with block 0 as the Droid identity and the update-config entry reworded. A user's "/custom: Keep not Claude" entry was left unchanged, and the stream came back 200.
- No new hosts, telemetry or dependencies.
2026-10-17 16:39:47 +08:00
yetone 63a3d2aeb9 trae 0.2.16: a Trae CN account checks in on its own device in the client's 16-digit shape (#194)
XcodeFish's A/B on one account (#194): with the same Cloud-IDE-JWT,
headers and body, Trae CN answered a claim 9074 on the plugin's
19-digit x-device-id and took it (code 0, +100) on a 16-digit one.
The IDE's own id is server-issued: Trae's main process registers at
log.snssdk.com/service/2/desktop/device_register (read in Trae.app's
out/main.js, iCubeDeviceRegisterMainService). Real clients keep it as
iCubeAuthInfo://icube-dc:<id>, and the ids seen in #808 and #1705 are
15 or 16 digits.

- A new Trae CN sign-in names a 16-digit device_id. Trae Global keeps
  19 digits, since nothing says its ids are shaped otherwise.
- ugDevice: a check-in from an account the local client isn't signed
  in as goes on the account's own id when that is 15 or 16 digits.
  Otherwise (19 digits, signed in before 0.2.16) it goes on a 16-digit
  id hashed from that account's device id and uid. The id is the same
  on every check-in, never rotated and never another account's. A 9095
  is still the day's answer. Chat pages and the renewal keep the
  device the account signed in with.
- README: the Sign-in and Daily check-in sections say this.

Run:
- bun test packages/trae: 151 pass, 0 fail. Breaking it by hand: with
  the ugDevice line removed, 7 tests fail; with newDevice back to
  digits(19), 4 fail.
- bun scripts/check.mjs: ok.
- magpie's plugin host (origin/main 7660399a1, sandbox HOME), with the
  plugin's web/auth hosts pointed at a local fake:
  - signed in on 0.2.15 (device 9375744633732288271), claim on 19 digits;
  - added 0.2.16 over it: status/claim/claim all went on 2849759837088686,
    and the pay page kept 9375744633732288271;
  - a new 0.2.16 sign-in named 2348824360597085 (16 digits) and used it
    for check-in and chat.
- Not tried against the real api.trae.cn; there are no real accounts
  here. The 16-digit claim being taken is the reporter's measurement.
2026-10-17 15:31:04 +08:00
yetone 3e966bb4b5 kimi-work: test that the Work token goes only to the official chat endpoint
#190 dropped the old guard assertion with the error-body test it lived in.
The guard (index.mjs:106-109) is unchanged; this puts its test back and
widens it: another host, another path, a query, credentials in the URL and
GET are all refused before any fetch.

Run: bun test packages/kimi-work (18 pass); bun scripts/check.mjs kimi-work
(ok). Removing url.search from the guard turns this test red.
2026-10-17 14:07:29 +08:00
kupakupa 6017ebc383 kimi-work 0.1.4: pass 429/5xx through unchanged, 401 marks the sign-in expired (#190)
Kimi Work 0.1.4: a 401 marks the sign-in expired. A 429 or 5xx passes through unchanged (status, headers including Retry-After, and body), so magpie classes rate vs quota from Kimi's own words. A network error keeps its cause code or message.

Reviewed head de33725f5a4cca882852ea69d0d828d5e1f4e605. Every changed line was read. What was run:
- `bun test packages/kimi-work`: 17 pass, 0 fail.
- `bun scripts/check.mjs kimi-work`: ok.
- Run in magpie's plugin host (main 7660399a1, a throwaway internal/gateway test with a sandbox HOME). The plugin was a copy with its BASE, MEMBER and desktop-file path pointed at an httptest fake, and the sign-in went through `plugin.Authorize` then `plugin.Finish` on a synthetic config.json.
  - The stream returned 200.
  - A 429 "Too many requests" returned 429 with Retry-After 7 and type rate_limit_error. A 429 "exceeded your current quota" returned 429 with Kimi's words. A 502 returned 502.
  - A 401 surfaced the expired message.
  - Each upstream request carried only the Work token and the plugin's own User-Agent.
- The endpoint guard (index.mjs:106-109) is unchanged. Its test was removed with the old error-body test, so a follow-up commit adds it back.
2026-10-17 14:05:36 +08:00
kupakupa 5fa537146e kimi-desktop 0.1.1: ordinary Kimi takes the Library's instructions, MCP and skills (#189)
Ordinary Kimi (agent-kimi-desktop) becomes a Library target: agent.library
names ~/.config/magpie-kimi/AGENTS.md, library-native/mcp.json (format kimi)
and library-skills. bootstrap() links library-native to Kimi's
daimon/runtime/kimi-code/home and library-skills to daimon/skills (junction on
Windows, dir symlink elsewhere); a different object at either path stops with
library_path_conflict. The adapter reads AGENTS.md on every inference request
and inserts one separate system message after the leading system/developer
ones; an unreadable or non-UTF-8 file answers 503 instructions_unavailable.

Run at the reviewed head 5b9f445 (by the reviewer, sandbox HOME, no real
credentials):
- bun test packages/kimi-desktop: 14 pass, 0 fail (95 expects), bun 1.4.2.
- bun scripts/check.mjs: every package ok (agent packages are skipped there).
- Against magpie's own Library code (origin/main e085d6e92): a throwaway Go
  test in internal/library loaded this kimi-desktop.agent.js through
  agentplug, ran prepareLibrary on a fake Kimi tree, then SaveInstructions,
  SaveServer and InstallSkills to the kimi-desktop target. The MCP server
  landed in the native runtime mcp.json beside the existing entry, the skill
  in daimon/skills, library-native stayed a symlink; applyInstructions put
  the written block in as a second system message. RemoveServer,
  RemoveSkill and clearing the instructions left the existing MCP entry and
  skill, and applyInstructions then added nothing.
- CI on the PR: test and on-npm green.

Not tried: a real Kimi desktop (the author's COMPATIBILITY.md records it on
Windows 11 and macOS). agent-kimi-desktop is not on npm yet; it is served
from the dist branch until the owner's first publish.
2026-10-17 13:19:09 +08:00
Euraxluo 5d7fb87f84 qoder 0.2.17: native daily check-in through auth.checkin (#179)
Adds auth.checkin to Qoder and Qoder CN. It lists the account's campaigns and claims a CLAIMABLE CLAIM_BENEFIT campaign, and the list and the claim go through the plugin's own campaigns path: device token, one rotation on 401/403, VPC host and native machine identity. The outcomes match magpie's built-in qoder_checkin.go:
- a CLAIMED campaign is done only while its startAt/endAt window is open;
- a daily campaign that is neither claimable nor active-claimed is failed, so it is asked again later;
- no daily campaign at all is inactive;
- a list or claim reply that can't be read is failed, never inactive or claimed.
The credit is the claim's own benefit.amount, else the campaign's. Bumps the package to 0.2.17.

Reviewed head 128ed2a. Ran at that head:
- bun test in packages/qoder, sandbox HOME/TMPDIR: 127 pass, 0 fail
- git merge-tree onto origin/main: clean
- PR CI: test and on-npm pass
- read every line of the checkin hook against magpie's internal/provider/qoder_checkin.go. The campaign shape and its seconds-based startAt/endAt match the real campaign JSON in qoder_checkin_test.go.
2026-10-17 10:31:33 +08:00
yetone b3a860c115 think-tags 0.1.1: a </think> inside Markdown code no longer ends the stripped thinking (#176)
With "strip" on, a reply that opened with <think> was cut at the first
literal </think>, even one the thinking wrote out as an example in
inline code or a fenced block. Kane-Kuroneko's reply ("使用
`<think>...</think>` 标签") then began mid-sentence, as the gateway's own
Chat decoder did before yetone/magpie d4a1b9baa (#2634).

- findClose ports magpie's mdCode (internal/gateway/chat.go): </think> is
  looked for only outside Markdown code. An inline span ends with its
  line, so a stray backtick can't swallow the answer, and a fence is a
  block. A run of backticks or a close split across chunks is held back.
- Streamed (strip) and whole (stripWhole) replies both use it, for Chat,
  Anthropic and Responses.
- A Chat stream that ends inside the block no longer gives held-back
  text to the answer: inside, that is thinking (a held "``" would have
  leaked; before, so would a held "</th").

Run at fc9cf6a + this change:
- packages/think-tags `bun test`: 18 pass, 0 fail. New: the reporter's
  bytes (think_code_test.go's exampleClose) whole (Chat/Anthropic stream,
  Chat/Anthropic/Responses whole), one character a delta, one UTF-8 byte
  a delta; mdCode's other cases (double-backtick span, fence, span ends
  with its line, split close, held backticks); two cases.json cases so
  moejs checks it too.
- Against fc9cf6a's middleware: 6 of the new tests fail. With code state
  ignored (any "<" checked): the same 6 fail. With held text given back
  inside the block: "backticks held at the end stay thinking" fails.
- Whole repo, HOME=$(mktemp -d) bun test: 1698 pass, 0 fail on two runs.
  A first run had 1 fail whose name I didn't capture; two reruns were
  green, so it is unidentified, not fixed.
- bun scripts/check.mjs: exit 0.
Not run: a real model through magpie with the plugin installed.
2026-10-17 09:36:07 +08:00
Euraxluo fc9cf6a7b0 minimax 0.1.2: claim the account's daily check-in (签到) (#140)
minimax 0.1.2 adds an `auth.checkin` hook for MiniMax Code's daily check-in (每日签到).

- It reads the panel at `/minimax-cloud/api/v1/signin/status` and claims the day at `/signin/claim`.
- Both requests are signed by the package's own `accountCall()`: the same headers, query and x-signature as the rest of the account API, and a `{}` body on the claim.
- On the China site they go to `agent.minimax.cn` (`site.llm`), the host magpie's built-in check-in uses.
- Failed reads come back as `failed`: a non-2xx reply, no panel, or a malformed panel (not 7 days numbered 1-7, or more than one today or claimable day).
- With no day marked today it returns `inactive`, and nothing is claimed.
- The streak counts back from today's index. 401 and 403 are `failed` with the HTTP status.
- The README says the check-in is opt-in. OpenCode ignores the hook.

Run at d21543b76cf0fa19b6e345e6b2d2f0d29976ee93, merged locally onto origin/main 6467760:
- packages/minimax `bun test` (isolated HOME): 50 pass, 0 fail.
- `bun scripts/check.mjs` (all packages): exit 0.
- The new host test, run against 5fb2143's index.mjs: 17 pass, 1 fail (the host test). So it guards the fix.
- A scratch probe at 5fb2143 with separate llm/agent fakes reproduced the wrong host; d21543b's test covers that case.
Not run: a real MiniMax account. No test reaches the network.
2026-10-17 09:11:18 +08:00
kupakupa 646776060f kimi-desktop: Kimi desktop Work as an agent, through its local runtime (#169)
Adds agent-kimi-desktop 0.1.0 (kupakupar): Kimi desktop Work on magpie's
Agents page. It moves the runtime's daimon-kimi-code baseUrl to a
loopback bridge and back, through Kimi's local control API.

Re-reviewed at dd8ed2c against the last review at 6c584bb:
1. menu-hook.cjs and selection.mjs are removed; no injected code ships.
2. No full config backup is written. Only before-menu-models.json (the
   model list and current choice) is kept, and it is removed on a clean
   disconnect.
3. providers.json and settings.json are never opened. The catalog comes
   from the gateway's /v1/models with the agent's key and its registered
   UA "Desktop Kimi Work".
4. No signal handlers and no process.exit. Restore runs on the 'exit'
   event, which fires when magpie closes the host's stdin (host.js
   rl.on("close") -> process.exit(0)). The README gives manual recovery
   after a SIGKILL.
5. macOS record: COMPATIBILITY.md (macOS 26.6.2 arm64, Kimi 3.2.17
   build 3.2.17.4, magpie 0.1.1276, Bun 1.4.3). All four control methods
   succeeded, a streamed request returned 200, and a restore followed.
   The README says what happens when a private method fails.
6. Search and fetch pass Kimi's own request, with its own key, to Kimi's
   own origin, unchanged. This is the user's own account used by that
   user, the same rule as #171, so it is accepted.

Run at dd8ed2c, and merged onto origin/main 2ea25b9 together with #171:
- HOME=$(mktemp -d) bun test: 1660 pass, 0 fail (merged: 1668 pass, 0 fail).
- bun test packages/kimi-desktop: 12 pass.
- bun scripts/check.mjs: ok (it skips agent packages).
- git diff --check, npm pack --dry-run (8 files), node scripts/dist.mjs
  (packs agent-kimi-desktop@0.1.0).
- Broken by hand: re-adding a SIGTERM handler and a full config backup
  turns 3 tests red.
- No CI ran on the PR. No real Kimi or credential was used.
2026-10-17 04:33:01 +08:00
kupakupa adcc7252d0 kimi-work: a Kimi desktop Work subscription through the desktop's own sign-in (#171)
Adds kimi-work 0.1.3 (kupakupar): a provider for the Kimi desktop's Work
subscription, using the desktop app's own local sign-in. It stores only
a hashed account reference, rereads the desktop's tokens on each call,
writes nothing to disk and logs nothing.

Re-reviewed at d9fe48d against the last review at fc3e395:
- (1) the desktop credential: decided acceptable (same as WorkBuddy,
  Qoder, ZCode: each user's own allowance).
- (2) macOS record: COMPATIBILITY.md, macOS 26.6.2 arm64, Kimi 3.2.17
  (3.2.17.4), magpie 0.1.1276 (released 2026-10-16 17:11Z, before the
  20:09Z run), Bun 1.4.3. The path and four field names match readDesktop.
- expireTime: resetsAt dropped, window renamed 会员共享额度.
- efforts: every advertised level is kept (redacted real catalog fixture).
- kimi-work-opencode overlap: the README credits it and says not to
  enable both.
- Request input: handled; body, headers and signal are kept, and the
  desktop credential replaces any caller Authorization or Cookie.
- Icon is shipped once (package.json); the UA reads the package version.

Run at d9fe48d, and merged onto origin/main 2ea25b9 together with #169:
- HOME=$(mktemp -d) bun test: 1656 pass, 0 fail (merged: 1668 pass, 0 fail).
- bun test packages/kimi-work: 8 pass.
- bun scripts/check.mjs: ok (kimi-work checked).
- git diff --check, npm pack --dry-run (4 files), node scripts/dist.mjs
  (packs opencode-kimi-work-auth@0.1.3), scripts/new-to-npm.sh (new).
- Broken by hand: String(input) for Request and the old effort allow-list
  each turn their new test red.
- No CI ran on the PR. No real Kimi account or credential was used.
2026-10-17 04:32:42 +08:00
yetone 2ea25b925b cursor: the latency test's far events show once their step has answered, and a step's wait is counted in asks, not ms (#159, #162, #165)
#159 and #162: the "far from Cursor" fake showed a Run's usage event
SHOWS (225 ms scaled) after the Run's stream closed. The step's wait
takes its last look about 180 ms after that close, so only ~45 ms stood
between "the event is not there yet" (what the test means) and "the
event is already there" (the step owns it and the sum moves). A loaded
machine eats 45 ms. #162's title guessed an earlier test's cached
usage; it was the step's own event showing inside its wait.

The fake now holds a far Run's event until the step whose Run it is has
answered, and shows it at once if that step already has: the state the
test is about, not a duration.

#165: test 1 bounded each step's wait in milliseconds, which load
stretches. Each wait asks once and the round trip is most of it, so the
bound is now at most 2 asks per step (its own event, plus what earlier
steps owe).

Run (bun 1.4.2, load average 280-295 throughout):
- Old test, cause injected by showing the event earlier (SHOWS - 50 ms):
  #159's failure; SHOWS - 80 ms: #162's. New test with the same
  injections: green.
- packages/cursor/latency.test.mjs: 9 of 9 green.
- packages/cursor whole package (HOME=$(mktemp -d) bun test): 3 of 3,
  272 pass, 0 fail.
- Broken by hand in index.mjs, each turned the new test red: the step
  waiting for its own event removed; owed() not gathering at the end;
  the ask bound raised (a step asking 3+ times).
Not run: the whole-repo suite (test-only change in one file).
2026-10-16 19:11:56 +08:00
yetone be7b03e090 autoclaw: the refresh test reads the expiry between the clock before and after, not the clock again
"refreshTokens orders hosts by the token's source_id and falls back on
400002" compared the expiry refreshTokens computed (Date.now() + 3600s -
10min) with Date.now() read again after it returned. On a millisecond
boundary between the two reads it is off by one: publish run 38885546686
(devin 0.1.20's push, 29adee2) went red on ubuntu with expires
1792148517446 against 1792148517447, and no package published. The test
now takes the clock before and after the call and checks the expiry lies
between them.

Run: with a 3ms busy-wait injected after refreshTokens returns, the old
test is red (0 pass, 1 fail) and the new one green. bun test in
packages/autoclaw under a mktemp HOME: 9 pass. bun scripts/check.mjs
autoclaw: ok. Test only; the package's version is unchanged.
2026-10-16 18:14:43 +08:00
yetone 3d0a546aa3 usage 0.1.1: the tab is named in the window's language, and the tiles fill four across or two by two
magpie.page.titles names the page in zh, zh-TW, ja and de; a magpie that
doesn't know titles still reads title. The tiles were auto-fill, which left
a hole in their row at most widths; now four across, two by two under 640px.

Run: bun test in packages/usage (6 pass). Tried in the magpie sandbox app's
dev UI with the real usage.jsonl, WebKit, dark and light, zh and en, at
900 and 560px.
2026-10-16 18:13:05 +08:00
yetone 29adee2688 devin 0.1.20: a tool's images go to Devin with its result, as the built-in sends them
magpie's built-in Devin (internal/gateway/devin.go buildDevin) sends the
images a tool returned on the tool message that answers the call
(inlineImages(p.Images), field 10). A chat's tool message holds text
alone, so magpie's gateway hands the plugin those images in the user
message after the results (buildChat's seeLater: "[From the result of
<tool> (tool call <id>):]" then the images, and the result's text ends
"[The tool returned an image; it follows in the next message.]"). The
plugin sent them to Devin as a user message of their own, and a tool
message's own image_url parts were dropped.

build() now puts each result's images back on its tool message: the
images under a heading naming a result just sent, up to the number its
note says (so the user's own images after them stay the user's), and a
tool message's own data: image_url parts. The note is taken off the
result's text when every image it names went back with it; an empty
result is "(no output)", as the built-in words it. Images without bytes
(URLs) are left out, as inlineImages leaves them. A heading that names no
result just sent is left as the user's text.

Run:
- bun test in packages/devin under a mktemp HOME: 93 pass, 0 fail.
- bun scripts/check.mjs devin: ok.
- tool-images.test.mjs against the old index.mjs: 3 of its 4 tests red
  (the fourth guards a heading naming no result, which held before too).
  With the count limit broken by hand (images past the note's number taken
  as the tool's), the two-results test goes red.
- The fixtures in testdata/ are magpie's literal buildChat output at
  origin/main b03031738, captured with a throwaway test in a separate
  magpie worktree (codexViewImage, and an Anthropic request with two Read
  results and the user's own image).

Not tried: a real Devin account (whether Devin's model reads a tool
message's images better than a user message's was not measured); OpenCode
itself, outside magpie, whose own shape for a tool's images was not read.
2026-10-16 18:10:59 +08:00
yetone 8fc3833aa7 commandcode 0.1.13: the Credits window renews at the plan's period end, the CLI's free models are free, and a Go request's max_tokens stays within 200,000
Three things magpie's built-in Command Code did that the plugin didn't,
ahead of retiring the built-in:

- The Credits window had no reset, though the month's credits come back
  when the plan's period ends, which billing/subscriptions' currentPeriodEnd
  says (sub.until, already the card's "until"). allowanceOf now puts it on
  the window as resetsAt (yetone/magpie#2454). No period end, no reset.
- The models the CLI marks FREE (magpie's cmdFree, all 11: Space Bunny
  Alpha, Pixel Canary, Laguna S 2.1, the Ling 3.0/3.1 Flash ones, the
  MiniMax M3/M2.7 free ids, LongCat 2.0 free, Tencent Hy3) now say
  free: true on every list: the Provider API's, Go's, and Go's table when
  the list can't be had.
- A Go chat's max_tokens sent to /alpha/generate is kept within 200,000,
  the most Command Code takes ("Too big: expected number to be <=200000
  at params.max_tokens"; magpie's CommandCodeMaxOutput in cmdRequest).
  Before, a 384,000 ask failed the whole request.

Run: bun test in packages/commandcode: 49 pass, 0 fail. parity.test.mjs
is new; usage.test.mjs's two plan-with-period cases now expect the reset.
Broke each by hand and watched red: no resetsAt, 3 fail; no free flag,
3 fail; no cap, 1 fail. bun scripts/check.mjs commandcode: ok.
Live, with the owner's GOAT key: the card's Credits window says resetsAt
2026-10-28T16:16:42Z, the subscription's until; its list (71 models) has
poolside/laguna-s-2.1-free free, the only one of the 11 Command Code lists
today. Not tried live: a Go request over 200,000 (no Go key here).
2026-10-16 17:37:25 +08:00