Commit Graph
1069 Commits
Author SHA1 Message Date
zhou.hanandzhou.han 017cd73e87 catpaw: tests put back the fetch they found, and the rewrite keeps a Request's method, headers and body (#877, #988)
Fixes #877 (catpaw half). Test-only; no version bump.

Change: catpaw's index.test.mjs saves the fetch it found and puts it back in afterAll (in a finally, so a failed server stop still restores it). Its URL-rewriting wrapper now builds `new Request(patched, input)` when handed a Request, so the method, headers and body survive the rewrite; init still applies on top. fake.mjs records each model-types request's method, an x-test-marker header and body, and a new test sends a POST Request through the wrapper and checks all three reach the fake.

Kiro: its test files (usage, builderid, accounts, apikey, ...) already save and restore globalThis.fetch on main, unchanged since f379bf90; the per-file sweep below finds no kiro file leaving fetch changed.

Ran (WSL magpie-desktop, Bun 1.4.2, HOME=$(mktemp -d)), at edecd806 and at edecd806 merged onto origin/main 80c9b495:
- bun test packages/catpaw: 74 pass (main: 73).
- bun test packages/catpaw packages/inkstone/api.test.mjs: 89 pass; bun test packages/kiro packages/inkstone/api.test.mjs: 198 pass. Both also pass on main, because inkstone now passes headers and body through init (#847), so this order no longer shows the leak.
- #877 reproduced on main with a probe file run after catpaw (packages/zzprobe, not committed): globalThis.fetch is catpaw's wrapper, and fetch(new Request(url, {method: "POST"}), {body}) throws "fetch() request with GET/HEAD method cannot have body". At the PR head, and merged, the probe passes (native fetch, POST kept).
- bun scripts/check.mjs: pass.
- Root bun test on the merge: 8207 pass, 19 skip, 0 fail, 581 files. origin/main has since gained c00c4b9f (agy-cli test timing only, no fetch), not rerun with it.
- Per-file sweep on main (each of 579 test files alone, with a preload that compares fetch, setTimeout, Date.now, Math.random and WebSocket at the end): catpaw is the only file that leaves a rewriting wrapper. The other 88 that leave fetch changed are the deliberate loopback-only guards (cursor, trae, minimax, inkstone, sensenova, mclaw nonet.mjs; gcp-ai test/network.mjs), which hand input and init through unchanged.

Broken by hand:
- Restore removed: catpaw's own suite stays green (74 pass); the probe after it goes red (fetch is the wrapper). Nothing inside the package guards the restore; only a later file sees it.
- Request-preserving rewrite reverted to realFetch(patched, init): the new test goes red (401, the cookie header is lost along with the method).

Not tried: init overriding a Request's fields through the wrapper (the PR says it does; no test sends both); macOS (mote), where #877 was seen.

Co-authored-by: zhou.han <18181754+yetihan@users.noreply.github.com>
2026-11-11 18:50:11 +08:00
yetone c00c4b9f6c agy-cli: usage timeout tests wait on the children, not a duration (#950)
Cause: "simulated Windows timeouts kill the whole tree" ran fetchUsage
with a 600ms timeout that covers both children. On a loaded machine the
fake agy's start (bun startup plus its browser-guard spawnSync) can use
most of it, so the timeout fired before the report child had logged, or
before it was even spawned, and logs[1] was undefined
("undefined is not an object (evaluating 'logs[1].pid')"). The same
budget made its sibling "version/report hangs time out" read a log the
killed version child never wrote (ENOENT). After the kill, a fixed 20ms
(and 50ms in both descendant tests) stood in for the kernel and event
loop reaping a SIGKILLed child.

Fix, test-only:
- timedOut() records each spawned child's pid itself and doubles the
  timeout (600ms up to 38.4s) until the timeout lands while the child
  under test runs; the taskkill assertions use the spawned report pid.
- The "gone" checks poll: waitForPidExit with a 15s bound over the
  spawned pids and every pid the fixture logged (the agy under cmd.exe
  on Windows); waitForNotRunning polls ps for the two descendant tests.
- agy-cli.test.mjs runs each suite with bun's --timeout 120000: bun's
  5s per-test default was the next fixed wait these tests hit under the
  injected delay.
- The fake agy takes TEST_START_DELAY_MS to reproduce a slow start.

Injected: TEST_START_DELAY_MS=400 on the old test (WSL magpie-desktop)
-> the #950 test red with the logs[1].pid TypeError; =900 -> it and the
hang test red with ENOENT. With this change: 20/20 at 0, 400 and 900 on
WSL, 20/20 at 0 and 900 on mote (macOS), 17/17 (3 skipped) at 0 and 900
on xiaomi-gpu (Windows).

Ran: wsl-run 'export HOME=$(mktemp -d); bun test packages/agy-cli;
bun scripts/check.mjs' -> 13 pass, 0 fail; check.mjs all ok.

Not tried: the reaping race by itself (a SIGKILLed child still listed
after 20ms) wasn't injected; it is covered by polling, not reproduced.
No source change, so no version bump.
2026-11-11 18:41:02 +08:00
yetone 80c9b495fc minimax 0.2.6: a model takes the video its config says, in magpie (#985)
configModels() and modelOf() said image or nothing: video, audio and pdf
were hard-coded false, so MiniMax-M3.1-Flash and M3 (whose model config
says modalities.input ["text","image","video"], attachment true) showed
as text and image only in magpie's /v1/models, on both sites.

Now parseModels keeps the config's modalities.input (text, image, audio,
video, pdf; unknown kinds dropped) and attachment, and the built-in list
says video for M3.1-Flash-Preview and M3. Where the plugin runs decides
what is advertised:
- magpie's host (the plugin input has `magpie`): every kind said. magpie's
  gateway writes the Anthropic body and the loader's fetch sends it to
  MiniMax byte for byte; the new test sends the issue's video block and
  checks the upstream got the same body.
- OpenCode: @ai-sdk/anthropic builds the body and throws on a file part
  that isn't an image, a PDF or text ("media type: video/mp4",
  dist/index.js in 4.0.102), so video and audio stay out there and
  OpenCode keeps saying the model can't read them. pdf is passed on.

Still dropping video before it reaches this plugin: magpie's gateway
(parseAnthropicRequest has no video block, and groups don't merge
Inputs): yetone/magpie#6135, the reporter's own issue.

Run at the pushed head, rebased on 4a78bec3 (wsl-run, magpie-desktop,
Bun 1.4.2, temp HOME):
- bun test packages/minimax: 159 pass, 0 fail
- bun scripts/check.mjs: exit 0
- modalities.test.mjs is new; its fixture is the issue's literal model
  config ({"modalities":{"input":["text","image","video"],"output":
  ["text"]},"attachment":true}) for minimax-code (MiniMax-M3.1-Flash)
  and minimax-code-global (MiniMax-M3.1-Flash-Preview).

Broken by hand:
- video kept false again in inputsOf: 5 of 8 modalities tests red
  (both sites' live and built-in lists, the every-kind test)
- video advertised in OpenCode too: 4 red (both sites' OpenCode tests,
  the every-kind test, models.test's config test)

Not tried: a real MiniMax account or a real video through magpie (the
gateway drops it until #6135); OpenCode itself with a video attachment
(read from @ai-sdk/anthropic's source, not run).

Reported-by: LingYingNX
2026-11-11 18:10:50 +08:00
yetone 4a78bec3b7 codearts 0.3.8: a window's runsOut is only credit its own remainder holds (#982)
usageFromStatistics took the bonus window's runsOutAt/runsOut from the
soonest check-in batch while remaining/used were the whole bucket, and the
total's from every non-basic batch whatever the buckets had left. So an
account whose check-in was spent (bonus remaining 0) still had a total
runsOut of 82.05 at tonight's midnight, and one with 2344.81 long-lived
gift credits said 100 lapse in hours while the vendor's
package_credit_expiring_amount was 0. magpie's routing reads a total's
RunsOutAt as "what is left is lost then" (Allowance.Renewal), so these
accounts were ranked ahead of ones that really lapse sooner.

Now:
- each bucket's lapse is its own batches' soonest, held to that bucket's
  package_credit_remain; an empty bucket has none;
- the total's lapse is the soonest of the buckets' lapses (same Beijing
  day summed), never from batches of a bucket with nothing left;
- the ledger fallback's batches are marked `estimated` (what was spent of
  a check-in isn't known): they say when, and how much is the vendor's
  own expiring amount, so with 0 or none said there is no lapse; the
  vendor's batch reads (with consumed/expired counts) are used as before;
- each window carries the vendor's package_credit_expiring_amount as
  `expiring` when it is sent;
- comments and README say the ledger keeps the date the claim names (a
  day on for today's check-ins); 30 days is only for a claim with none.

Run (wsl-run, magpie-desktop, at this tree rebased on origin/main):
bun test packages/codearts: 177 pass, 0 fail; bun scripts/check.mjs: ok.
Fixtures are the issue's two accounts as filed (A: bonus 100 used, 0
left, total 82.05 left; B: 4100 / 2344.81 left, ledger grant 100 claimed
2026-11-10T16:01:04.916Z expiring 2026-11-11T16:01:03.812Z, expiring 0),
clock held at 2026-11-11T10:00Z.

Broken by hand: cap = Infinity in bucketLapse: the three #982 tests red
(174 pass, 3 fail). cap = remain (no estimated gate): account B's test
red alone (176 pass, 1 fail).

Not tried: a real CodeArts account; the vendor's horizon for
package_credit_expiring_amount isn't known, so vendor batch reads are not
gated on it. A lagging vendor batch counter is bounded by the bucket's
remainder only.

Reported-by: KiMelody
2026-11-11 18:06:28 +08:00
yetone 9ec696258d agy-cli 0.1.18: turned-away system lines are broken up before agy sends them, and a 429 to one is not a quota (#980)
Antigravity answers 429 "Resource has been exhausted" to a few system
prompt lines whatever quota is left (Claude Code's billing line, the Claude
Agent SDK, Codex's and Hermes Agent's identities, oh-my-pi's RFC 2119
line). The antigravity provider breaks them up with zero-width spaces
(TURNED_AWAY / breakUp / cloak); agy-cli sent the client's system prompt
to agy as written, and called the 429 an exhausted quota
(rate_limit_error), so a client or routing group retried a prompt that
fails every time.

- cloak.mjs is a copy of antigravity's TURNED_AWAY, cloak and hint (the
  two-zero-width-space break-up of 11-11). Each package ships on its own,
  so cloak.test.mjs imports packages/antigravity's _internal and fails
  when the two give a different answer for any line or sample.
- Every route the system text reaches agy is cloaked: the session's
  systemPrompt.append (session/new and session/resume),
  <external_system_instructions> when agy can't append, a later system
  or developer message in the turn or the replayed history
  (renderTurnMessageParts), and a system/developer notice delivered
  beside a tool result (extractToolResults).
- What the bridge keys and hashes on is unchanged: proc.instructions,
  sameInstructions, instructionsIdentity, stripVolatileSystem and the
  session store keep the prompt as the client wrote it; cloak is applied
  only where the text is sent. User text is not touched.
- #formatAgentError: a "code 429 ... Resource has been exhausted" with a
  turned-away line in the session's instructions is an
  invalid_request_error, "Antigravity answered 429 to this system prompt:
  <detail> — <hint>", with the antigravity provider's hint. Any other 429
  stays rate_limit_error.
- READMEs (en, zh) say so under the minimal-agent section.

Run (wsl-run, magpie-desktop, HOME=$(mktemp -d), at f85f9ad0 + this change):
- bun test packages/agy-cli: 13 pass 0 fail (smoke ALL OK, 333 checks)
- bun scripts/check.mjs: exit 0
- root bun test: 8189 pass, 19 skip, 0 fail (580 files, 408s)
- rebased on 84ee9b88 (day-card, autoclaw, sap-aicore only): bun test packages/agy-cli
  13 pass 0 fail and bun scripts/check.mjs exit 0 again at this head

Broken by hand (each red, then restored):
- append: this.instructions uncloaked -> "#980 ... session instructions" BAD
- <external_system_instructions> uncloaked -> its #980 check BAD
- later system message uncloaked -> "#980 a later system message" BAD
- tool-result notice uncloaked -> "#980 ... system notice beside a tool
  result" BAD
- the turned-away branch of #formatAgentError off -> the 429 came back
  rate_limit_error, "#980 a 429 ... prompt rejection" BAD
- cloak.mjs back to one zero-width space after the first letter -> both
  cloak.test.mjs tests red

Not tried: against real Antigravity or a real agy (no vendor API was
reached; the fake agy in test/smoke.mjs stands in). Whether agy's own
request puts the appended instructions where Google matches them is
taken from the report and the antigravity provider, not measured here.
A turned-away line the user pastes into their own message is sent as
written, as the antigravity provider does.

Reported-by: shaohongwu
2026-11-11 17:54:13 +08:00
yetone 84ee9b88cc sap-aicore: the token deadline test fires the exchange's deadline once fetch is entered (#984)
"token deadline bounds fetch that ignores abort" rewrote every 15000ms
timer to 20ms. The credential read and the token exchange each arm their
own 15000ms deadline through bounded(), so the read's deadline was cut to
20ms too. When the read took longer than that on a loaded machine, it
timed out with the same "token acquisition timed out" message before
fetch was ever called, and `upstream.aborted` threw on undefined.

The test now keeps both timers at 15000ms, records each deadline's
callback, and fires the exchange's (the second) from inside the fake
fetch. It checks that two deadlines were armed and that fetch was entered
before it checks the abort. The source is unchanged: a separate 15s bound
on the read is intended.

Run (wsl-run, magpie-desktop, Bun 1.4.2, HOME=$(mktemp -d)):
- bun test packages/sap-aicore: 343 pass, 0 fail.
- bun scripts/check.mjs: exit 0.

Injected by hand:
- A 50ms wait at the start of readCredentials' operation. The old test
  failed with "TypeError: undefined is not an object (evaluating
  'upstream.aborted')" at 28ms, the issue's case. The new test passes
  with the same wait.
- The exchange run without bounded() (no deadline). The new test fails.

Not tried: the full root bun test run under load where it first failed.
2026-11-11 17:51:22 +08:00
yetone eaeca41125 day-card: a week, a month or all time as a receipt, with a Day/Week/Month/All switch (HeheLi29136651 on X)
usage:day takes a from (magpie with usage:day's span read); the page asks for the seven or thirty days ending on the date shown, or all, and prints the period, the days that had calls and the cost of one, in place of the streak against an average day. Arrows step a whole week or month. A magpie that answers a day and no from says to update. 0.3.0.

Run: bun test packages/day-card (17 pass, the new test red before the view change).
2026-11-11 17:42:08 +08:00
zhou.hanandyetihan 93cb4fe1c0 autoclaw 0.2.22: Linux overseas chat omits X-Tm; wallets decides a bare forbidden (#979)
Fixes #367.

On Linux the overseas chat leaves X-Tm out: the gateway refuses the
official "linux" value for plugin-only accounts (#367; menhouran got 200
with only X-Tm removed on x64; on arm64 only the platform values were
tried, not omission). Sign-in, refresh, wallets, check-in, CN chat and
macOS/Windows keep their headers.

An exact uncoded 403 "forbidden" (JSON or plain text) on both chat hosts
no longer reads as a dead token on its own: the wallets route decides.
It takes the token: 403 permission_error, sign-in kept. Every host
refuses it: 401, expired. Mixed or failed check: the upstream 403 goes
through with no X-Magpie-Sign-In, which magpie leaves unmarked.
signInHolds now says false only when every wallets host refused; for
sizeRefusal false and null already led to the same answer. 0.2.22.

Run at cd6da42dd (no live AutoClaw request, no credentials):
- WSL Ubuntu 24.04, Bun 1.4.2, temp HOME: bun test packages/autoclaw
  117 pass 0 fail; root bun test 8189 pass 19 skip 0 fail;
  bun scripts/check.mjs ok.
- Merged with origin/main f85f9ad0b: autoclaw 117 pass; root bun test
  8192 pass 0 fail; check.mjs ok.
- Windows 11, temp HOME/USERPROFILE: autoclaw 117 pass 0 fail; check ok.

Broken by hand on WSL, one at a time, each red: X-Tm always set (2),
exact-message guard dropped (1), uncoded guard dropped (1), classifier
off (3), plain-text path off (1), wallets check skipped (3), unknown
read as expired (1), wallets refusal kept (1), signInHolds' any refusal
as false (1), unknown dropping the upstream body (1), res2 status guard
off (1), only host 2's fingerprint read (1).

Not caught: reading only host 1's fingerprint (a bare forbidden on host
2 alone after a different 403 on host 1) passes all tests.
Not tried: a real AutoClaw account; omission on arm64.

Co-authored-by: yetihan <roc.han@nio.com>
2026-11-11 17:41:59 +08:00
yetone f85f9ad0b0 day-card 0.2.3: the receipt credits nowdex, whose share card its design follows
randyloop on X pointed out the card looks just like nowdex's share card.
Its foot now has a small muted line under the magpie footer, in every
language the card speaks: "Design inspired by nowdex.app" (设计灵感来自 /
設計靈感來自 / デザインは…に着想を得ています / Design inspiriert von).
The README says so too.

Run: bun test packages/day-card on mote (HOME=$(mktemp -d)): 16 pass; the
new check is red without the credit field. Rendered the page in Playwright
Chromium and WebKit with a stub bridge in en, zh, zh-TW, ja and de and
looked at the PNGs: the line sits centred under the footer, inside the
paper, no page errors.
Not tried: the page inside the real magpie window.
2026-11-11 17:00:24 +08:00
Jiaqi Sun 1ccd764e01 minimax 0.2.5: a chat asks for no compression, so the stream really streams (#978)
Flagwill: MiniMax answers a chat asked to compress as one gzip member
flushed at the end, so a streamed answer arrived whole. The chat request
(auth.loader's fetch, the one path every chat of both sites takes, CN and
global, streamed or not) now sets accept-encoding: identity, over any
caller value. Models, usage, check-in and the tool API keep Bun's default.
New stream.test.mjs; README "Requests"; 0.2.5 (npm and main had 0.2.4).

Run at 90fc6ff3 (Bun 1.4.2, temp HOME, WSL magpie-desktop):
- bun test packages/minimax: 151 pass 0 fail (713 expects)
- bun scripts/check.mjs: exit 0
- Windows (xiaomi-gpu, temp HOME/USERPROFILE): 151 pass 0 fail, check exit 0
- merged with origin/main ebcff866 (no minimax change on main since the
  base): 151 pass 0 fail, check exit 0
- local probe (fake server, not committed): CN and global, stream true
  and false, a Request object carrying Accept-Encoding: br, all reach the
  fake as identity and arrive in 4 chunks ~150ms apart, no
  content-encoding; plain fetch still sends gzip, deflate, br, zstd; a
  server that gzips anyway is still decoded by Bun.

Broken by hand: deleting the header line turns all 3 stream.test.mjs
tests red (0 pass 3 fail).

Not tried: a real MiniMax account (the body's measurement against
agent.minimax.io is the author's).
2026-11-11 16:37:19 +08:00
yetone ebcff86606 agent-agy 0.2.0: magpie's own settings file, passed with --settings
As magpie's built-in agy does since 0cc91af3d: the plugin's config is
~/.gemini/antigravity-cli/magpie-settings.json, handed to agy with
--settings, and agy's own settings.json is only read (base) for the
user's own model and custom models. remote-control runs plain, as agy
is. Needs magpie with agentplug's base, launch.args and launch.plain.

Run: bun test packages/agent-agy (4 pass, on mote), and magpie's
internal/agent TestAgyPlugin against this file.
2026-11-11 16:11:22 +08:00
1sh1ro 9fb09a0f41 orcaterm 0.1.7: a tool call the model writes as text is not sent on as the answer (#969)
orcaterm 0.1.7 reads the tool call a model writes as text (DSML, <tool_call>, <function_calls>,
<function=, <invoke name=) on both the streamed and non-streamed paths. The answer stops where the
call begins, and the turn ends as a text_tool_call error (an error frame when streamed, a 502 when
not), so magpie can retry or try another account instead of passing the call on as prose. A call
shown in a code fence or in backticks is ordinary text, as in trae. A call carried only in the
thinking goes through the same guard: the call is read from the extractor that cut it
(answerAndCall), so prose before it no longer hides it. An `ask` envelope reaches the client as its
question with its options under it, one per line, whether it is complete JSON, hand-written with a
bare line break, cut short by the stream, or appended after prose.

Reviewed at 39b4ef653e89e2b3e8c2d1b803563089ba4e3e2b, every line changed since 7a49ed7c. Merge-tested
with origin/main 2f8e65a1 (clean, no conflicts in packages/orcaterm).

Ran, with Bun 1.4.2:
- WSL magpie-desktop (wsl-run, HOME=$(mktemp -d)): bun test packages/orcaterm 160 pass, 0 fail;
  bun scripts/check.mjs exit 0. The same after merging origin/main 2f8e65a1: 160 pass, 0 fail,
  check exit 0.
- Windows xiaomi-gpu (win-run, fresh HOME and USERPROFILE): bun test packages/orcaterm 160 pass,
  0 fail; bun scripts/check.mjs exit 0.
- Review probes (local, not pushed): 40, all green. That covers the 21 from round 2, including the
  three thinking-only calls (prose + call streamed gives the prose plus an error frame, not
  streamed gives a 502, a call inside a thinking envelope gives the error frame), the loose ask, the
  cut-short ask and prose + ask. It also covers 19 new ones: streamed and non-streamed give the same
  result for a loose ask in 1-, 3- and 4096-character frames, prose + loose ask, prose + fenced ask,
  an appended completion still dropped, a fenced or backticked call in the thinking shown, content
  winning over a call in the thinking, a call split over 1-character thinking frames, a cut-short
  opener in the thinking, a complete ask followed by prose kept verbatim, a backticked ask example
  kept, and an appended ask whose question carries a call (502 / error frame).

Broken by hand, one at a time (cp-restored and touched each time), the whole orcaterm suite:
13 of 17 breaks go red. Red: trusting a match at the end of the text (3), the quoted check in
answerCut (6), the complete-opener hold (18), the i flag (2), the streamed thinking guard (3), the
non-streamed thinking guard (1), answerAndCall returning no call (4), answerField always
taskCompletion (2), the appended ask dropped (1), the loose reader's options strip (1), the loose ask's
options (1), the cut-short field (1), the ask unwrap (2).
Not red in the suite (each one red in the review probes): object options read for their label, a
blank question treated as none, and the fence taken off an appended ask (break it and the question
of "Two options.\n```json\n{ask}\n```" is dropped). textCallIn without quoted() has no effect any
more, because nothing calls textCallIn now apart from its export.

Correction to round 2: the "duplicate" <function_calls> in TEXT_CALL_OPEN and TEXT_CALL_MARKS is
<function_calls> and its antml:-prefixed form. Our tooling had shown both lines the same. Not a
duplicate.

Not tried: a real OrcaTerm account (none used from this PR), and an end-to-end magpie gateway run.
Edges noted, not blocking: an ask carrying both taskCompletion and question answers with
taskCompletion when it is valid JSON, and with question when it is hand-written. A hand-written
ask whose option string contains "]" still goes out raw.
2026-11-11 16:07:38 +08:00
zhou.han 2f8e65a131 devin 0.1.38: a slow model list doesn't hold up quota usage (#977)
yetihan's change (fixes #976). usage() asks GetCliModelConfigs in the
background (freeIDs/configsFor with wait=false), so a slow or timed-out
model list no longer holds back the day and week windows that
GetUserStatus already returned. Free models (notModels) are added, or the
"Free models" row says why the list couldn't be read, on a later usage once
the ask has settled. Other callers keep wait=true. The asks are shared
through c.asking, failures back off for RETRY (60s), and the ask's own
try/catch means a background failure never rejects.

Reviewed at 3920118d53e7c144d9e7d54bfe6dca6069611575.

Run (WSL magpie-desktop, Bun 1.4.2, fresh HOME):
- bun test packages/devin: 209 pass, 0 fail; bun scripts/check.mjs: exit 0
- the same after merging origin/main into the head: 209 pass, check exit 0
- Windows (xiaomi-gpu, fresh HOME/USERPROFILE): bun test packages/devin,
  209 tests, 0 fail, 9 skip
- probe (not committed): 10 usages with a list that never answers make 1
  GetCliModelConfigs fetch; a fetch that throws makes 1 fetch in 10
  usages, the row names the error, and there is no unhandledRejection

Broken by hand: restoring the blocking freeIDs/configsFor calls makes
"a slow model list doesn't hold up quota usage" fail at 1017ms ("usage
waited for GetCliModelConfigs"), and the edited "logged once" test hangs to
its 5s timeout. Restored, both are green.

Version: npm had 0.1.37 and origin/main's package.json had 0.1.37, so the
bump to 0.1.38 is right.

Known: a usage read on a cold host (a fresh `magpie quota refresh` process)
returns the windows without notModels until the list has been read once.
"with no word from Devin..." now passes without its 503 being read.

Not tried: a real Devin account; Devin's API wasn't contacted.
2026-11-11 16:05:32 +08:00
yetone 3b314dad1c day-card 0.2.2: a "No background" choice first, and the card fits one screen (volare18467257 on X)
volare18467257: add a no-background option first in the list, and let the
card scale, since it didn't fit one screen.

- Background now starts with "No background": the paper alone on nothing,
  a transparent PNG with no margin (the margin slider is hidden for it),
  swatched as a chequerboard. Named in all five languages. The default
  stays teal.
- The card on the page is sized to the room under the toolbar (B.fit:
  width up to 760, no taller than the window, never below 160), on resize
  and when the toolbar or status line changes height. The bitmap copied
  or saved is unchanged.

Run: bun test packages/day-card in wsl-run, 16 of 16 green; scripts/check
exit 0. A Playwright harness (not committed) with a stub bridge in
Chromium and WebKit: at 1000x600 the card is 403px wide and ends at 568 of
600, with no page scroll; at 1000x900 it is 650 wide, ends at 867; picking
No background gives a 880x1130 bitmap (no margin) and hides the margin
slider, no page errors. Broken by hand: with backgrounds.js from main the
new test is red.

Not tried: magpie's own window on Windows/Linux; the transparent PNG
pasted into an app.
2026-11-11 16:04:47 +08:00
yetone 4ecf633125 tagged: keep each listed plugin's README on dist (readmes/), so magpie's Discover page reads it from usemagpie.ai, not npm (River_WLan on X)
Run: node scripts/tagged.mjs on wsl against the real GitHub into an empty folder: 369 plugins, 369 README files (5.5MB); a second run into the same folder read none again and kept 369. Not tried: the workflow itself on Actions (dispatched after the push).
2026-11-11 16:01:13 +08:00
Mañjūṣaka fcde82d39f history-trim 0.1.2: trim trailing whitespace in linear time (#975)
history-trim 0.1.2. The whitespace step trimmed trailing spaces with /[ \t]+$/gm, which takes quadratic time on a long run of spaces followed by a word: 1.2 s at 40,000 spaces on Node 22. A one-pass scan replaces it. It runs after the blank-line fold, as before, and trims before every line end that `$` sees under /m (\n, \r, U+2028, U+2029 and the end of the text). The output is the same as main's. Four cases.json regressions are added: CRLF, whitespace-only lines, U+2028, and a long run of spaces before a word.

What was run at 0ad27d87, merged with origin/main:
- `bun test packages/history-trim` (27 pass) and `bun scripts/check.mjs` (ok), on WSL Ubuntu 24.04 and on Windows 11, each with a fresh HOME (and USERPROFILE on Windows).
- main's onRequest against the PR's, on 500,000 random strings over space, tab, \n, \r, U+2028, U+2029, U+0085, \v, \f, U+00A0, U+3000, U+FEFF, U+2000 and U+200A: 0 differ, on Node 22 and Bun.
- Timing at 40,000 spaces + "a": main 1,223 ms, PR 0.28 ms; 1,000,000 spaces: 7 ms (Node 22, mote).
- Broken by hand: treating only LF as a line end turns the CRLF and U+2028 cases red. Trimming before the fold turns the whitespace-only-lines case red.
2026-11-11 15:37:29 +08:00
CHENZUDE 1e060e6163 page-usage-tree 0.1.1: refresh warning only on a real failure, hit rate and model-detail fixes (#960)
page-usage-tree 0.1.1 (CHENZUDE):

- A failed refresh is kept on the cache entry the page reads, so
  "Refresh failed; showing the previous data" shows when a refresh threw
  (on 0.1.0 it was written to an entry already replaced and never shown).
  Only a loader that threw counts: an older disk cache marked stale does
  not, and a retry from a failed entry stays failed until a loader succeeds.
  The page takes the server's X-Usage-Tree-Refresh on every answer, quiet
  follow-ups included, so the warning clears once the gateway recovers.
- Hit rate uses magpie's hitPct rounding (0.9996 shows 99.96%, not 100%).
- A failed per-account model-detail read keeps the account totals and says
  model details are incomplete (zh, en). Disk cache v8.
- Not in the PR body: a /bridge.js shim served by the service (talks only to
  parent: hello, options.get/set, theme and visibility), request timeout
  10s -> 30s, narrow breakpoint 620px -> 700px, model split on narrow
  screens, "permissions": [] added (same as absent), zh warnings joined
  with ";".

Run at the reviewed head 74363201570d9f69866ac0e4afff7a2b898e6dab:
- WSL (magpie-desktop), fresh HOME: bun test packages/page-usage-tree
  62 pass 1 skip (parity needs a live magpie); node --test 68 pass 1 skip;
  bun scripts/check.mjs ok.
- Windows (xiaomi-gpu), fresh HOME and USERPROFILE: bun test
  packages/page-usage-tree exit 0; bun scripts/check.mjs ok. CI green.
- Playwright 1.62 Chromium and WebKit on WSL, sandbox server with fake
  data, 1280 and 420px, en and zh: a first open from a stale disk cache
  never shows the refresh warning; a failed manual refresh shows it, it
  stays while the gateway is down, and clears on the quiet follow-ups after
  recovery while the model-detail warning stays; no page errors, no
  horizontal scroll. The same probe on e3da32bed fails 3 checks (false
  warning on open, warning never clears, zh joined by a space).
- Broken by hand: counting data.stale as failed, a retry entry forgetting
  the failure, and a quiet load never clearing each turn a test red.
  Not covered by a test: dropping warningStateChanged (render also runs
  renderWarnings) and the zh join between two data warnings.
- Host/Origin/token handling on /api/tree unchanged from main; /bridge.js
  is static and behind the Host check. dist had only 0.1.0.
2026-11-11 15:18:33 +08:00
Mañjūṣakaandmanjughosa a3bfe680d4 output-strategy 0.2.2: panel attribution, conversation guidance and save-state fix (#831)
output-strategy 0.2.2. The panel says the plugin is unofficial and maintained by manjughosa (README, page, registry summary). The page tells the user that saving does not rewrite an existing conversation. Unsaved changes are now counted against the saved styles, so ticking a style and unticking it again leaves the panel clean. The README says the `[Output Strategy]` marker is honoured only in system/developer instructions.

The package.json author stays "manjughosa (https://github.com/manjughosa)", as main has it. From the previous reviewed head 8cb337ef to 6110057c, that line is the only change.

What was run at 6110057c, merged with origin/main 5fb28a1f: `bun test packages/output-strategy` (59 pass) and `bun scripts/check.mjs` (ok), on WSL Ubuntu 24.04 and on Windows 11, each with a fresh HOME (and USERPROFILE on Windows). Broken by hand: putting back `dirty = true` on every change turns three page save-flow tests red (56 pass, 3 fail).

Co-authored-by: manjughosa <manjughosa@users.noreply.github.com>
2026-11-11 15:12:42 +08:00
yetone 18ce00e4ce agy-cli 0.1.17: a steer keeps the live agy session, so its prompt cache holds (ChrisJ_AI on X)
Reported by ChrisJ_AI on X: after 0.1.12, most turns show a normal cache
ratio, but a steer / interrupt still reads 0% (303K input, 0% in his
screenshot; agy's own session rows for the replay read 193K and 65.8K at
0% too, then 99% again).

Cause: a user steer (text or an image beside a live tool_result, a rejected
tool, a hook line) stopped the live agy session and replayed the round in a
new session/new. A new session has no cache, so agy itself reported 0%.

Now the bridge answers the pending MCP calls with the real results, cancels
the step agy was starting, and sends only the steer as the next prompt of
the same session (the answered tool results are not sent a second time).
Falls back to the old replay when the session or history differs, tools
grew, a result carries an image, a call is still unanswered, or the cancel
does not settle.

Run (WSL2 Ubuntu 24.04, Bun 1.4.2): bun test packages/agy-cli 11 of 11,
smoke.mjs ALL OK; bun scripts/check.mjs agy-cli ok. smoke.mjs now asserts
no new session/new (same convId, same init count), the steer text in the
next prompt and the real result delivered to the MCP call, for the Esc,
queued_command, standalone follow-up, text before/after the result, image,
rejected tool, Skill and queued-suffix cases. Broken by hand: the same
smoke.mjs against origin/main's index.mjs: 12 failures, all of those.
Not tried: a real agy (signed out on this machine and in magpie's account
store), so Google's cache after a steer is not measured; Windows (smoke
is red there, #973); macOS.
2026-11-11 15:10:23 +08:00
yetone 5fb28a1fd6 tagged: build the Discover list on dist every half hour, for desktops that can't reach GitHub (River_WLan on X)
scripts/tagged.mjs ports magpie's askTagged/readTagged (topic search, package.json, npm, entry file); the workflow pushes tagged.json to dist. Run once locally (wsl): 367 plugins, 253 with icons, 291 installed from github:, 0 unread.
2026-11-11 14:59:58 +08:00
Klarkxy 92e0417739 agy-cli 0.1.16: keep conversationKey stable across volatile openings (#947)
conversationKey stays stable when only agent-injected opening fields
change (Claude Code's billing header, known clock lines in the system
prompt or a <system-reminder>), so a continued chat keeps its agy session
and its prompt cache. It hashes the whole stripped first message. A
flattened, growing first message reuses the live session only when it
continues the whole previous opening plus that session's reply on a line
boundary, and then sends agy only the new tail. Closes #945.

Reviewed head 56c845720026819781e198bada948cce9b926806 (one commit on
main 9204c07; main 9e07c706 has no agy-cli change since).

Both points from the last review are fixed:
- A reused flattened session no longer gets the opening again. A probe of
  four flattened turns with empty history (200 İ, ß, ffi, Dž, ς, 𝐀😀 in the
  opening, a reminder date that changes every turn, replies with thinking)
  ran in one fake agy session; prompts 2-4 were 28, 16 and 16 bytes and
  held only the new step.
- The reminder scan folds only ASCII, so İ before a reminder no longer
  shifts indexes. An upper-case <SYSTEM-REMINDER> after İß keeps the key
  across a date change and reuses the session.

Broken by hand, each went red: the old slice(history.length) prompt (5
red), toLowerCase() (2), no user-id check (1), join("") in systemText (1),
compactIdentity in takeParked (1), no line-boundary check (2),
findLiveContinuedProc returning null (6).

Run at the head on main 9e07c706:
- Linux (WSL2 Ubuntu 24.04, Bun 1.4.2, temp HOME): bun test packages/agy-cli
  11 pass, 0 fail; bun scripts/check.mjs exit 0.
- Windows 11 (temp HOME and USERPROFILE): 10 pass, 1 fail; the one red is
  the smoke check "no call to the loaded tool reaches agy's validator in
  the old prompt", the only red at origin/main 9e07c706 too (9 pass, 1
  fail), filed as #973. check.mjs exit 0 on both.
- #971's loose matchesHistory/takeParked and 0.1.12's cache estimate are
  unchanged; compat, smoke and usage-settlement pass.

Not blocking: if updateTools throws after a flattened reuse is picked,
pendingFlattenedTurn stays on the process. After an agy error on a reused
flattened turn, the same request again starts a new session with the full
opening, as a fresh retry does on main.
Not tried: a real agy or a real flattening client.
2026-11-11 14:54:37 +08:00
yetone 9e07c70627 antigravity 0.1.4, antigravity-cloak 0.1.4: omp's first line, "RFC 2119 keywords: ...", is broken up, so its prompt is no longer turned away with a 429 (eric_li8983 on X)
eric_li8983's 429 RESOURCE_EXHAUSTED after 0.1.3 was not quota. On the
owner's real Antigravity account (plenty of quota; "hi" with no system
prompt gives 200 on gemini-3.8-flash, claude-sonnet-4-6, gemini-3-flash),
oh-my-pi's real system prompt (captured from omp 's request to a local
server, 10.5KB) got 429 on all three. Bisected by hand: the sentence
"RFC 2119 keywords: MUST, REQUIRED, SHOULD, RECOMMENDED, MAY, OPTIONAL."
alone gets 429; its halves, the list without the final period, or "2120"
for "2119" get 200; the prompt without that line gets 200. Broken with a
zero-width space after the first and second character of each word, the
whole prompt gets 200 on the same three models.

The line is added to antigravity's TURNED_AWAY (with its own hint when the
cloak missed a reworded copy) and to antigravity-cloak's words.

Run: bun test packages/antigravity packages/antigravity-cloak on
magpie-desktop (wsl-run, HOME temp): 86 pass. Broken by hand (the TURNED_AWAY
entry removed): the new shape test and the 429 hint test go red, 2 fail.
Real account: omp's full prompt 200 on 3 models after, 429 before.
Not tried: omp's own run through magpie end to end (the user's AGENTS.md
and tools were not in the captured prompt); other omp prompt lines after
the cloak. Real quota 429s and the credits path are unchanged.
2026-11-11 14:32:50 +08:00
August 557511d73f openai-decisions: OpenAI Decisions as a System One provider (#762)
New package @magpie-community/opencode-openai-decisions-auth (provider
openai-decisions, model gpt-6-luna) by genglintong: answers magpie's
System One (base /systemone through its fetch) with OpenAI's
POST /v1/decisions, converting choice/score/noul to choice/score/predicate
and back with probabilities, confidence and usage. Sign-in is a plain
OpenAI API key from the host's getAuth, read again per request.

The six points of the 11-05 review, checked at 613fc413a:
1. credentials.mjs, the saved-key reader and the keyless method are gone;
   no read of providers.json, APPDATA or ~/.config/magpie anywhere.
2. A per-question {"type":"refusal"} is left out of answers; the others
   and usage are kept (all refused gives answers {}). magpie's own
   Decisions translation reads a missing answer as a refusal too.
3. Omitted, null or blank instructions get a non-empty default.
4. Registry entry on one line; merges cleanly with origin/main 9204c079.
5. Renamed; package.json magpie.icon and registry icon are an SVG data URI.
6. No test writes to disk; comments in English; the only repo link left is
   this one (NOTICE, for the opencode2.mjs bridge, byte-identical to
   scripts/opencode2.mjs at main).

Run at 613fc413a and at its merge with origin/main 9204c079, off the Mac:
- WSL magpie-desktop, fresh HOME: bun test packages/openai-decisions 23
  pass 0 fail; bun scripts/check.mjs 56/56 (merged tree 57/57);
  node 22.23.4 --test test/*.test.mjs 23/23 on the merged tree; full
  bun test of the merged tree: 8111 pass, 19 skip, 0 fail.
- Windows xiaomi-gpu, fresh HOME and USERPROFILE, Bun 1.4.2: 23 pass 0
  fail, check.mjs 56/56.
- Broken by hand, each red then restored: refusal thrown again (3 red),
  blank instructions passed through (1 red), key captured at load instead
  of per request (1 red), redirect:"error" dropped (1 red), URL check
  dropped (1 red).
- Tests reach no network (fetch injected or globalThis.fetch stubbed).
  npm pack --dry-run lists the 10 files; every runtime import is in files.

Not tried: a real OpenAI Decisions call (no credentials used), Windows or
Linux in a real magpie.
2026-11-11 14:27:27 +08:00
yetone bf302fab7d minimax 0.2.4: generate_image takes the catalog's area, n, output_format and reference_images (#955)
hokaii6990-boop (Windows 11, magpie 0.1.3654, plugin 0.2.3, CN site):
`magpie tool minimax_generate_image --requests '{"prompt":"...","area":"2K"}'`
answered "bad arguments: arguments.requests[0].area is not an accepted
argument", while the account's catalog schema has area, and
minimax_call_tool with the same arguments generated the image.

Our first reply said execute checks against the catalog's
input_schema_json. It does, but createConnectorTools wraps every tool's
execute in checked(t.args, args) first, and a named Matrix tool's args
are the bundled matrix-tools.json copy (2026-11-03: resolution,
input_urls, a six-value aspect_ratio). So that check refused the call
before the catalog was ever read.

- A named Matrix tool's call is now checked up front only for its two
  routing fields (site, account). Its own arguments are checked once, in
  execute, against the catalog entry's input_schema_json, and against the
  bundled copy only when the catalog gives none. A parameter MiniMax adds
  later passes without a plugin release. A priced call still never goes
  out with bad arguments; the catalog read now comes first.
  list_tools, tool_schema and call_tool keep their up-front check.
- The refusal names whose schema it was: "(checked against the account's
  catalog schema for connector__matrix__generate_image)", or the bundled
  one when the catalog gave none.
- matrix-tools.json's generate_image input_schema is the reporter's
  pasted `minimax_tool_schema --json` output, byte for byte after JSON
  parsing (kept as testdata/generate-image-schema-955.json). It is what
  agents are shown. Its description says reference_images, not
  input_urls. The other 15 tools' copies are unchanged; no fresher
  bytes for them.
- README says calls are checked against the live catalog.

Run:
- wsl-run (magpie-desktop, Bun 1.4.2), HOME=$(mktemp -d):
  bun test packages/minimax 148 pass 0 fail; bun scripts/check.mjs exit 0.
- win-run (xiaomi-gpu Windows 11, Bun 1.4.2), HOME and USERPROFILE a
  fresh temp dir: bun test packages/minimax 148 pass 0 fail;
  bun scripts/check.mjs exit 0.
- Broken by hand (wsl-run, connector-tools.test.mjs):
  - 0.2.3's code and bundle: 5 red, among them the area/n/output_format/
    reference_images call.
  - New code with 0.2.3's bundle: only the bundled-copy test red; the
    area call passes, held to the catalog.
  - New bundle with the old up-front check: 3 red (the catalog's
    refusal message, the no-schema fallback message, and a refusal that
    now reads the catalog first).

Not tried: no MiniMax Code account here, so no real generation; the
schema is the reporter's, from one CN-site account. The global site's
catalog was not seen. Codex desktop refusing area from the advertised
schema (the reporter's second path) was not reproduced; the refreshed
copy covers it for these fields. The get_asset_url /visible/ watermark
note is split out to #974.

Reported-by: hokaii6990-boop
Refs #955
2026-11-11 14:21:17 +08:00
yetone 9204c079ae zcode 0.1.59: a reply the gift answered names the -Trial entry, so Usage, sessions and the request log show free quota was spent (WJaunita45604 on X)
Free first sent the plain model to the Start Plan under the plain name, and
the gift answers under that name too, so magpie named the plan's model for
both routes. trialNamed rewrites the model of a gift's whole reply or event
stream to GLM-5.3-Flash-Trial; a failed reply, and a free-first replay on the
coding plan, keep what came.

Run: bun test dual.test.mjs on wsl (61 pass); the two new gift tests fail with
the rename taken out. Not tried: a real Start Plan reply (no gift balance on
this account at this hour).
2026-11-11 13:55:37 +08:00
yetoneandklarkxy dbd082f6d1 agy-cli 0.1.15: an array tool schema whose items live only on a sibling gets an items schema Gemini accepts (klarkxy #963)
Gemini refuses an array schema with no `items`. array-items.mjs infers
the items from the schema around it, or adds a permissive items schema 8
levels deep, without narrowing what the client allowed; tuple `items`
lists are left as they are, with a hint. Closes #962.

Reviewed head c7d3e7b8 (on c27ba5f7), landed onto main 738fd501 with the
version moved to 0.1.15 and package.json `files` keeping both
re2-pattern.mjs (#946) and array-items.mjs.
Run at the reviewed head: WSL2 bun test packages/agy-cli 9 of 9,
check.mjs ok; Windows 8 pass, 1 fail, the same smoke red as main (#973).
Broken by hand: without the ensureGeminiArrayItems call in normalizeTools
smoke.mjs reports 2 failures; PERMISSIVE_ARRAY_DEPTH = 1 and removing
`if (openArray) return null` each turn a test red.
Run at this commit (WSL2 Ubuntu 24.04, Bun 1.4.2, temp HOME): bun test
packages/agy-cli 10 of 10 pass; bun scripts/check.mjs agy-cli ok;
npm pack --dry-run lists 14 files, both new modules among them.
Not tried: macOS (mote refused ssh), a real agy.

Closes #963

Co-authored-by: klarkxy <klarkxy@users.noreply.github.com>
2026-11-11 13:35:07 +08:00
yetoneandklarkxy 738fd501d7 agy-cli 0.1.14: tool schema patterns are turned into RE2 or dropped, so an ECMA-262 pattern no longer aborts the turn (klarkxy #946)
Tool input schemas' `pattern` and `patternProperties` keys are translated
to RE2 (re2-pattern.mjs) before they reach agy; a pattern RE2 can't hold
is dropped with a hint, and `additionalProperties: false` is lifted when
every patternProperties key was dropped. Closes #944.

Reviewed head 99093088 (on c27ba5f7), landed onto main a0b1e491 with the
version moved to 0.1.14.
Run at the reviewed head: WSL2 bun test packages/agy-cli 9 of 9,
check.mjs ok; Windows 8 pass, 1 fail, the same smoke red as main (#973).
A fuzz of 1,033 kept patterns compiled every one with Go's regexp
(go1.26.8), against 222 failures before the `[:` fix. Broken by hand:
the `[:` reject, the sanitizePatternFields call, the propertyNames /
contains / if / then / else / unevaluated* recursion and the
additionalProperties lift each turn re2-pattern-unit.mjs red.
Run at this commit (WSL2 Ubuntu 24.04, Bun 1.4.2, temp HOME): bun test
packages/agy-cli 9 of 9 pass; bun scripts/check.mjs agy-cli ok.
Not tried: macOS (mote refused ssh), a real agy.

Closes #946

Co-authored-by: klarkxy <klarkxy@users.noreply.github.com>
2026-11-11 13:34:04 +08:00
yetoneandklarkxy a0b1e49113 agy-cli 0.1.13: an image before a live tool_result counts as the user steering (klarkxy #965)
An image the user sends with no text before a live tool_result now marks
the turn as steered, so it is replayed and the image stays off the MCP
result.

Reviewed head 7852e288 (on c27ba5f7), landed onto main 7869318d with the
version moved to 0.1.13 (0.1.7 was taken by the time it landed).
Run at the reviewed head: WSL2 bun test packages/agy-cli 8 of 8, check.mjs
ok; Windows 7 pass, 1 fail, the same smoke red as main (#973). Broken by
hand: without `userSteered = true` in inspectToolTurn's image branch, the
new compat test goes red (11 pass, 1 fail) and smoke.mjs exits 1.
Run at this commit (WSL2 Ubuntu 24.04, Bun 1.4.2, temp HOME): bun test
packages/agy-cli 8 of 8 pass; bun scripts/check.mjs agy-cli ok.
Not tried: macOS (mote refused ssh), a real agy.

Closes #965

Co-authored-by: klarkxy <klarkxy@users.noreply.github.com>
2026-11-11 13:32:59 +08:00
yetone 7869318d6a agy-cli 0.1.12: a tool step's estimated cache read stops at the step before it, so a new tool result is billed as input (#971 review)
0.1.11 (#971) estimated an uncalibrated first prompt's tool steps by
summing every earlier settled step's whole window as the cached prefix.
Each window already holds the steps before it, so the prefix was counted
once per step: from the third step on, the step's whole window, the tool
result just added included, came back as a cache read. In the review's
probe (four Read calls, ACP reporting cachedReadTokens 0), step 4 billed
0 input and 34,456 read, and the steps claimed 56,608 cache-read tokens
that ACP never reported.

The prefix is now the largest earlier settled window (the step before),
so each step reads that from the cache and bills what was added since.
The step test that pinned the 100% clamp now checks that step 3's
uncached input covers what was added after step 2, and that its read
does not exceed step 2's window. Still an estimate until ACP reports.

Run (WSL2 Ubuntu 24.04, Bun 1.4.2, temp HOME): bun test packages/agy-cli
8 of 8 pass; bun scripts/check.mjs agy-cli passes.
Broken by hand: origin/main's index.mjs with the new test, node --test
test/usage-settlement.mjs: 25 pass, 1 fail ("第三步未缓存 input 0 应覆盖
第二步之后新增的 32"). Restored, green.
Not tried: Windows (main's smoke red there is #973), macOS (mote refused
ssh), a real agy.
2026-11-11 13:31:30 +08:00
Klarkxy 73d2006444 agy-cli 0.1.11: sessions survive canonicalized tool input; a first prompt's tool steps count the settled prefix as cached (ChrisJ_AI on X, klarkxy #971)
Reported by ChrisJ_AI on X: Claude Code on an agy-cli model showed 268K-input turns
at 0% cache hit, turn after turn.

Two places dropped cache reuse; both are klarkxy's #971 (closes #970):
- a follow-up turn after the client filled defaults into historical
  tool_use.input (Edit's replace_all) failed matchesHistory / takeParked, so
  the live agy session was retired and the whole prefix replayed;
- tool steps of a fresh process's first prompt reported every token as a
  cache miss until the prompt ended (no ratio learned yet).

Run at reviewed head 27245320 (win-run, xiaomi-gpu): node --test
test/usage-settlement.mjs 26/26 pass; the same file against c27ba5f7's
index.mjs fails tests 20, 21 and 24 (red on old code). bun test
packages/agy-cli: 7 of 8 pass, smoke.mjs 1 failure of 321 checks, the same
count on c27ba5f7.
Not tried: a real agy (signed out on every machine here, mote refused SSH),
so the 0% was not reproduced against Google's cache; the in-turn figure is
an estimate, not ACP usage.
2026-11-11 13:20:37 +08:00
yetone 6c20f1dac7 antigravity 0.1.3: a refused credits ask no longer ends in "Body already used" (eric_li8983 on X)
With Use AI credits on, a 429 from the plan's quota was cancelled before the
second ask with credits; when that ask was refused too, the code read the
cancelled body and threw, so every retry came back as a 502 "Body already
used" and the quota's 429 was never told. The refusal is read first and told
when the credits ask fails or throws.

Run: bun test packages/antigravity (84 pass); the new test is red on the old
index.mjs (TypeError: Body already used), green on the new. Other packages that
cancel a body before a retry reassign the reply (read: kiro, minimax, nous,
atomcode, joycode, gcp-ai, factory); none read the cancelled one.
2026-11-11 13:14:34 +08:00
yetone 8adf0a7d79 notify 0.1.4: a sidebar page to edit channels and settings, and a switch that turns every push off (meili145 on X)
The page (magpie.page) edits the plugin's options without a file: add,
pause and remove channels per kind, when to send, agents, language, and an
on/off switch that saves at once (new option enabled, default true; off
sends no turn push and no sign-in push).

Run: bun test packages/notify (67 pass; the enabled test fails on the old
hook), scripts/check.mjs ok. Page tried in magpie's real window (dev build
of origin/main, sandbox HOME, plugin added from the folder) in chromium:
add ntfy channel, Save and the switch wrote plugins.json options, 5
languages at 1000px and 420px with no overflow. Not tried: WebKit (its
launch failed on mote), a real push from the page.
2026-11-11 13:13:40 +08:00
atttmin 35468c76d7 wave 0.1.0: Wave Terminal as a magpie agent (#938)
Adds Wave Terminal (waveterm) as a magpie agent. connect writes one whole
"magpie" mode in ~/.config/waveterm/waveai.json (display:name, model,
the gateway's /chat/completions endpoint, openai-chat, the key, and
capabilities with images when the model takes them), so switching off
removes the mode and leaves the user's own modes alone.

Run at 2f08c0df merged with origin/main c27ba5f7, on the Windows box with
a fresh HOME: bun test packages/wave 4 pass, scripts/check.mjs exit 0.
Broken by hand: removing display:name turns the connect test red.
Not tried: a real Wave app run (Electron, not run headless).

Co-authored-by: atttmin <46617048+atttmin@users.noreply.github.com>
2026-11-11 12:39:43 +08:00
yetone c27ba5f700 agy-cli 0.1.6: every prompt's own cache reads set the ratio the next tool steps report (baranwang on X)
Tool steps estimate their cache reads from the last ratio the proc learned,
and only a final, uncancelled response taught it, so a cancelled prompt left
the next one's tool steps reporting every token as a cache miss. agy reports
each prompt's cached reads, so recordPromptUsage now sets the ratio from them.
Test: a cancelled prompt (390k of 520k cached) then a tool step reports 0.75.
Red with the line off, green with it. Not captured from a real agy: the
owner's agy is signed out on this machine and mote was down. A fresh
conversation's first prompt still has no ratio until it ends.
Ran node --test packages/agy-cli/test (2 reds on base too: cp-hook,
version/report hangs), bun test packages/antigravity, scripts/check.mjs.
2026-11-11 11:55:10 +08:00
yetone 5623d7123f antigravity 0.1.2: a Use AI credits switch spends Google AI credits once a plan's quota is used up (eric_li8983 on X)
Untested yet; tests to run on mote.
2026-11-11 11:45:15 +08:00
caozhenyuanandcaozhenyuan d91f8e31a0 kiro 0.1.37: switches to pin an Identity Center account to one credit region (#964)
Two switches in the provider's editor, "Use us-east-1 only" and "Use
eu-central-1 only" (us-east-1-only, eu-central-1-only), pin an Identity
Center account to one credit region. They are read with input.magpie.option
at each request.
- With one on, every request goes to that region. If that region is not
  enabled or is used up, the answer is a 429 naming the switch, and the
  other region is never tried.
- auth.usage counts only the pinned region. If the pinned region is not
  enabled or couldn't be read, a used-up window gives the reason, so the
  account is left out of routing.
- The not-enabled reminder names only the pinned region.
- Both off, or both on, is the default.

Run at 38c18529 merged with main 7153e59d (Windows 11, Bun 1.4.2, temp
HOME and USERPROFILE):
- bun test packages/kiro: 178 pass, 8 fail. The 8 are the EBUSY cleanup
  reds that fail the same on main on Windows (#966).
- bun scripts/check.mjs kiro: ok.
- The review's two probes, the reminder under a pin and an unenabled
  pinned region, now give the right card.
Broken by hand: dropping the pinned-reminder filter and the unenabled-pin
window turns 3 region tests red.
Not tried: a real Identity Center account in both regions, and the
switches in magpie's editor.

Co-authored-by: caozhenyuan <caozhenyuan@users.noreply.github.com>
2026-11-11 11:35:34 +08:00
1sh1ro 7153e59d78 page-model-quota 0.1.0: the tokens each model has left, across accounts (#932)
A page that shows how many tokens each model has left across your accounts. It is estimated from magpie's quota windows (/v1/magpie/quotas) and past usage rounds: the median tokens per percent over the rounds that can be used, or one round, or "sparse". The report carries no prose. The page words everything in English or Chinese. The service binds only to loopback, checks the Host, refuses a foreign Origin, wants a per-run key for Origin null, serves index.html to navigations only, and writes nothing under HOME. page-model-quota 0.1.0.

Run at the reviewed head dd8d44164d505088efeb07d80784128134aad213, on the Windows box (mote's sshd was refusing connections):
- node --test test/*.test.mjs: 14 pass. bun test: 14 pass. bun scripts/check.mjs: exit 0. It merges cleanly with main 86d3febf.
- Broken by hand: taking the space out of " (from past rounds)" again turns i18n.test red (13 of 14).

At a5d9a8c5, on mote and in WSL (from the review): the Host, Origin, key and navigate-only checks each went red when broken. Wrong Hosts got 403, Origin null without a key got 401, traversal got 404, and a restart rotated the key. The page rendered in Chromium and WebKit at 1200px and 420px, with no Chinese in English. Since then, only the English note's space, an unused usableRounds, the English gateway error and template-literal coverage in the i18n test have changed.

Not tried: in a real magpie window with real quota windows.
2026-11-11 10:49:01 +08:00
Mars-Sea 86d3febf9b factory 0.1.45: optional model ordering by company (#959)
An opt-in switch, "Group models by company", orders Factory's models by maker: Claude (Fable, Opus, Sonnet, Haiku), GPT, Gemini, Grok, GLM, Kimi, then the rest. Within a family, newer versions come first, and each Fast Mode model sits right after its base. Off, which is the default, keeps main's order byte for byte. Only a strict `true` from magpie's option turns it on. factory 0.1.45.

Run at the reviewed head fe96f7eb67b308a31ce33492fd3c5d5f19a4f5b1:
- On mote at 9b19aa76: bun test packages/factory 196 pass (main 194). Main's and this index.mjs were compared as JSON of the config hook and provider.models: off is identical to main for absent, {}, false, "true", 1, null, a throwing option and `option: 5`; on, there are 59 models, the same set, with no duplicates.
- On the Windows box at fe96f7eb (mote's sshd was refusing connections): bun test packages/factory 196 pass, bun scripts/check.mjs exit 0.
- Broken by hand at fe96f7eb: grouping always on turns both order.test.mjs tests red. Before the review's fix, it stayed green.
- npm has 0.1.44.

Not tried: in a real magpie window.
2026-11-11 10:48:37 +08:00
Calmhayl 2ee2ee84f9 layerfs 0.10.1: recover the page service after a host handover (#961)
When plugins change, magpie retires the old plugin host and starts a new one. The old host can keep port 43717 for up to 10 minutes while it finishes calls. In 0.10.0, the new host stored its failed bind as the service, and `if (service) return` blocked every later try. Once the old host exited, the page stayed refused until the host restarted.

Now a service is kept only once it is listening. A failed bind retries with backoff (1s, doubling, capped at 30s, the timer unref'd) while a store exists, and a listener that closes starts again. A failed backend start is retried too, and the first mutation's race with the empty-store check gets one more check. layerfs 0.10.1.

Run at the reviewed head 6f2d484e8f3367d1d614d4be5d9a44a701165fb4, on mote (temp HOME, Bun 1.4.2):
- bun test packages/layerfs: 68 pass (main: 64). page-lifecycle.test.mjs: 3 of 3 green. bun scripts/check.mjs: exit 0.
- The new tests against main's index.mjs: the handover and backend-retry tests go red.
- Broken by hand: dropping the backendPromise reset, the retry schedule, or storing the service before it listens each turns a test red.
- Probes: a closed listener comes back; with the port held for good, the retries cap at one every 30s and leak no servers; a pending retry doesn't hold the process open. page-service.mjs is unchanged, so its Host and Origin checks cover every retry.

Not covered by a test (follow-up): restarting a closed listener, sharing one startup between concurrent calls, and the store-version recheck. recheck and storeVersion overlap: either alone handles the race.
2026-11-11 10:25:25 +08:00
yetone f8a52a2477 day-card 0.2.1: the blur and dim sliders stay put while a slider is dragged (#957)
paintPicker called pop.classList.toggle("photo", B.meta(bg.bg).photo).
A pattern's photo was undefined, not false, and toggle(name, undefined)
flips the class. So each input event of the margin or blur slider hid
or showed the blur and dim sliders in turn. The reporter saw both
states with the teal backdrop picked.

Every backdrop's photo is now a boolean, and the toggle asks for
=== true.

Run, on mote:
- bun test packages/day-card: 15 pass. bun scripts/check.mjs: exit 0.
- A Playwright repro (not committed) loads the page with a stub bridge,
  picks teal, fires input on the margin slider four times, then picks
  alpine and drags blur, then goes back to teal. In Chromium and WebKit
  the old page shows blur as false,true,false,true,false. The new page
  keeps it hidden on teal and shown on alpine on every tick.

Broken by hand: with backgrounds.js from main, the new test goes red
(1 of 15).

Not tried: in magpie's own window on Windows, where the reporter is.

Reported-by: lbjxr
2026-11-11 10:10:36 +08:00
yetone 9001e6f082 factory: every droid promotion is checked inside its own window (#954)
The rate tests held one date, 2026-10-14, so a promotion starting after
it was never compared with PROMOTIONS. Dropping gemini-4-carbon's line
(#953, from 2026-11-10) left every test green. The new test checks each
promotion droid's registry lists, inline or named, a minute after it
starts, a minute before it ends and a minute after, against what
configModels gives then.

GPT-6 Astra's 60% off ended 2026-09-05, before PROMOTIONS was kept, and
is skipped by a fixed LISTED_SINCE (2026-10-01); with no cutoff the
test was red on it. 7 promotions are checked.

Run on mote with a sandbox HOME: bun test packages/factory, 194 pass.
Broken by hand: deleting Carbon's PROMOTIONS line turns the new test
red (the old ones stay green); Argon at 0.4 turns it and two more red;
the count bar at 99 shows 7 checked.
Not run: the root suite (test-only change in one package; CI runs it).
2026-11-11 08:49:54 +08:00
Mars-SeaandMars-Sea 8ae971dedb factory 0.1.44: add Gemini 4 Carbon (#953)
Registers gemini-4-carbon on Factory's Google Gemini route, with the same shape as gemini-4-argon: 1M context, 65536 output, low/medium/high, a 1.6x multiplier and 50% off from 2026-11-10T16:00Z to 2026-12-01T08:00Z. Factory 0.1.44.

Reviewed and run at fd9b634f41d7021715842f3db7bde28a9e8e6888:
- Downloaded Droid 1.7.1 (darwin/arm64) on mote: SHA-256 761730017d94…7bd4, as the testdata says. The Carbon entry in the binary is byte for byte the testdata line, and it differs from Argon's only in id, name, the feature flag, the pricing note and the dates.
- mote, sandbox HOME: `bun test packages/factory` 193 pass; `bun scripts/check.mjs factory` ok. PR CI (root suite under a temp HOME) green.
- Broken by hand: Carbon at 1.5x turns 3 rate tests red. Carbon sits at index 48 of 59, after the Fast Mode block's rule; the first 24 are unchanged.
- Not caught: dropping Carbon's promotion leaves every test green, since the promotion test reads only named promotion variables, not inline `promotions:[…]`. Argon has the same gap on main.

Not tried: a real request. Carbon is behind Factory's Gemini4Carbon flag, unreleased in Droid 1.7.1.

Co-authored-by: Mars-Sea <Mars-Sea@users.noreply.github.com>
2026-11-11 08:48:27 +08:00
yetone 9452521770 workbuddy 0.2.27: version bump for the check-in expiry change (cdredfox on X) 2026-11-11 08:15:45 +08:00
yetone 3d7b67aeb3 workbuddy 0.2.27: check-in rewards the summary doesn't list say when they lapse (cdredfox on X)
The Credits and Total windows said when the soonest credits left run out
(runsOutOf), but only over the packages the resource summary lists. A daily
check-in reward (code 007, each with its own end) that only the detail lists
have, beside extra credits the summary does list, was in no window and in no
expiry, so Smart routing never saw those credits lapsing. runsOutOf now also
counts the extra codes WorkBuddy's panel counts (EXTRA_CODES, plus the free
month and gift on WorkBuddy AI) when given the site, on the extra window, and
on the single window when no window of its own holds them.

Run: bun test packages/workbuddy (336 pass, HOME=$(mktemp -d)); the new test
fails on the old code (broken by hand: stashed index.mjs, red).
Not tried: a real account (the desktop sign-in on this machine was stale, so
the real list shape of a check-in reward is the 2026-10-26 fixture's, 007
"赠送积分", not seen live today).
2026-11-11 08:15:30 +08:00
yetone 68e73c4797 agy-cli 0.1.5: release #951 (user text beside a live tool result)
9a96799e merged #951 without a version bump, so its fix would not reach
the dist branch. This bumps packages/agy-cli to 0.1.5, which publish.yml
packs to dist.

Run: bun scripts/check.mjs agy-cli on mote: ok. The package tests for the
code in this release (8 pass, 0 fail) were run at #951's head merged onto
d5f4214e, the parent of 9a96799e.
2026-11-11 04:33:58 +08:00
DaWei LiuandGuuuu233 9a96799efb agy-cli: user text beside a live tool result replays the round in a new prompt (#909, #951)
A user message that carried ordinary text beside a live tool_result, before
or after the result block, was refused with 400 "text beside a live
tool_result; send it after the tool response completes" (maxleebeta's
DeepSeek-harness agent, #909; Claude Science does the same). inspectToolTurn
now marks such a turn userSteered, so the bridge takes the existing replay
path: the old session is stopped, its pending calls are not resolved, and a
new session/prompt carries the round, the real tool result included. The
user's text is never spliced into an MCP function response. The same goes
for plain text after a Skill result, and for a hook line that carries "The
user sent a new message while you were working".

Still refused: an unclosed protocol notice (<system-update>... with no end
tag) on either side of the result, a companion (ARGUMENTS:, [Image: ...],
Tool loaded.) with no matching preceding tool, and an image before the first
tool_result. A turn whose tools also grew (#942) takes the same single
replay.

Changed behaviour beyond #909: a protocol notice, token line or hook-success
line placed before the tool_result (previously 400) now replays in a new
session, where the same line after the result is forwarded in-session.

Tests: compat.mjs checks both placements are userSteered, the MCP result
is unchanged, and the replay carries the instruction and the result. smoke.mjs
drives both placements and the Skill case through the fake agy and checks a
new convId whose prompt carries both. Five smoke checks that asserted 400
for text the bridge now replays were removed; the unclosed-notice 400 check
stays.

Run at head 04692ce0a74d (merged onto origin/main d5f4214e) on mote, bun 1.4.2:
- bun test packages/agy-cli: 8 pass, 0 fail, at the head and merged
- bun scripts/check.mjs agy-cli: ok, at the head and merged
- Broken by hand (index.mjs reverted, tests kept): compat 1 fail (the new
  test); smoke 3 FAILURES of 321 (before, after, Skill: status 400)
- Probe of inspectToolTurn merged: the user text appears once in the replay
  and the result once; MCP content stays "file contents"

Not run: the root bun test suite (mote's suite queue was long); the
reporter's own request bytes (never obtained, #909 stays open for them).

Co-authored-by: Guuuu233 <308638291+Guuuu233@users.noreply.github.com>
2026-11-11 04:33:33 +08:00
yetone d5f4214eff antigravity 0.1.1, antigravity-cloak 0.1.3: two zero-width spaces a word, and a 429 says it is a 429 (shzutbi1 on X)
Google turns Claude Code's billing line and "built on Anthropic's Claude
Agent SDK" away again when only the first letter is broken (checked on a
real Antigravity account with Claude Code 2.1.316's prompt); a break after
the first and the second character of each word goes through, 3 of 3.
Both packages break every run of three or more letters or digits that way.
antigravity's error for a turned-away prompt said "400 ... as from an
unapproved channel" about what Antigravity answered as a 429; it now says
"Antigravity answered 429 to this system prompt".

bun test packages/antigravity packages/antigravity-cloak on mote: pass.
cases.json expectations regenerated for the new breaks.
2026-11-11 03:54:21 +08:00
yetone 450279c4e0 agent-agy 0.1.0: Antigravity CLI (agy) as an agent plugin
The agent plugin magpie's built-in agy moves onto. It names agy's
settings.json, where magpie's models go beside the user's own
(merge: customModelsConfig.customModels), and how agy is started:
GEMINI_API_KEY and GOOGLE_GEMINI_BASE_URL from magpie's gateway and
--model, given by the agy function magpie puts in the user's shells.
own() lists the user's own custom models by their provider.

Run: bun test in packages/agent-agy (3 pass) and bun scripts/check.mjs
(ok) on mote. magpie's TestAgyPlugin, TestAgyHandedToPlugin and
TestAgyHandedOverUnwire load this file and pass against the magpie
change that reads launch, merge, effort, wsl and aliases. A magpie
without that change keeps agy its built-in's, so this package does
nothing there.
2026-11-11 03:46:52 +08:00
yetone ea3573bfe9 zcode 0.1.58: an account served fewer than three is narrowed, not held; trial entries are free (#438)
takomitkm (plugins#438, 0.1.57, default settings) had the busy hold arm
with one account, one agent and at most two in flight, at about five
asks a minute, and arm again within a minute of its end. A coding plan
model's weekly or monthly limit (1310) also rested the whole account, so
its -Trial models got the cached 1310 without being asked.

Busy hold. ZCode serves that account one Start Plan request at a time,
so every second request was refused again at its 1s re-ask and counted
toward the process-wide hold. A sustained cap with others of the same
account in flight (the gate's lane busy >= 2) now narrows that account's
gate to busy-1, at least one, for NARROW_FOR (5 minutes; startGate.now
is its injectable clock) and counts toward no hold. A lone sustained
cap still counts, so the hold stays process-wide and keeps the firewall
protection: #801's caps came with up to ~10 in flight, which the gate
never sends, and an account whose slots are taken elsewhere narrows
3 -> 2 -> 1 within a few caps and is then refused alone, which arms the
hold as before. The queue answer says the account's current number.

Rest. The models hook marks each -Trial entry free: true, so magpie's
PaidBesideFree makes a coding plan model's quota refusal rest that
model, not the account. Gift-only accounts' plain names stay unmarked.
Side effects: the Free mark in pickers, free-preferring groups pick the
trials first, and they price at 0, which they are.

Run (mote, bun 1.4.2, HOME=$(mktemp -d)): packages/zcode bun test,
240 pass, 0 fail, 17 files, at this head rebased on 60acd62b;
bun scripts/check.mjs exit 0.

Broken by hand:
- narrowing off (if (false && ...)): the three new inflight tests fail;
  the reporter's case shows the hold armed (until=1000000240000).
- lone caps narrow too (busy < 1): seven hold tests fail (the
  saturated-elsewhere replay, refused-even-one-at-a-time, start.test's
  hold tests, dual's hold test).
- free: true removed: the new gift test fails.

Tests: inflight.test's reporter's case (fake caps at >= 2 in flight,
injected clocks), the narrowing's expiry, and a lone refusal still
arming the hold; gift.test's free trial entries. start.test's in-flight
guard now uses twelve accounts of one request each, and dual.test's hold
test a gate of one, so their caps stay lone ones.

Not tried: a real ZCode account served one at a time; the core side
(magpie's TestZCodeCodingPlanLimitLeavesTrials) is in magpie with the
mover min.

Reported-by: takomitkm
2026-11-11 03:26:57 +08:00
yetone 60acd62bee agy-cli: a tool loaded mid-turn starts a new prompt with the round replayed (#942)
agy checks each call against the tools it listed before the prompt began.
After ToolSearch loads a deferred tool, the client's next request declares
it, and the bridge sent tools/list_changed and then continued the same
session/prompt. agy's validator still answered `unknown tool: "<name>" —
check spelling` for the rest of that prompt.

When the tool-result request declares a tool the process has not listed
(Proc.toolsGrew), the bridge now takes the existing changed-context path:
it drops the process without resolving its calls and replays the history,
the ToolSearch tool_use and its tool_result included, in a new
session/prompt, where agy lists the full catalog first. The user's turn is
in the replayed history once. The new process starts with the grown
catalog, so the next result continues it live and nothing loops. A catalog
that only loses or changes tools still continues the live turn.

Tests (test/smoke.mjs, fake agy): TOOLSEARCHGROW checks calls against the
tools listed at prompt start, like agy 1.5.3. The new block checks that the
grown catalog starts a new session/prompt, that it replays the ToolSearch
round with the user's ask once, that the old prompt never reaches the
validator with the new tool, that the loaded tool's call reaches the client,
and that its result continues the new session with no second replay. The
"live tools change" case now removes a tool instead of adding one.

Run on mote (Bun 1.4.2), at this tree:
- packages/agy-cli `bun test`: 8 pass, 0 fail; smoke.mjs ALL OK (319 checks).
- `bun scripts/check.mjs agy-cli`: registry.json and agy-cli ok.
Broken by hand: sed removed `|| proc.toolsGrew(tools)` from the condition;
smoke.mjs went 5 FAILURES (319 checks), the five new checks; restored, ALL OK.

Not run: the root `bun test`. It waited behind about 20 queued suites on
mote's suite.lock for over an hour, and WSL answered E_UNEXPECTED.
Not tried: a real agy 1.5.3 run.

Version 0.1.4.

Reported-by: chrisjian <chrisjian@users.noreply.github.com>
2026-11-11 03:11:42 +08:00