Commit Graph
515 Commits
Author SHA1 Message Date
yetone 10ebbb3fc3 magpie-setup: subagents get their own model through magpie's settings
Myi3i4 on X asked whether the setup skill covers this: asking Codex to put a
subagent on a model works only sometimes. magpie already pins every Codex
subagent to one model or group whatever the lead names (subagent_model), and
Claude Code's subagents too; the skill now says so.

Run: each command in the new block ran against magpie built from magpie
origin/main 4ad… in a sandbox HOME (ollama provider with two models typed in):
codex subagent_model <model>, group/<id>, default, subagent_effort low and
claude subagent <model> each printed ✓ and wrote the setting.
Not tried: a real Codex subagent request through the gateway.
2026-10-27 04:43:48 +08:00
yetone 4bde462e21 workbuddy 0.1.37: sign in with an API key (#407)
Both builds offer "<build> API key" beside the browser and desktop
sign-ins, for a key made on the build's keys page
(www.workbuddy.cn/profile/keys, www.workbuddy.ai/profile/keys).

A key is sent as WorkBuddy's own CLI sends CODEBUDDY_API_KEY
(@tencent-ai/codebuddy-code 2.177.0, read as data): its API-key
session has the key as the access token, uid "anonymous_" + the key's
last 8 characters, personal, no domain, no enterprise; model requests
carry X-API-Key: <key> and Authorization: Bearer <key>
(getCustomHeaders). So a key's chat has those, X-User-Id
anonymous_<last8>, no X-Domain, and the client headers the other
sign-ins send, to the same host: copilot.tencent.com/v2 for workbuddy
(the CLI's endpoint for CODEBUDDY_INTERNET_ENVIRONMENT=internal; it
treats www.workbuddy.cn and copilot.tencent.com as front doors of one
API) and www.workbuddy.ai/v2 for workbuddy-ai.

The loader's apiKey "" and x-api-key delete stay: they keep the SDK's
own (empty) key headers off; sign() now sets X-API-Key itself for a
key account and never for an OAuth one.

- Models: /v3/config is asked with a key only for ck_/pt_ keys, as the
  CLI's shouldLoadRemoteConfig does; any other key keeps the built-in
  list.
- Usage: a key's card says the credits are unknown and asks nothing
  (the CLI reads no credits with a key; no endpoint guessed).
- A 401 on a key is never renewed or resent: it says the key was
  refused and where to check it, marked expired only on
  invalid_token. The >2 MiB reset probe doesn't ask the billing API
  with a key.

Run at this tree (base ac11dcb):
- apikey.test.mjs: 12 pass; against the old index.mjs 10 fail, the 2
  OAuth-unchanged tests pass.
- packages/workbuddy: HOME=<tmp> bun test, 167 pass 0 fail.
- repo: HOME=$(mktemp -d) bun test, 2760 pass 3 skip 0 fail;
  bun scripts/check.mjs exit 0.

Not tried: a real WorkBuddy API key.
2026-10-27 04:41:57 +08:00
yetone ac11dcbb92 antigravity-cloak 0.1.2: Hermes Agent's earlier persona is broken too
Antigravity answers "Hermes Agent, an intelligent AI assistant created by
Nous Research" (Hermes' earlier default SOUL.md, which a SOUL.md the user
edited keeps) with the same fake 429 "Resource has been exhausted" (zgoodz
on X, 10-27: "antigravity在Hermes里一样429"). Hermes' current default
persona goes through. The line joins the words broken with a zero-width
space, after its H: "Y​ou are Hermes Agent, an intelligent ..." still
fails on a real account, while "H​ermes Agent, an intelligent ..."
goes through.

magpie v0.1.1641 breaks the same lines on an Antigravity account by
itself (`magpie provider set antigravity prompt=as-written` turns it off);
the README says so, and that this middleware then adds only extraWords.

Run:
- bun test packages/antigravity-cloak: 15 pass, 0 fail (new case: Hermes'
  old persona in a chat system message, broken after its H; the current
  "You are Hermes Agent, built by Nous Research." stays). With the word
  taken out: 14 pass, 1 fail.
- bun test scripts/check.test.mjs: 3 pass.
- Real Antigravity account through a sandbox magpie: the line whole is
  refused; broken after its H, 200; real Hermes Agent with the old persona
  answered through magpie's own break (magpie-side, same rule).
Not tried: this plugin installed in a running magpie on a real account.
2026-10-27 04:17:17 +08:00
yetone a52d1b370b antigravity-cloak 0.1.1: Codex's GPT-5 prompt is broken too
Antigravity answers "You are Codex, an agent based on GPT-5" and "You are
Codex, a coding agent based on GPT-5" in the system instruction with the
same fake 429 "Resource has been exhausted" it gives Claude Code's prompt.
A Codex thread begun on a GPT model keeps that prompt after /model,
resume -m or a fork onto an Antigravity model, so such a thread never got
an answer (Jodiezzzzzz on X, 10-27; magpie now tells it as a 400 with a
hint). The two lines join the words broken with a zero-width space.

Run:
- bun test packages/antigravity-cloak: 14 pass, 0 fail (two new cases:
  a switched thread's developer message, the coding-agent wording in
  lower case; magpie's own "You are Codex, based on GPT-5." stays).
- bun test scripts/check.test.mjs: 3 pass.
- On a real Antigravity account through a sandbox magpie: both lines
  whole get 429 (magpie's 400); "Y​ou are Codex, an agent based on
  GPT-5" and "Y​ou are Codex, a coding agent based on GPT-5" get 200.
- npm had 0.1.0; this is 0.1.1.
Not tried: the plugin installed in a running magpie on a real account.
2026-10-27 00:41:44 +08:00
MYCF711 213ef506c5 workbuddy 0.1.36: a free account's credits say when the plan refills (#415)
A free account's card says when the plan refills: with no subscription named, cycleOf reads the plan_base slice's cycle end (UTC+8). A summary that names a subscription still goes by it alone, and named-but-not-listed stays unknown.

By MYCF711. Reviewed at b8d600c9:
- `HOME=$(mktemp -d) bun test` in packages/workbuddy: 155 pass, 0 fail.
- The named-not-listed assertion fails on the PR's first head (b1ce408), which returned the slice's month end for a paid account; passes now.
- npm had 0.1.35; this is 0.1.36.
Not tried: a real WorkBuddy account (the fixture is the author's live CN reply).
2026-10-26 23:56:46 +08:00
刘巍峰 c25201d259 qoder 0.2.38: a reply names the model-list entry it was sent with (#413)
Qoder and Qoder CN chat replies name the model-list entry the request was
built from (m.name), in JSON and every SSE chunk, usage included. A blank
name, or one equal to the slot key, keeps the requested id. No extra
model-list fetch per request; keys, X-Model-Key and model_config unchanged.

Run at the reviewed head 6f9813f7bb44ea243007c1da2495d69de6be2de9:
- bun test in packages/qoder: 266 pass, 0 fail.
- model-identity.test.mjs against main's index.mjs: 28 of 28 fail; at the
  head they pass.
- Merges cleanly onto main; npm has 0.2.37, this is 0.2.38.

Not tried: a real Qoder account.

Closes #412 once the reporter confirms.
2026-10-26 22:45:27 +08:00
mola 03f5952a8b layerfs 0.9.0: commits name their calling agent, trajectory reads each record once (#365)
layerfs 0.9.0 (sim-only): each provision, checkpoint, fork, publish and exec records the calling agent from the tool host's ctx.agent, and the page names it, ahead of the branch-name guess. trajectory() reads each commit record once per backend lifetime (summaries cached, manifest left out) and yields between branches, so a rebuild reads only new commits. Native backend requests are still refused loudly.

Run at e3c7ee94 (macOS): bun test packages/layerfs 57 pass (2 of 3 runs; the third hit ENOSPC on a full disk in 4 #360/accounting tests that pass in the others); origin/main 53 pass. bun scripts/check.mjs layerfs ok. Checked that magpie's host.js runTool passes ctx.agent as execute's second argument.
Not tried: the page in the real magpie app with a live agent.
2026-10-26 18:11:30 +08:00
tianyuanwang989-prog 60a2d6e2e2 gcp-ai 0.1.1: a Windows sign-in reaches gcloud by its own path, and an expiring credit is spendable (#409)
gcp-ai 0.1.1: on Windows, gcloud.cmd is started by its own path (CLOUDSDK_ROOT_DIR, then PATH, quoted entries included), so the batch file's %~dp0 is its own directory and gcloud finds its library. A credit whose status reads "Expiring in N days" counts as spendable until its end date.

Run at 66279e97 (macOS): node --test packages/gcp-ai/test: 44 pass, 3 skipped (Windows-only); origin/main 40 pass. bun scripts/check.mjs gcp-ai ok. The earlier review reproduced the %~dp0 cause and fix on Windows 11 with a fake gcloud.cmd.
Not tried: the new Windows-only tests on Windows at this head (the box was unreachable); the author ran them on Windows 11 with real gcloud 589.0.0.
2026-10-26 18:05:06 +08:00
yetone 0ea458b4a5 minimax 0.1.7: device sign-in polling asks again after a transient failure (#382)
Releases #382 (e228f29). 0.1.6 was already published from #393, so the
bump that #382 carried was a no-op.

Run at this tree: bun test in packages/minimax gives 81 pass, 0 fail.
bun scripts/check.mjs minimax passes.
2026-10-26 16:14:01 +08:00
congee949 e228f291bc minimax: device sign-in polling asks again after a transient failure (#382)
MiniMax's device sign-in no longer ends on a connection reset, a non-JSON HTTP 400, a 408/429/5xx, or a body read that fails while polling. It asks again with the same device code and verifier, up to three times in a row and within the code's deadline. A pending answer resets the count. Denied, expired and bad-client answers still stop at once, and refresh stays single-attempt.

Run at 4b17063, merged onto main d2ada16:
- bun test in packages/minimax: 81 pass, 0 fail. bun scripts/check.mjs minimax passes.
- poll-retry.test.mjs on main's index.mjs: 12 of 19 fail.
- Probe with Bun's real fetch against a local socket server: a reset, then an HTML 400, then pending, then a reset mid-body, then a token. The PR signs in after 8s, and every poll carried the same device_code and verifier. Main fails on the first reset (ECONNRESET).
- Bun reports a reset as code ECONNRESET, which is in the retried list. It reports a refused connection as ConnectionRefused, which isn't, so that is not retried.

Not tried: a real MiniMax account (none used in review). The version goes to 0.1.7 in a following commit, since 0.1.6 is already published from #393.
2026-10-26 16:13:48 +08:00
yetone d2ada161cc zcode 0.1.31: ZCode 3.16's key location gives the coding plan its key (#410)
ZCode 3.16.3 on a Mac keeps no coding plan key in credentials.json or
config.json, only a project-key-location:v1 record
({organizationId, projectId, apiKeyId}, encrypted like the rest). With no
key, plansOf sent the account to the gift and the BigModel GLM Coding Plan
never showed (meraki7304).

ownSignIn now reads that record (the account's own: team null, coding
plan, the profile's user id, the family ZCode is on first), and located()
reads the named key's secret from api_keys/copy/{apiKeyId} with the OAuth
token, as ZCode lists keys (BigModel bare, Z.ai as a Bearer). Only GET:
nothing is created. The record's origin is used only when it is an https
z.ai / bigmodel.cn host, else the site's own API. A 404 leaves the sign-in
as before; another failure says sign in again. Request fetch and usage
resolve it before plansOf.

Record format and auth forms read from ZCode 3.16.3's own app.asar
(ProjectAccessTokenClient / project-key-location:v1).

Run: HOME=$(mktemp -d) bun test in packages/zcode, 119 pass;
bun scripts/check.mjs ok.
Red on old code: the new own.test.mjs case fails with the old index.mjs
(key "" and start true).
Not tried: a real ZCode 3.16 account (no vendor credentials used); the
reporter's read-only check of the same endpoints is the evidence.
2026-10-26 16:03:20 +08:00
wendyeq 2b56b3bc4f zcode: name the conversation in x-session-id as a bare UUID, so BigModel's prompt cache hits (#388)
ZCode's client names every request's conversation in x-session-id: a bare
UUID, the same on each turn (3.14.3 xst/Tst). BigModel keeps a prompt's
cache for the requests that name the same session. The plugin sent none,
so a long conversation seldom hit the cache (#387). Every zcode request,
on the Start Plan and on Coding Plan or team seats alike, now carries it:
- the agent's session (chat.headers' sessionID, which magpie fills) goes
  as it is when it is a UUID, lower-cased;
- any other id (magpie-<hex>, ses_..., sess_...) goes as a stable UUID
  made from its sha256;
- with no session, a UUID made from the device.
metadata.user_id's session_id is the same UUID, in dress() and marked().

Reviewed at 48013c0, which addresses all four points of the earlier
review (UUID shape, session_id in user_id, rebase onto 0.1.30, no
"Closes #387"):
- TMPDIR=<scratch> HOME=$(mktemp -d) bun test in packages/zcode: 125
  pass, 0 fail. bun scripts/check.mjs zcode passes. Merges cleanly onto
  main.
- With main's index.mjs and the PR's tests: 17 fail (all 7 new session
  tests, plus the start, userid and dual assertions on the header).
- Probe through the plugin's chat.headers and loader fetch, as magpie's
  host calls them (host.js passes sessionID and sets out.headers before
  the fetch): magpie-<hex> twice gives the same UUID in the header and
  in user_id.session_id, and ses_other gives a different UUID. None
  contains magpie, ses_ or sess_.

Not tried: a real BigModel request (the author's hit-rate numbers are the
evidence: 3/12 before, 24/24 after through magpie).
2026-10-26 16:02:38 +08:00
yetone 6bd998a3f8 devin 0.1.24: the CLI sign-in's metadata is all strings (#396)
Releases #396 (metadata.cli saved as "true", so OpenCode 1 keeps the
account). Adds the test #396 lacked: the "Devin CLI's sign-in" method,
with a sandbox credentials.toml and a stubbed GetUserStatus, must save
cli as "true" and every metadata value as a string.

Run: bun test in packages/devin (sandbox HOME): 102 pass, 0 fail.
bun scripts/check.mjs devin passes. With index.mjs put back to
`cli = true`, the new test fails and the other cli-key test passes.
2026-10-26 15:57:33 +08:00
A. S. 5068cc3219 devin: the CLI sign-in saves metadata.cli as a string, so OpenCode 1 keeps the account (#396)
Devin CLI's sign-in saved metadata.cli as the boolean true. OpenCode 1's auth
schema (src/auth Api: metadata Record<String, String>, v1.19.4) drops an
auth.json entry with a non-string metadata value. The account then
disappeared and requests went past the plugin's fetch to the placeholder
URL, which returned 404. The flag is now the string "true". live() only
checks that it is truthy, so entries saved with the boolean (magpie's
mover writes one) keep working in magpie. An OpenCode 1 entry already
saved with the boolean stays dropped until the account signs in again.

Reviewed at 151c72f:
- TMPDIR=<scratch> HOME=$(mktemp -d) bun test in packages/devin: 101 pass,
  0 fail. bun scripts/check.mjs devin passes.
- Probe: a sandbox XDG_DATA_HOME with a credentials.toml and a stubbed
  GetUserStatus fetch, then the "Devin CLI's sign-in" method's callback.
  On main, metadata is {email, plan, cli: true}, and cli is the one
  non-string value. With the PR, cli is "true" and every value is a
  string. live() returns the CLI's key in both cases.
- Checked that whoOfStatus gives plan, orgId and teamId as strings too.

Not tried: a real OpenCode 1 run (the schema was read from the v1.19.4
source).
2026-10-26 15:56:45 +08:00
yetone 07e643018e minimax 0.1.6: the credits show how much of them is used, from MiniMax's credit details (#393)
moxuanchen's card showed MiniMax's credits as a bare balance ("1200
credits"), with no share or bar. The membership answer has only what is
left. MiniMax's own web client (agent.minimaxi.com, prod-web-sh-0.1.230)
lists every batch in Settings → Usage → Credit details (积分明细): GET
/minimax-cloud/api/v1/credit/details with page_number, page_size 20 and
include_expired, answering { details, total_count }; each batch has
credit_type 1 purchased / 2 check-in, granted/consumed/remaining_amount as
decimal strings (commas allowed, a remaining below 0 read as 0) and
expire_at_ms. That is the reporter's endpoint, checked in the client's
own bundle (the npm CLI @minimax-ai/code 0.6.12 doesn't have it).

usage now reads every page of it (signed, to the account host, as the
check-in's minimax-cloud calls go) and adds a Credits window of the
batches not yet expired: used = granted - remaining, amount/limit/unit
"credits", and runsOutAt/runsOut for the soonest batch with credits left.
Beside an M Plan it is aside. A ledger that can't be read whole (an error,
a list shorter than total_count, an amount that isn't one) adds no window
and leaves the balance as before: a part of it would tell a wrong share.

Run: bun test in packages/minimax (nonet, fake hosts): 62 pass 0 fail. On
the old index.mjs the three new tests fail. bun scripts/check.mjs:
minimax ok.
Not tried: a real MiniMax account (no vendor credentials used), so
whether the account host answers this path signed as the check-in is
signed is not seen; if it refuses, the card is as it was.
2026-10-26 15:54:06 +08:00
yetone 634a865346 kiro 0.1.17: credits tell their count, so magpie's "Left" shows what is left (#408)
Fidelxyz switched magpie's usage to "Left" and Kiro's credits still read
as used ("12.5 / 50"). magpie turns a window round only from its count
(amount, limit, unit; quotaCount in app.js): display alone is the
vendor's text, shown as it is. usageOf now gives each Credits and Free
trial window amount = currentUsageWithPrecision, limit =
usageLimitWithPrecision and unit "credits"; display is unchanged.

Run: HOME=$(mktemp -d) bun test in packages/kiro: 57 pass 0 fail. On the
old index.mjs the two usage tests fail (amount/limit/unit missing).
bun scripts/check.mjs: kiro ok.
Not tried: a real Kiro account (no vendor credentials used); the window
shape is the one workbuddy's Credits already shows "left" with.
2026-10-26 15:50:26 +08:00
yetone f32736f015 zen-free 0.1.16: requests go with OpenCode 2.0.25's User-Agent, since Zen refuses the 1.19.0 one 0.1.15 sent
杨梅 (yangmei_61422) on magpie's Discord, 10-26: Zen Free from Kimi
Code/Work fails again ("反代失败") a day after 0.1.15.

Cause, found against opencode.ai from this machine on 2026-10-26: Zen's
free tier now answers 429 FreeUsageLimitError ("Free usage limit
reached. Free models work in OpenCode") to the exact User-Agent 0.1.6 to
0.1.15 sent, OpenCode 1.19.0's
`opencode/1.19.0 ai-sdk/provider-utils/4.0.23 runtime/bun/1.3.14`,
whatever the body says. One request (short system prompt + the <env>
block + the five core tools, our other headers), only the UA changed:
that exact string 429; with provider-utils 4.0.24, bun 1.3.15, opencode
1.19.1, the ai-sdk or runtime part dropped, or an "x " prefix: 200;
"opencode/latest/2.0.25/cli" (what OpenCode 2.0.25 sends,
`opencode/${channel}/${version}/${name}` in its binary): 200. So it is
that one string, the plugin's fingerprint, not a version floor. The env
block is still needed: 2.0.25's UA without it is 429. Path
(/inference/v1), project "global", x-opencode-request and the
x-session-* pair made no difference either way.

Fix: userAgent() is OpenCode 2.0.25's on every protocol, and the header
set is the one captured from 2.0.25 on 10-25: its session id also under
x-session-affinity and x-session-id, no x-opencode-request. A caller's
own session headers still never go on.

Run:
- Real, through the plugin's loader.fetch: a Kimi Code request (its
  system.md rendered, Shell/ReadFile/Glob/Grep/WriteFile/StrReplaceFile/
  SetTodoList with Kimi's own descriptions, UA KimiCLI/1.0) and a plain
  one. At origin/main (0.1.15): deepseek-v4.1-flash-free 429
  FreeUsageLimitError for both. With this change: deepseek-v4.1-flash-
  free, glm-5.3-flash-free and big-pickle 200 for both.
- tools-smoke.mjs, real: big-pickle and mimo-v2.6-flash-free, stream and
  not, 200 with a Bash call.
- Header tests (project identity x4, per-protocol header set x3, the
  streaming one): red on origin/main's provider.mjs (8 of 199 fail),
  green with it.
- HOME=$(mktemp -d) bun test at the repo root: 2675 pass, 0 fail;
  bun scripts/check.mjs: ok.

Not tried: Kimi Code or Kimi Work themselves through magpie (the request
was built from Kimi CLI's installed prompt and tool files); a Responses
or Anthropic free model (Zen lists none free now).
2026-10-26 15:07:51 +08:00
yetone 9da5cd3426 workbuddy 0.1.35: used credits say when the plan's cycle starts again (windy on Discord)
windy's WorkBuddy card in magpie showed 46% of the credits used and,
beside it, "Not used yet". The Credits window had no resetsAt, and
magpie's card says "Not used yet" when no used window has a reset.
WorkBuddy's own client (5.5.6, getCurrentPlan) says the plan refreshes at
the cycle end of the package the summary names as the subscription
(SubscriptionPackageCode). cycleOf now gives the Credits window that
reset (CycleEndTime, UTC+8) and the cycle's span, from the paid and free
lists usage already reads for runsOutOf; none named, not listed or a
cycle already over leaves it unknown, as before.

Run: bun test in packages/workbuddy, sandbox HOME, fetch stubbed: 154
pass 0 fail. On the old index.mjs the two new tests fail (resetsAt
undefined; cycleOf's cases). bun scripts/check.mjs: workbuddy ok.
Real: the summary and paid list of a real WorkBuddy AI Pro account
(2026-10-26, read-only, no renewal) through the new code give Credits
89.2 / 2000, resetsAt 2026-10-28T16:40:52Z, span 30d-1s.
Not tried: a China-site (copilot.tencent.com) account: the desktop
sign-in on this machine is refused (401), so a CN free plan's
SubscriptionPackageCode wasn't seen; without one the card stays as it
was. magpie's card saying "Not used yet" beside a used window without a
reset is fixed in magpie itself.
2026-10-26 15:00:30 +08:00
yetone e5136447b7 skills: magpie-setup, an agent sets magpie up as the user asks
Asked for by Leyuu_5 on X ("功能越来越多,感觉可以来个skill让AI来帮设置需求了").
The skill teaches an agent to read magpie's state, then turn a request
into magpie's own commands: keys and subscriptions, an agent's model,
routing groups with fallbacks and rules (time of day with a zone,
tokens, images, folders, compaction, intent), gateway keys with budgets
and model lists, model names/prices/visibility, and the library's MCP
servers, instructions and web search. It says what to ask before
(replacing, removing, sign-in) and what never to run unasked, and that
a subscription is never set up for another person's use.

What was run: every command in SKILL.md was read from magpie's
internal/cli source at origin/main d2e0ea393 and run against a magpie
built from it, in a sandbox HOME (provider add preset/url/anthropic/
ollama, provider test/models/fallback/off/on/rpm, account-cap,
group add/set models+=/template, every rule form incl.
time=09:00-18:00@Asia/Shanghai and tz=, rule mv/rm, gateway-key
add/list/limit month --cost 20/limit add day --tokens/models, model
name/disable/price/context, visible, library mcp add/instructions,
search add, save/use, claude/codex set and default, healthcheck,
usage, quota). Two magpie bugs found doing so are fixed there
(gateway-key limit <id> month refused; library mcp add with no agents
said every agent had it) and ship with the next tag.
Not tried: accounts add / plugin login (a real browser sign-in),
daemon install, webdav, backup/restore.
2026-10-25 19:12:17 +08:00
yetone 8531ccc532 commandcode 0.1.17: the Credits window comes second, so magpie's account line and menu bar show the plan's dollars (01huadalang on Discord)
01huadalang: "command 的订阅插件没有显示总额度剩余的条子". A Pro, GOAT,
Max or Ultra account reports 5 hours, Weekly and then Credits. magpie's
Providers account line (quotaLine) and the menu bar (trayusage) show an
account's first two windows only, so the Credits bar, the plan's whole
allowance, was never drawn there; it sat in the tooltip. allowanceOf now
puts Credits right after the first window: 5 hours, Credits, Weekly. The
5-hour window stays first, so the Usage card's spark and pace line are
unchanged; Weekly moves to the account line's tooltip. Accounts with one
limit window (Weekly, Credits) or none (Go: Credits alone) are as before.

Not this change: #303 (amount/limit on the Credits window) is held, as
reviewed on it: on every released magpie a window with a limit is
printed as "17.89 / 70" with no "$" in both modes, until magpie formats
a unit "usd" window as money (#301 step 1, not landed).

Run (HOME a temp dir without "magpie" in its path; no-magpie.test.mjs
greps every request for the word and finds the HOME in the Go body
otherwise):
- packages/commandcode bun test: 65 pass, 0 fail.
- bun run check: exit 0, every package.
- Old code: usage.test.mjs's "a Max account: its 5 hours, its credits
  second ..." fails on origin/main's index.mjs (12 pass, 1 fail: Weekly
  where Credits is expected).
- Real account: the owner's GOAT key through hooks.auth.usage now gives
  [5 hours 0.93%, Credits $0.63 / $70.00, Weekly 1.20%] (before: 5 hours,
  Weekly, Credits).
Not tried: a Go, Pro, Max or Ultra account (none here).
2026-10-25 18:56:03 +08:00
yetone 564719b9d9 zen-free 0.1.15: an agent's prompt goes with OpenCode's environment block, so Zen serves it as OpenCode's
杨梅 on magpie's Discord: deepseek-v4.1-flash-free and glm-5.3-flash-free
answered from OpenCode, while the same models from Kimi Work and WorkBuddy
failed at once with 429 (magpie: "额度用尽").

Cause, found against opencode.ai from this machine on 2026-10-25: Zen's
free tier tells OpenCode's requests by the body, not the headers. A
request whose system messages carry OpenCode's environment block (`<env>`,
a `Working directory:` line, `</env>`) is served; one without gets a small
allowance a day, then 429 FreeUsageLimitError "Free usage limit reached.
Free models work in OpenCode", Retry-After to 00:00 UTC. Captured real
OpenCode 2.0.25 (sandbox HOME, MITM with a sandbox CA) and replayed its
request: 200. Its headers with another system prompt, or without tools:
429. Our headers (1.19.0 UA, /inference/v1) with its body: 200, so UA,
path (/inference/openai/v1 vs /inference/v1), session ids, project and
trace headers don't matter. Bisected the prompt to the <env> block: case
sensitive, needs "Working directory:", counts only in a system message
(in a user message or a tool description it doesn't), value free
("unknown", "/" and "" all pass), and still needs tools (the core
stand-ins already sent pass).

Fix: addEnvironment appends "<env>\n  Working directory: unknown\n</env>"
to the agent's first system message (a part of its own for content in
parts, a new first system message when there is none), Anthropic's
`system` and Responses' `instructions` likewise. A prompt that already
has a block, as OpenCode's does, goes as it is. The directory isn't known
in the plugin and the agent's own prompt says it, so it is said as
unknown, not a path that would mislead the model or leak the user's.

Run:
- Real, through the plugin's loader.fetch from this machine (whose
  non-OpenCode allowance was used up): a WorkBuddy-like request (its own
  system prompt, a Read tool, WorkBuddy UA) at origin/main's provider.mjs:
  deepseek-v4.1-flash-free 429 FreeUsageLimitError (2.3s), glm-5.3
  stream 429 (1.8s), the reporter's case. With this change: deepseek 200,
  glm-5.3 stream 200, big-pickle 200.
- tools-smoke.mjs, real: big-pickle and mimo-v2.6-flash-free, stream and
  not, 200 with a Bash call.
- New test, per protocol: the block added once after the agent's prompt,
  added with no prompt and for content in parts, added when the block is
  only in a user message, an OpenCode prompt left as it is. Red on
  origin/main's provider.mjs (3 of 3 fail), green with it.
- HOME=$(mktemp -d) bun test at the repo root: 2670 tests, 0 fail;
  bun scripts/check.mjs: ok.

Not tried: a Responses or Anthropic Messages free model against Zen
(Zen lists none free now; all eight are Chat), so where Zen looks for the
block on those two is a guess from Chat's. Kimi Work and WorkBuddy
themselves weren't run; their request was built by hand.
2026-10-25 18:33:40 +08:00
yetone 57598ad410 zcode 0.1.30: a coding plan's requests name the device in metadata.user_id, as ZCode's do (#387)
wendyeq measured BigModel's GLM Coding Plan through magpie hitting the
prompt cache 1 time in 19 without metadata.user_id and 13 in 16 with it;
the official ZCode on the same account reads 95-98% of input from cache.
The plugin only put user_id on the Start Plan's dressed body; a coding
plan or team request went as the agent sent it, and Pi sends none.

ZCode 3.14.3 (glm/zcode.cjs) sets it on every Anthropic-format request,
not only the Start Plan's: Pst() returns MLs({deviceMid, sessionId}) for
any providerKind "anthropic", and vWr() puts it in
providerOptions.anthropic.metadata.userId for both generateText and
streamText. The value is {"device_id":<machine id>,"account_uuid":"",
"session_id":...}.

Now a coding plan or team request to .../v1/messages gets
metadata.user_id = {"device_id":<sign-in's saved device>,
"account_uuid":"","session_id":""}, the same value dress() puts on the
Start Plan's, when the agent sent no user_id of its own; other metadata
is kept and content-length dropped when the body changed. count_tokens
and non-Messages bodies go as they were. An account known only by a key
(a pasted API key, or a saved state with no device) gets a device id
hashed from the key, so it is the same on every start rather than
anyDevice, which was new per process.

Differences from ZCode, kept on purpose: ZCode overwrites any user_id
and fills session_id with its session (sess_ prefix stripped); this
keeps an agent's own user_id and sends session_id "" as dress() does,
one stable value per account.

Tests: userid.test.mjs (new, 6 tests; 5 red on origin/main's index.mjs,
the count_tokens one passes there as it should). start, toolsearch and
dual tests that pinned coding plan bodies byte for byte now expect the
agent's body plus the device's user_id.
Run at this tree: HOME=$(mktemp -d) bun test -> 2672 pass, 1 skip,
0 fail across 229 files; bun scripts/check.mjs ok.
Not tried: a real BigModel or Z.ai coding plan request, so the cache
hit rate after the change is the reporter's measurement, not mine.
2026-10-25 18:25:51 +08:00
wang2 6188ab5be7 search1api 0.1.0: Search1API's six tools with API key or OAuth sign-in (#384)
Adds packages/search1api as @magpie-community/tools-search1api 0.1.0
(fatwang2, replacing #340). It has six tools: search, news, ask, crawl,
sitemap and trending. Sign-in is one account by API key or OAuth: PKCE
S256, dynamic client registration and a loopback callback. Tokens refresh
through auth.refresh and on a 401. scripts/check.mjs now accepts a tools
plugin with auth and no loader, as long as its config gives the provider
no npm and no models.

Run at 7cf6a5c merged onto main, in a sandbox HOME, with HTTPS_PROXY
pointed at a dead port:
- bun test packages/search1api scripts/check.test.mjs: 19 pass.
- node --test on the package's own tests: 16 pass.
- tests/host.integration.mjs against main magpie's host.js: 2 pass.
- bun test across the whole repo: 2647 pass, 0 fail. This needs 017f05c.
  Before it, gcp-ai's fetch guard refused this package's loopback
  fixtures in the shared bun process.
- bun scripts/check.mjs: all ok.

Broken by hand, each one red:
- Dropping the SAME_SESSION check before a refresh: 1 test.
- Never refreshing an expired token: 3 tests.
- Ignoring the apiKey option: 4 tests.
- Not red: dropping the second check, which catches a logout during an
  in-flight refresh. The first check covers it in the logout test.

Real use:
- A sandbox magpie took the package with `plugin add`. `plugin list`
  shows its 6 tools. `plugin login search1api 2` with a key showed
  Providers as "Search1API · signed in as API key …-384 · no models
  exposed".
- The search tool ran against the real api.search1api.com with a fake
  key and got 401.
- OAuth discovery is live: oauth-protected-resource points to
  clerk.s1.dev, which has a registration endpoint and S256.

Not tried:
- A real OAuth consent, or a search with a real key. There is no
  Search1API account here.

Notes:
- The plugin reads the signed-in record from
  `<directory>/plugin-auth.json` itself, since tools get no getAuth.
  magpie writes that file by temp-and-rename, so a read never sees half a
  write.
- magpie's login line says "its models are search1api/<model>" for a
  provider with no models. That is magpie's wording, not this PR's.
2026-10-25 17:53:00 +08:00
yetone 017f05cbb9 gcp-ai tests: the network guard lets another package's loopback fetch through
gcp-ai's test/network.mjs (from #307) replaced globalThis.fetch with one
that refuses every call. bun test runs every package in one process, so
the guard outlived gcp-ai's files: with #384 merged on top, all eight
Search1API tests that fetch their own 127.0.0.1 fixture failed with
"Unexpected network fetch in test: http://127.0.0.1:…/search" in the
repo-wide run, and passed alone. fetch now refuses only a non-loopback
host, as the socket, http and dns hooks beside it already did. The real
fetch stays inside the module, never on globalThis.

Run (sandbox HOME under TMPDIR, HTTPS_PROXY at a dead port):
- bun test packages/gcp-ai: 40 pass, 1 skip, 0 fail.
- A script importing the guard: a Bun.serve loopback fetch answers "ok";
  https://example.com is refused and the process exits 1.
- bun test (whole repo) with this file over #384's merge: 2647 pass,
  1 skip, 0 fail. Without it: 2638 pass, 9 fail (8 Search1API, plus one
  gcp-ai Chrome test that lost its CDP connection, which passed in the
  next run).
- bun scripts/check.mjs: every package ok.
2026-10-25 17:52:37 +08:00
yetone 5c9b7a4137 zcode 0.1.29: a sign-in keeps the account's user id beside its name
wakkana on Discord reported WorkBuddy accounts of one name collapsing
into one. WorkBuddy's plugin already keeps a uid, which magpie's plugin
host tells same-name accounts apart by. ZCode names an account by email,
else by its name, and gave no uid, so two ZCode accounts with no email
and one name were one account in the host. Both sign-ins (browser and
the ZCode app's) now give uid: user_id. The app's entry also follows
ZCode only while ZCode is signed in to the same user id, not another
account of that name.

Run: HOME=<scratch> TMPDIR=<scratch> bun test in packages/zcode, 112
pass. Both new tests (own.test.mjs, team.test.mjs) fail with index.mjs
from HEAD (uid undefined). bun scripts/check.mjs green.
Not tried: a real ZCode sign-in; whether ZCode's poll user carries
user_id is read from who(), which already reads it.
2026-10-25 17:37:19 +08:00
Kun Songandbborn2 36d8902601 cursor 0.2.23: send cursor-agent's team in x-cursor-team-id (#231)
cursor-agent sends the team a request is billed to in `x-cursor-team-id`, from
cli-config.json's `authInfo.activeTeamId`. Without it, Cursor takes the
token's default team. In an organization that team may have on-demand spend
turned off, and the request then fails with "Team budget limit reached".

The plugin now sends the same header on Run (both the native and the stateless
path) and on the dashboard calls. It takes the team only when the token's
`sub` is the config's `authInfo.authId`, so an account signed in from magpie
never gets another account's team. GetHardLimit and GetCurrentPeriodUsage still
go out with `{}`, as cursor-agent sends them. GetFilteredUsageEvents names the
team only when there is one. The config's location (CURSOR_CONFIG_DIR, then
$XDG_CONFIG_HOME/cursor, then ~/.cursor) and the team check (a positive
integer) match cursor-agent 2026.10.01's paths.js and request.js.

Run at d4476ff merged onto main 1fbe22b, in a sandbox HOME, with the network
pointed at a dead proxy:
- `bun test` (whole repo): 2640 pass, 0 fail. `bun test packages/cursor`:
  303 pass. `bun scripts/check.mjs cursor`: ok.
- Broke each change by hand, and team-id.test.mjs went red each time (11 pass,
  1 fail): the header removed from runNative, the header removed from runOnce,
  and the team put back into GetCurrentPeriodUsage's body.
- Real Cursor account (no team) through the plugin's loader: one chat turn with
  a config that has no team, and one whose activeTeamId is a team the account
  isn't in. Both returned 200 "ok", so a single-team account is unchanged. The
  author ran a real account in two teams: the budget-spent team returned 429,
  the other returned 200.

Not tried: a multi-team account here. Accounts signed in from magpie get no
team (#233 covers those).

Co-authored-by: bborn2 <bborn2@users.noreply.github.com>
2026-10-25 17:37:12 +08:00
yetone 60b9abf2bc qoder 0.2.37: a QwenWork personal account's usage shows what is left, with each pool, instead of "no credits" (#385)
Cause: the public cloud's account-context answers a personal account's
quota with total and used null and only remaining (the reporter's
{"total": null, "used": null, "remaining": 2098.6336, "exceeded": false}).
parseAccountContext made a window only from total > 0, so every such
account read as "QwenWork: the account reports no credits". The usage
hook already read the account-context on site.usagePath, not Qoder's
/sash/api/v2/me/usage (that is the qoder path); the comment naming a
fetchSiteUsage that doesn't exist is corrected.

What QwenWork's own client reads, from QwenWorkCN.app 1.2.1's
app.asar out/main/main.js: fetchQuotaUsage reads
/api/v1/adapter/user/account-context?include=user,plan,quota,page,data_sharing
(unwrapAdapterResponse: the data object, else the envelope), and for a
personal account fetchUserWallets reads /api/v1/adapter/user/wallets,
taking daily_credits, monthly_credits and longterm_credits'
total_balance (mergeWalletsIntoCreditBreakdown).

Now: remaining is the card's balance, "2098.63 credits (daily 98.6 ·
long-term 2000)", with no used share made up; an account with a total
keeps its used / total window; remaining 0 or exceeded is a spent
window. The wallets are asked on the public cloud only, never for a biz
account or the enterprise flagship (the client doesn't either), and a
failed wallets read leaves the balance without pools. The envelope is
read wrapped in data or bare.

Not changed: an enterprise account on the public cloud, which the
client reads from /api/v2/quota/usage, still reads the account-context.

Run (bun 1.4.2): bun test in packages/qoder, 238 pass, 0 fail; bun
scripts/check.mjs, rc 0. The 5 new tests in qwenwork.test.mjs (built
from the reporter's bytes) fail on the old index.mjs, 14 pass 5 fail.
Probed gateway.qwenwork.cn with a bad token: wallets and
account-context answer 401, /sash/api/v2/me/usage 404.
Not tried: a real QwenWork account (none on this machine).
2026-10-25 17:33:27 +08:00
yetone 1fbe22b3ad kimi-work 0.1.11: a usage read that fails says why on the card and keeps the Work sign-in
泠夜Soul (Discord), latest magpie and kimi-work 0.1.10: the Kimi Work
usage card says only "暂时无法获取额度", with no error anywhere.

Cause: auth.usage threw on every failure. magpie puts a plugin's reason
on the card only when usage returns it as `error` (quotaOfPlugin sets
PluginError; app.js quotaError then says "暂时无法获取额度:<why>"). A
thrown error reaches the card as the bare text, with the reason in a
tooltip. The read uses Kimi's web sign-in (credentials.kimiWeb.accessToken),
not the Work token chat uses. Kimi desktop 3.2.20 rewrites that token in
daimon config.json only while it runs (its token-change sync). Once the
desktop is closed, www.kimi.com answers it 401 "Session expired"
(REASON_INVALID_AUTH_TOKEN), the same stale token 0.1.10 found on the
menu. That 401 was thrown as expired() with signIn "expired", so magpie
also marked the Work account signed out while chat still worked. The
header changes in 0.1.8-0.1.10 aren't the cause: signed out or with a
bad token, GetSubscriptionStats answers the same 401 with or without the
x-msh headers. Their effect with a valid token wasn't seen.

What changed:
- usage never throws on a failed read. It returns
  {windows: [], error, signIn: "kept"}. A 401 says
  "Kimi 网页登录已过期,打开一次 Kimi 桌面版即可刷新额度(对话不受影响)",
  in words that magpie's signInGone doesn't take for a lapsed sign-in.
  Other statuses keep their HTTP code. Each failure is logged without the
  token.
- subscriptionBalance is read in camelCase or snake_case. A balance
  whose amountUsedRatio Connect JSON left out (zero) reads 0% used.
  Before, that gave no window at all. A reply with no balance says so.
  Field names are from the desktop's membership.v2 descriptor:
  subscription_balance is optional in GetSubscriptionStatsResponse.

Run at this tree (origin/main 743e8af + this change), macOS, bun:
- bun test packages/kimi-work: 53 pass, 0 fail. With index.mjs put back
  to 743e8af's: 50 pass, 3 fail, the three usage tests: 403 refused,
  stale web sign-in (fixture: www.kimi.com's literal 401 body, curl
  10-25), and zero-omitted / snake_case / missing balance.
- Live: createPlugin's auth.usage against the real www.kimi.com with a
  stale-shaped web token. New code returns the error above with
  signIn "kept". 743e8af's throws "请先在本机 Kimi 桌面版登录 Work…" with
  signIn "expired".
- HOME=$(mktemp -d) bun test: 2628 pass, 0 fail.
- bun scripts/check.mjs: every plugin ok. git diff --check clean.

Not tried: a signed-in Kimi Work account (none on this machine), so the
reporter's actual failure isn't seen. This release puts it on their card
and in the log. If it's the stale web token, opening Kimi desktop
refreshes it.
2026-10-25 17:13:43 +08:00
yetone 743e8af3b4 qoder 0.2.36: Anthropic's <function_calls><invoke> and Qwen's bare <function=…> calls written as text are read as calls (#323)
trae 0.2.19's sibling. qoder's Splitter read a text-written call only
inside <tool_call>, so a bare Qwen <function=compress><parameter=…> or an
Anthropic <function_calls><invoke name="…"> block (with or without the
namespace prefix) went to the agent as reply text. And parseCall
JSON-parsed every parameter, so a string parameter holding [1, 2] became
an array.

- Splitter takes the request's tools (none under tool_choice none) and
  reads both shapes bare (xmlCall), only for a declared tool, never in
  backticks or a code fence. A tag split across chunks is held, never
  text; the closes and blanks after a call are dropped; one cut short
  ends the turn with the CUT_SHORT error, as <tool_call> blocks do.
- A parameter's value is its text where the tool's schema says string,
  else JSON, here and in <tool_call>'s <function=…> form.
- README says so.

Run at this commit (base origin/main d248efa), HOME and TMPDIR a sandbox
dir, network at a dead proxy:
- packages/qoder: bun test, 233 pass 0 fail. New xmlcall.test.mjs (8
  tests) uses trae's samples (01huadalang's screenshots): whole, in pieces
  of 1/2/3/5/7/13/64, split in two at every offset, namespaced, cut short,
  undeclared, prose/backticks/fence, and sample 2 through the plugin's
  fetch over a fake Qoder SSE, streamed and not (finish tool_calls).
  6 of 8 fail on the old index.mjs.
- Broken by hand, each red then restored: the declared-tool check (1
  red), XML_HOLD out of the hold (3), leftovers kept (4), schema typing
  (1), the backtick check (1).
- Root `bun test` (every package in one process, as CI): 2626 pass 0
  fail. bun scripts/check.mjs: qoder ok.
Not tried: a real Qoder model writing these shapes; none has been seen
doing it yet.
2026-10-25 15:18:16 +08:00
yetone d248efa7a1 workbuddy 0.1.34: a free account's plan is "Free plan", not "Free" (#337)
Buger2008 read the "Free" beside their WorkBuddy account in Providers as
the model they picked (Deepseek-V4.1-Flash, 0.11x) being free, and as why
routing chose WorkBuddy first. It is the account's plan; routing doesn't
read it. The label now says it is a plan. Nothing in magpie or the plugins
compares a plan to "Free" (grepped internal/ and packages/).

Run: bun test in packages/workbuddy, sandbox HOME, network at a dead
proxy: 152 pass 0 fail; on the old index.mjs the 4 tests that say the
label fail. bun scripts/check.mjs: workbuddy ok.
Not tried: a real WorkBuddy account in the GUI.
Siblings: trae ("Free", d.plan || "Free") and mimo (plan "Free") say the
same; filed as their own issue.
2026-10-25 15:06:45 +08:00
yetone 9a52d96cec gcp-ai: the tests' fake gcloud runs on the test's own runtime, not PATH's node
publish.yml has been red since e801e43 (#307): 20 gcp-ai tests fail with
"gcloud could not read Google Cloud credentials or configuration". CI runs
every package in one bun process from the repo root. grok's nocli.mjs
sets PATH to /usr/bin:/bin for the rest of that process, and setup-node's
node is not there, so the fake gcloud's `#!/usr/bin/env node` could not
start. Run alone, gcp-ai passed, which is how the merge was verified.

The fake's shebang now names process.execPath. The fake stays pinned by
path in each test and CLOUDSDK_CONFIG stays under the test's own HOME.

Run: `bun test packages/grok packages/gcp-ai` from the repo root, with
HOME a sandbox dir and the network pointed at 127.0.0.1:9: 20 fail before
(the CI list, plus "closing a login waits..." at its 30s bar), 122 pass
0 fail after. Full root run `HOME=<sandbox> bun test` and
`bun scripts/check.mjs` at the pushed head: see below. Linux: the 5
browser tests pass in oven/bun:1.4.2 with apt chromium (--no-sandbox
wrapper through VERTEX_CHROME_PATH), the passive sign-in one in 11s.
2026-10-25 14:54:25 +08:00
yetone ebe3555b30 qoder 0.2.35: a oneOf of objects with no type reaches kmodel typed object (#378)
congee949 found that qoder-cn's kmodel_latest (Kimi K3.1 Pro) fails with
502 on dsh's REA tools because of a oneOf with no type whose branches are
all objects. With "type": "object" beside each such oneOf, the same
requests got 200 in a real dsh run. qoderBody now sends each tool's
parameters through typedUnions, which types such a oneOf object when each
branch is typed object, directly or through local $refs. Other unions,
anyOf, and missing, external or circular $refs are left alone. The work is
done on a copy, so the client's schema is not changed. This is the same
rule workbuddy 0.1.33 applies.

Run: `bun test` in packages/qoder with a sandbox HOME/TMPDIR and a dead
HTTPS_PROXY: 225 pass, 0 fail. `bun scripts/check.mjs qoder`: ok.
Broken by hand: with qoderBody sending parameters unchanged,
schema.test.mjs goes 1 red. Not tried: a real Qoder account.
2026-10-25 14:54:25 +08:00
yetone def6a83584 workbuddy 0.1.33: a oneOf of objects with no type reaches Kimi typed object (#378)
congee949 found that kimi-k3.1-pro on workbuddy and workbuddy-ai answers
400 "Invalid request parameters" to a tool whose parameters hold a oneOf
with no type. This happens even when every branch is an object, either as
a $ref's target or deeper in it (dsh's REA tools). The same request with
"type": "object" beside the oneOf gets 200, in three real dsh runs with
all 198 tools. fitTools now runs typeUnions after fitShape. typeUnions
gives such a oneOf type "object" when each branch is typed object, either
directly or through a chain of local $refs. A union of other or mixed
types, an anyOf, and a $ref that is missing, external or circular are left
as they came. Only schema keywords are walked, so examples and defaults are
not.

Tests use the issue's literal parameters: the minimal $ref → oneOf, the
nested oneOf that all three routes refused, and the REA $ref-branch case.
They also cover what is left alone.

Run: `bun test` in packages/workbuddy with a sandbox HOME/TMPDIR and a dead
HTTPS_PROXY: 152 pass, 0 fail. `bun scripts/check.mjs workbuddy`: ok.
scripts/try.sh with magpie origin/main 4dfd88206 lists workbuddy (15) and
workbuddy-ai (16). Broken by hand: with the typeUnions call taken out of
fitTools, tools.test.mjs goes 1 red; with $ref branches not followed, 1 red.
Not tried: a real WorkBuddy account. The rule is the one the reporter
verified on the live API.
2026-10-25 14:54:25 +08:00
yetone f0bd94c4e2 cursor 0.2.22: a heartbeat keeps a counted tool batch open, and its failure says how much came (#377)
Okxdd123's grok-4.7 step counted its batch, thought, then wrote one long
call for over 30 s with only heartbeats, and failed as "Cursor did not
complete its declared native tool batch". batchWait was reset by a
call, answered call, count or text, never a heartbeat, so a single long
call's arguments could not outlast it. A heartbeat (InteractionUpdate
13) now resets it while the batch is open; silence stays bounded by
idle (60 s) and a heartbeat-only stretch by quiet (240 s), as #2672 set.
The failure now reads "N of M calls came, K answered here, none since
X ms", the counts the report asked for.

Not changed: the issue's third ask, a stateless rebuild for this
failure. A streamed reply has already shown its reasoning by then, and
the rebuild only runs before output is exposed.

Run: the two new native-session tests and the updated #155 test are red
on the old code (3 fail) and green after; bun test packages/cursor 291
pass in a sandbox HOME; bun scripts/check.mjs ok. Not tried live: it
needs a real Cursor step writing one call for over 30 s.
2026-10-25 14:44:44 +08:00
yetone 2d59003f8e zcode: the team seat's request test uses a key of its own
start.test.mjs's "a team seat's request goes as the agent sent it" used
key "team.secret", the same as team-gift.test.mjs. In one bun test
process the two files share index.mjs's routes cache (key + jwt), and
when both jwts were built in the same second the seat test read
team-gift's cached route, skipped the billing/balance read and saw 1
request where it expects 2. That kept publish.yml red since ba343b8, so
zcode 0.1.28 (and every other package) never published.

Run: with both files' jwt exp pinned to one value, `bun test
./team-gift.test.mjs ./start.test.mjs` fails the seat test on the old
key and passes 19/19 with "seat.secret". Whole-repo `bun test` (HOME
under TMPDIR, as CI): zcode all pass; the 20 reds are gcp-ai's, which
another session is fixing. `bun scripts/check.mjs` ok.
2026-10-25 14:38:06 +08:00
cuddlesgiggles d467d29746 cowork 0.1.0: Tuanjie Cowork on magpie's Agents page (#239)
Adds @magpie-community/agent-cowork 0.1.0 (Tuanjie Cowork on magpie's Agents page) and its registry entry. The agent writes the one key defaultChatModelTitle in ~/.codely/ide-settings.json. seed.mjs copies magpie's catalog into Cowork's store, and prunes, relabels and removes only the entry ids recorded in settings.json.magpie-seeded.

Re-reviewed at cbe10c949940b75c6ac2b4cdcc2fe9a92ae6830c against the three earlier change requests (items 1-8, adoption by address, prune hold, relabel and selection).

What was run at cbe10c949940b75c6ac2b4cdcc2fe9a92ae6830c (it merges cleanly onto main b074782):
- bun test packages/cowork: 50 pass. node --test: 50 pass. node scripts/mutate.mjs: all mutations caught. bun scripts/check.mjs cowork: exit 0.
- seed.mjs in a sandbox HOME against a fake /v1/models on a random port, with the owner's fixture: custom-provider (a/one "One on my endpoint"), a user provider my-magpie at magpie's address (a/two "My Two", my-local "My Local"), and defaultChatModelTitle "My Two".
  - First run: +1 (a/three). Neither of the user's entries was touched or renamed. The record holds only magpie:a/three, and the selection is unchanged.
  - A user-added magpie:my-own survived seeding, --prune and --remove ("left 1 you added under it yourself").
  - Catalog shrunk to [a/one] with a/three selected: plain run held the entry ("pass --prune"), --check reported "1 held". --prune dropped a/four but kept the selected a/three.
  - An unreadable ide-settings.json makes the run refuse to write anything (exit 2).
- magpie (main 4dfd88206) in a sandbox via scripts/try.sh: magpie ls lists Tuanjie Cowork. magpie cowork fakeco/fake-model wrote only defaultChatModelTitle. magpie cowork default restored the file byte for byte.
Not run: Cowork itself (Windows). The author sent a real message through Cowork on magpie at 92c9b22 and d79a60f (logs quoted in the PR).
2026-10-25 14:33:36 +08:00
Yaka e801e434f3 gcp-ai: Vertex models and Google Cloud credits with your own gcloud ADC (#307)
New package gcp-ai (Yaka88): Vertex models and Google Cloud credits through the user's own gcloud ADC, with multiple accounts, a signed-in model list, and a pipe-only Chrome for the credits read.

Reviewed at 8989b58 against the 10-24 review at 4586c99. I read the whole incremental diff (index.mjs, lib/browser, lib/credentials, lib/lock, test/*). Earlier rounds had already reviewed the rest.
- Tests reaching the network: fixed. test/network.mjs replaces fetch and blocks non-local net/tls/http/dns. `bun test` (40 pass, 1 skip [Linux-only lock test], 0 fail, 106s) ran in a sandbox HOME/TMPDIR behind a dead HTTPS_PROXY, with a preload that logged non-local fetch and connect calls: 0 lines logged. Broken by hand: with the fetch stub removed from "already filed", the guard prints "Unexpected network fetch … userinfo" and bun exits 1. Restored, it exits 0.
- Chrome background traffic: lsof on the test Chrome processes (56 samples during browser.test.mjs, 5 pass) found no inet sockets at all.
- Leftover work after a test: close() now awaits settled, and every sign-in test closes in finally before restoring fetch.
- Smaller points: the lock's age ceiling now comes after the Linux /proc check; settings() is auth > options > env for every field; resolveAdcDirectory and authorizeAdc are removed.
- `bun scripts/check.mjs gcp-ai`: ok. The merge onto main 98985a2 is clean. Loaded into magpie's plugin host (origin/main 4dfd88206) with scripts/try.sh in a sandbox HOME: gcp-ai, 12 models, not signed in.

Not tried: a real Google account or gcloud sign-in, Windows, Linux (the lock test is skipped on macOS). The headless Console credits scrape still runs for every signed-in account, cached on failure, as noted in the earlier review.
2026-10-25 14:33:15 +08:00
yetone 98985a2426 codearts: the credit fixture's check-in stays on its sign-up's Beijing day at any hour (#322)
creditFetcher put the check-in 52s after a sign-up taken from the wall
clock, so in the last 52s of a Beijing day it fell on the next day and the
usage test read runsOut 4000, not 5000. The sign-up is now noon in Beijing
of the same day, so the check-in a minute later can't cross midnight.

Test only; the plugin is unchanged, so no version bump.

Run: bun test packages/codearts under TZ=UTC, Asia/Shanghai and
America/Los_Angeles (sandbox HOME): 109 pass. The new guard test (now 30s
and 1ms before Beijing midnight, at it, and at noon) is red with the old
fixture (1 fail) and green with the new. bun scripts/check.mjs codearts: ok.
2026-10-25 14:28:06 +08:00
yetone b46bcfcf9f nous 0.1.1: a null or string expires_in beside a valid JWT exp takes the exp, so the sign-in stays usable (#328)
token() counted any present non-number expires_in as a malformed bound
and set expires = 1 even when the access token's JWT exp was valid, so a
renewal recorded unusable_inference_jwt and every request failed. Like
Hermes's _remaining_ttl, a null or non-numeric expires_in is now ignored
when the JWT carries a finite exp. With no valid exp it is still a
malformed bound (expires = 1), and a numeric expires_in <= 0 or
non-finite still is too.

Run: TMPDIR/HOME under the scratch dir, bun test packages/nous, 56 pass;
the new test is red on 0.1.0. bun scripts/check.mjs nous ok. Not tried
against the real Nous Portal.
2026-10-25 14:26:39 +08:00
yetone d43b228463 layerfs 0.7.3: workspace paths sit under ~/.layerfs-tools, so a tool result no longer names magpie (#360)
provision, resolve and exec answer the workspace's path, and a tool
result goes to the vendor in the agent's next request. With the default
root ~/.magpie-layerfs every provision named magpie upstream.

The default root is now ~/.layerfs-tools. A ~/.magpie-layerfs made by
0.7.2 or earlier is renamed to it once, at the first backend made, and
a link is left at the old path, so a session still holding an old
workspace path keeps working. A legacy root that is itself a link (the
user's own setup) is used where it is, as is one the rename is refused
on. MAGPIE_LAYERFS_HOME set by the user is unchanged. A second host
racing the rename finds the new root and uses it.

Run, in a sandbox HOME:
- bun test packages/layerfs: 53 pass, 0 fail. bun scripts/check.mjs
  layerfs: ok.
- The three #360 tests against the old default (defaultRoot answering
  ~/.magpie-layerfs): 2 of them red, the third (a user's link) is
  unchanged behaviour.
- Through magpie's real plugin host (origin/main 4dfd88206,
  plugin.Add of this package + plugin.RunTool "provision" in a
  testenv sandbox HOME): a fresh home answers
  ~/.layerfs-tools/workspaces/demo/main and makes nothing at the old
  name; a home with a ~/.magpie-layerfs holding a marker answers the
  new path, the marker is under ~/.layerfs-tools, and ~/.magpie-layerfs
  is a symlink.

Not tried: Windows (the link is a junction there), and moving a root
while an agent's exec runs in it.
2026-10-25 14:26:30 +08:00
yetone c02957a40b layerfs: the tests' cleanup hooks get a 120s bar, not bun's 5s (#362)
Both test files remove every temp dir in one afterAll. On a loaded box
that took 6-7.5s and went red against bun's default 5s hook timeout.
The hooks now carry their own bar.

Run: with a 7s Bun.sleepSync injected into layerfs.test.mjs's hook,
the old bar fails ("a beforeEach/afterEach hook timed out", 28 pass
1 fail) and the new one passes (28 pass 0 fail). Test-only change, so
no version bump.
2026-10-25 14:26:30 +08:00
yetone b07478285c zcode 0.1.28: a key's route is read again with each card read, after a Start Plan refusal, and a minute after one list without its plan (#369, #379)
Also publishes #371 (a team seat lists the person's gift plans and their
-Trial models, 935ddb5), which landed without a version bump.

#369: a BigModel GLM Coding Plan account got the Start Plan's 405 for about
seven minutes on plain models, then recovered with nothing changed. A plain
model goes to the Start Plan only when plansOf says start, i.e. the key's
/api/biz/subscription/list read with no VALID plan, and that answer was
kept for ten minutes. Now:
- a key whose list reads no plan where the last read found one keeps that
  for a minute, not ten (read the same way again, it is known: ten);
- a Start Plan refusal (405 / 3012 / block page) on a key account that
  wasn't a -Trial pick drops the route, so the next request reads the
  plans again.
Not known: what the list answered during the reporter's window; this is
the one path in the plugin that sends a plan-holding key's plain model to
zcode.z.ai, and it matches the window's length.

#379: the card's numbers are read fresh on every usage call already; what
lagged was the route (which plan, which gift) for up to ten minutes. Each
usage read now reads the route again, so routing follows what the card
shows.

Run: packages/zcode, Bun 1.4.2, sandbox HOME and TMPDIR: 110 pass, 0 fail.
The three new dual.test.mjs cases are red on 0.1.27+935ddb5's index.mjs
(3 fail). bun scripts/check.mjs zcode ok. Loaded through magpie's plugin
host (origin/main 4dfd88206, scripts/try.sh, sandbox HOME): zcode listed
with 4 models.
Not tried: against a real account; no account was in the sandbox.
2026-10-25 14:25:56 +08:00
Littlefish 3a59be3caf qoder 0.2.34: QwenWork (千问办公), the public cloud and the enterprise flagship (#319)
QwenWork (千问办公) is served from the qoder package as two more provider ids, as the ruling on #313/#314 asked: `qwenwork` (gateway.qwenwork.cn, the desktop client's device flow and account-context usage) and `qwenwork-enterprise` (the enterprise flagship on the enterprise's own domain, asked at sign-in or preset by QWENWORK_ENT_DOMAIN). Chat, the model list and the queue are signed for the site (ClientType 6, scene qwork, cosy 1.1.59, product qoder_work). No PAT and no check-in for QwenWork, so Qoder's desktop identity never reaches it. Qoder and Qoder CN are unchanged.

Reviewed at c543f1b (on main 8d687ad; main has no qoder or registry change since), by @LittlefishStudent.

Run at c543f1b, sandbox HOME and TMPDIR, network pointed at a dead proxy:
- packages/qoder `bun test`: 223 pass, 0 fail. `bun scripts/check.mjs qoder`: ok.
- Broken by hand, one at a time: the queue status signed without its site, 1 red; the usage 401 rotation removed, 1 red; the site's system prompt ignored, 1 red; the enterpriseHost routing removed, 6 red.
- Read every call of the changed signatures (cosyHeaders, userBlob, queueStatus, queueWait, qoderBody): each passes the site, and a Qoder site has none of the new fields, so its requests are as before (the earlier review's recording probe found them byte-identical).
- magpie origin/main 4dfd88206's plugin host, sandbox HOME (scripts/try.sh qoder): qoder 17 models, qoder-cn 4, qwenwork 3, qwenwork-enterprise 3.

Not tried against the real API here: no QwenWork account in the sandbox. The author ran sign-in, chats and usage against a real deployment.
2026-10-25 14:25:39 +08:00
yetone 1bd45a8d17 autoclaw 0.2.8: the credit balance is the card's balance, not a meter reading "剩余 100%" (#376)
moxuanchen: AutoClaw's credits are a bare balance with no limit and no
amount used, but usage() also sent them as a window with used: 0, so the
card read "500 积分 · 剩余 100%" whatever was left. The total, and the
wallets it breaks into, now go in balance only ("1234 积分(赠送积分 500 ·
会员积分 734)"). The daily check-in row stays a window.

Not changed here: magpie's card gives every window a share, so an aside
row that only carries text (the check-in row here, and the same pattern
in cline, cursor, factory and zcode) still shows "· 0% used / 100% left".
That is magpie's rendering, not this plugin's.

Run: HOME=<scratch> bun test packages/autoclaw, 38 pass; the new test is
red on 0.2.7. bun scripts/check.mjs autoclaw ok. Not tried against the
real API.
2026-10-25 14:25:33 +08:00
yetone ae2ed19e47 autoclaw 0.2.7: on Linux, X-Tm is "linux-x64" as the official client sends, not the "linux" the overseas gateway refuses (#367)
menhouran found that autoglm-api.autoglm.ai answers X-Tm "linux" with
403 {"message":"forbidden"} for a valid token, and "linux-x64" (what the
official AutoClaw Linux client sends) with 200. The plugin built X-Tm
from process.platform, so every overseas chat on Linux failed and read as
"AutoClaw 登录已失效". X-Tm is now mac / win / linux-x64; the User-Agent
keeps "(linux-x64)" from process.platform and process.arch as before.

Not changed: both hosts answering 403 is still reported as an expired
sign-in. The plugin's tests deliberately treat a bare 403 that way, and
what an expired token gets from this gateway hasn't been seen, so the
mapping is left alone.

Run: HOME=<scratch> bun test packages/autoclaw, 37 pass; the new test is
red on 0.2.6. bun scripts/check.mjs autoclaw ok. Not tried against the
real API or on Linux.
2026-10-25 14:25:33 +08:00
7% ba343b84ea workbuddy 0.1.32: a Claude model is served on Messages, where effort (max included) is honored (#346)
WorkBuddy's China build serves its Claude models on Anthropic's Messages API (<endpoint>/v1/messages). A Claude model there is now `@ai-sdk/anthropic` and goes to Messages, where `output_config.effort` (max included) is honored. Every other model, and every WorkBuddy AI model, stays on chat. A Messages body goes as sent, minus thinking blocks with no signature, and goes once more without thinking when WorkBuddy refuses a signature it didn't make (11159). count_tokens goes on the Messages route too. One Claude Code send keeps one turn id (#48).

Reviewed at 9e0eb2b (rebased on main ba9801c; workbuddy unchanged from the 39f71a7 the author answered the last review with), by @waynesguan.

Run at 9e0eb2b, sandbox HOME and TMPDIR:
- packages/workbuddy `bun test`: 149 pass, 0 fail. Run again with HTTP(S)_PROXY pointing at a dead port: 149 pass, so no test reaches the network.
- `bun scripts/check.mjs workbuddy`: ok.
- Broken by hand: BAD_SIGNATURE that never matches turns "a signature WorkBuddy didn't make is refused once…" red; isMessages without count_tokens turns "count_tokens is a Messages request" red.
- Read: magpie's provider/plugins.go takes `firstOf(o.BaseURL, m.URL, …)`, so the loader's empty baseURL falls back to each model's api.url (/v1 for Claude, /v2 for chat).
- magpie origin/main 4dfd88206's plugin host, sandbox HOME (scripts/try.sh): the package adds, workbuddy lists 15 models and workbuddy-ai 16.

Not tried against the real API here: the sandbox has no WorkBuddy account that can reach a Claude model. The author's replays with a real account (empty text block 200, signature binding table) are what the 11159 handling rests on.
2026-10-25 14:22:40 +08:00
location-txl 935ddb5b45 zcode: a team seat lists the person's gift plans and their -Trial models (#359, #371)
A team seat's ZCode session also reads the person's own gift plans (#359): plansOf no longer returns {start:false, gift:null} for every team seat. A team seat stays on its team plan (its personal plan list is not read), its <model>-Trial entries are listed, its card shows the gift buckets beside the team's windows, and a team seat with no or an expired ZCode session gets the "ZCode gift plans (-Trial models) need ZCode's sign-in" line. Plain models spend the team key; -Trial models go to zcode.z.ai with the ZCode session and no team key or organization header.

Reviewed at 4778e0d (on main ba9801c, merges clean). Run in a worktree, Bun 1.4.2, sandbox HOME and TMPDIR: `bun test packages/zcode` 107 pass, 0 fail. With main's index.mjs put back, 6 fail (the 4 new team-gift tests and the two changed team-seat tests), so the tests guard the change. `bun scripts/check.mjs zcode` ok. Loaded through magpie's plugin host (magpie origin/main 4dfd88206, scripts/try.sh in a sandbox HOME): zcode listed with 4 models.

Not tried: a real team-seat account here; the author reports a BigModel team seat listing the trials and a Flash Trial request answering 200. The version bump (0.1.28) follows in its own commit.
2026-10-25 14:22:19 +08:00
moxuanchen 4ac4766217 trae 0.2.22: every client profile is read, a claim's code 0 is read back (#333)
moxuanchen's change for #361 (a second Trae CN account can't check in).

- Every Trae CN client profile is read (Trae CN, TRAE SOLO CN, trae-cn):
  the one signed in as the account gives its device. A profile signed in
  as someone else, or one that doesn't parse, no longer hides the rest.
- A claim's code 0 is read back from the status. Not in after the claim
  is `ineligible` for the day (no repeat claims); a failed read-back is
  ineligible too.
- 9074's message says Trae did not take the check-in for this account's
  device, and no longer sends people to Trae CN's app.
- Credit: the claim's credits, else its extra_credits, else the
  read-back's credits; never summed (matches 0.2.21).
- Version 0.2.22, README updated.

Run at the reviewed head 4006fef51 (rebased on ba9801c), sandbox HOME:
- packages/trae: bun test, 213 pass, 0 fail. bun scripts/check.mjs: trae ok.
- Broken by hand, each red: first profile decides (2 red), no read-back
  (2 red), failed read-back reported as failed (1 red), credits summed
  (2 red), TRAE SOLO CN folder dropped (1 red). Restored after.

Not tried: a real second Trae CN account, and TRAE SOLO CN's real
storage.json (its folder and keys are inferred, as the README says).
A status that lags a claim that did land would read ineligible once
that day; the README names it.
2026-10-25 14:04:10 +08:00
yetone ba9801c953 trae 0.2.21: a check-in's credit is the day's credits, not credits plus extra_credits (zhujiu on magpie's Discord)
zhujiu (magpie Discord #feedback, 10-25): "trae签到的积分为100而不是200 …
显示错误了". The card showed a claimed Trae CN check-in as 200 credits;
the account got 100.

Cause: auth.checkin's claimed outcome was the claim's credits +
extra_credits, falling back to the status's credits + extra_credits.
Trae CN's real claim answer names no credit at all ({"code":0,
"message":"success"}, plugins#194), so the fallback always ran, and a
real account's status carries both fields at 100 ({"checked_in": false,
"code": 0, "credits": 100, "did_checked_in": false, "enable": true,
"extra_credits": 100}, yetone/magpie#808): 100 + 100 = 200. magpie's own
Go check-in (internal/provider/trae_checkin.go, used only for plugins
before 0.2.17) fell back to the status's credits alone, and its real run
recorded credit 100 (plugins#194).

Now the credit is the claim's credits, else its extra_credits when it
names only that (#260's case), else the status's credits; the two are
never added. The done outcome already read credits alone. Trae Global
has no check-in, so this is CN only. What extra_credits means on Trae's
side is not known; nothing seen shows it granted on top.

Tests (native-checkin.test.mjs): the real status and claim answers give
credit 100; a claim naming both gives 100; a checked-in day with
extra_credits is done with 100. On origin/main's index.mjs the first two
fail (Expected credit 100, Received 200). HOME=<scratch> bun test in
packages/trae: 206 pass, 0 fail; bun scripts/check.mjs trae: ok.

Not tried with a real Trae CN account (none here); the shapes are the
real ones quoted in #808 and plugins#194. PR #333 touches the same
fallback line and needs a rebase.
2026-10-25 07:36:10 +08:00
yetone 28f9cbb3b2 zcode 0.1.27: the Start Plan's 405 code 3012 says ZCode's risk control blocked the account, not a network block (#348)
zcode.z.ai answers {"code":3012,"msg":"request has been blocked due to
unusual activity."} with 405. Since 10-24 many accounts get it on every
request, and on several of them ZCode's own app (3.16.3) gets the same 405;
ZCode's support bot calls 3012 platform risk control on the account. The
plugin used to put "though magpie sends it as the ZCode app does; it can
be a network block of this IP" after it, and read that JSON as the edge
firewall's page (EDGE_BLOCKED matched "request has been blocked"), so
ZCode's own words and code were dropped.

Now: ZCode's words with the status and code, then provider
ZCodeRestrictedHint word for word ("ZCode's risk control blocked this
account for unusual activity (code 3012); it rests, and the group's other
providers are used. ..."), which magpie's gateway reads as the account
restricted (2h rest, next member asked) from the next magpie release on.
Only an HTML / errors.aliyun.com block page says the network's address
(provider.BlockedHint's words).

Compared with ZCode 3.16.3's glm/zcode.cjs (downloaded from
cdn-zcode.z.ai, the latest on zcode.z.ai): the Start Plan is sent
unsigned there too (requiresClientRequestSigning is false for
zhipu-account start-plan, off-peak and highspeed; X-Client-Sig/Pow apply
to coding-plan keys on the paas origin), and the headers plugins#348's
curl shows are the plugin's set. No request difference was found that
explains 3012; not tried against a real blocked account.

Run: packages/zcode, Bun 1.4.2, sandbox HOME: 102 pass, 0 fail. The new
start.test.mjs case is red on 0.1.26's index.mjs (1 fail, the 3012
message). bun scripts/check.mjs ok.
2026-10-24 23:28:48 +08:00