Commit Graph
1090 Commits
Author SHA1 Message Date
Junhan WangandJJERRYY 5efe4e73c3 antigravity 0.1.5: sessionId from the host's session header, past injected preambles (#1017)
sessionOf took the first text of the first user message only, so every
Codex thread (and anything else opening with AGENTS.md or
<environment_context>) sent Antigravity one constant sessionId. It now
hashes the x-magpie-session header magpie's gateway sends plugins
(sessionOf: X-Magpie-Session, else the agent's own session header), with
x-magpie-subagent (Claude Code's agent id) and the first real prompt
added when a subagent is named. With no header it hashes the first user
text that isn't an injected preamble (AGENTS.md, environment_context,
permissions instructions, system-reminder, and the rest of
INJECTED_USER_TEXT). A synthetic magpie-<24hex> id is ignored. A
chat.headers hook passes OpenCode's sessionID on as x-magpie-session.
The header never goes upstream: the plugin builds its own request
headers, and host.js's unsaid strips it too. Version 0.1.5 (dist has
0.1.4).

Run at 7709ff67 on mica (mote was at load 24), temp HOME:
bun test packages/antigravity: 88 pass, 0 fail. bun scripts/check.mjs:
exit 0. Merges cleanly with origin/main edc6dbcd (it is the merge base).

Broken by hand, each red: header ignored (2 tests), preamble skip
removed (1), subagent ignored (1), chat.headers not setting the header
(1), synthetic magpie-<hex> id not filtered (1).

Not tried: a real Antigravity request (fake fetch only); whether Google
treats sessionId as more than cache affinity. Known edges, not
blocking: a first turn whose user messages are all preamble hashes the
preamble, and the next turn with a real prompt gets a new id; inside
magpie, chat.headers sets x-magpie-session to the conversation id (the
agent's own session header first), so a caller's own X-Magpie-Session
loses to the agent's header, as in magpie's affinityID.

Co-authored-by: JJERRYY <17349077+JJERRYY@users.noreply.github.com>
2026-11-12 00:48:53 +08:00
yetone edc6dbcd6e gumloop 0.1.1: two hosts' charges are never lost (#1011)
Cause: the bakery lock's wait for a peer is bounded at LOCK_WAIT_MS
(250ms). When it ran out, Store.change returned undefined and the
charge's callback never ran: the chat succeeded and its charge was
dropped. Two hosts charging back to back on a busy runner (a GC or
scheduling stall in the holder, or many contenders) hit that, which
is the 199 of 200 in publish run 43040437938. An unreadable ledger
dropped the change the same way. Mutual exclusion itself held: an
instrumented copy logged one lock timeout per missing charge and no
unexplained loss.

Fix: Store.update. A change whose lock wait runs out, or whose read
fails, hasn't run, so it is kept in memory (capped at 1000) and runs
once, in order, the next time the store holds the lock and can read
the ledger: on its next update, from an unref'd retry timer (25ms
doubling to 5s, each waiting 25ms), or from the exit hook, which waits
up to 2s. A failed read still never writes. A throwing callback still
leaves the disk as it was. change, anchor and setPrices go through it.
charge and the credit refusal date their record when the call ended,
not when a kept change runs. The crash-phase tests' instrumented
module goes to a file: as a data: URL on the command line it passed
Windows' 32K limit.

Tests: the live-owner, leftover-record and choosing tests now hold
that the waiting changes land (they asserted the drop). New: a Node
and a Bun host that exits while its charge waits for a busy peer
still writes it.

Ran (worktree at a69931ec + this change):
- stress: 8 processes x 60 changes, holder pauses up to 200ms: old
  code lost 17-71 (mote), 93-108 (Windows) charges, each a lock
  timeout; new 480/480 on mote, Linux and Windows, Node and Bun,
  with 39-146 timeouts each.
- old gumloop.mjs under the new tests: 6 red.
- broken by hand: no exit flush -> both exit tests red; no retry
  timer -> the live-owner test red.
- packages/gumloop bun test x20: mote 20/20, magpie-desktop (Linux)
  20/20, xiaomi-gpu (Windows, temp HOME/USERPROFILE) 20/20.
- bun scripts/check.mjs ok; root bun test on magpie-desktop (Linux, under
  the suite lock): 8374 pass, 19 skip, 0 fail
- rebased on 2b87fad9 (no gumloop change between): packages/gumloop
  bun test x5 on mote 5/5, bun scripts/check.mjs ok.

Not tried: a host killed (not exited) with kept changes loses them;
no network filesystem.
2026-11-11 23:46:22 +08:00
KlarkxyandKlarkxy 2b87fad98d minimax 0.2.7: opt-in compactTools lists only the four dispatcher tools (#1014)
Adds the plugin option `compactTools` (default false, declared in
package.json `magpie.options`). Only an explicit `true` leaves the sixteen
named Matrix tools out of the tools plugin's advertised list; `list_tools`,
`tool_schema`, `call_tool` and `web_search` stay, built by the same code,
with descriptions and schemas unchanged. `call_tool` still checks arguments
against the live catalog. This is option A as decided on #1005; option B
(rewritten descriptions) is not in it.

Run at the reviewed head a2d18183, on mote with a temp HOME:
- bun test packages/minimax: 165 pass, 0 fail
- bun scripts/check.mjs: exit 0
- Advertised list (name, description, args) hashed with
  MiniMaxCodeToolsPlugin at origin/main dba24067 and at the head: for no
  options, {}, and {compactTools:false} both give sha256 3cacc575d5abf786…
  (32300 chars), so off is byte-identical to main; {compactTools:true}
  gives 3890 chars at the head.
- git merge-tree with origin/main dba24067: clean.

Broken by hand, each red then restored:
- off path builds the Matrix tools after the dispatchers (order change):
  "compactTools off leaves the advertised tool list byte-for-byte" and
  "discovery stays scoped to Matrix" go red.
- on path appends text to list_tools' description: both "on ... unchanged"
  tests (connector-tools and the tools plugin) go red.
- compactToolsOn(options) as Boolean(options?.compactTools): "only true for
  an explicit true" and the off byte-for-byte test go red.

Not tried: a real MiniMax account or a live agy catalog; fake fetch only.

Co-authored-by: Klarkxy <6316992+klarkxy@users.noreply.github.com>
2026-11-11 23:44:15 +08:00
Mañjūṣakaandmanjughosa dba24067c2 output-strategy 0.2.3: remove the panel byline; keep attribution in the README (#1009)
Removes the "by" byline from the Output Strategy panel (index.html, i18n.js, style.css); the attribution stays in the README. Bumps the package to 0.2.3 so dist packs it (0.2.2 is already packed and is never packed again).

Run at the reviewed head 121f571f (on mote, temp HOME):
- `git diff 0d03f7bf 121f571f`: only package.json 0.2.2 -> 0.2.3 and the matching version assertion in test/page.test.mjs. Everything else was reviewed at 0d03f7bf.
- packages/output-strategy `bun test`: 59 pass, 0 fail. `bun scripts/check.mjs`: ok.
- Root `bun test` (suite lock) on origin/main a69931ec merged with #1009, #1012 and #1013: 8373 pass, 0 fail (8392 tests across 590 files, 361s; the rest skipped), on Linux (Ubuntu 24.04, magpie-desktop) because both Macs' suite locks were held by hours-long runs. `bun scripts/check.mjs` on that tree: ok.
- Earlier, at 0d03f7bf: Playwright 1.62 Chromium and WebKit at 1200 and 420px, en and zh-CN, with a stub bridge. No byline, the conversation note shows, all 7 styles load, no horizontal overflow, no page errors.

Broken by hand (at 0d03f7bf): putting main's page/index.html back, or main's page/i18n.js, makes 1 test fail ("shows conversation guidance in both languages without a panel byline").

Not tried: the panel inside a real magpie window.

Co-authored-by: manjughosa <3220325975@qq.com>
2026-11-11 23:37:38 +08:00
ming_jiang 46f5e1ae7b registry: Amp Usage shows its icon in the store (#1013)
Gives Amp Usage's registry entry an `icon`, so the store card shows the package's own icon instead of the generic page one. It points at packages/amp-usage/page/icon.svg in this repo on main, the same way Window Warmup and 书生·端砚 do, so only this repo's maintainers can change what it serves.

Run at the reviewed head 8a8049fd (on mote, temp HOME):
- `bun scripts/check.mjs`: ok. `bun test scripts`: 22 pass, 0 fail. packages/amp-usage `node --test`: 47 pass, 0 fail.
- The URL answers 200, image/svg+xml, 3391 bytes, the same bytes as the file on main (added in #1000). The SVG has no script or external reference.
- Rendered the SVG as <img> at 20, 32 and 64px in Playwright 1.62 Chromium and WebKit: decodes, no page errors, the Amp wordmark reads at 20px.
- Root `bun test` (suite lock) on origin/main a69931ec merged with #1009, #1012 and #1013: 8373 pass, 0 fail (8392 tests across 590 files, 361s; the rest skipped), on Linux (Ubuntu 24.04, magpie-desktop) because both Macs' suite locks were held by hours-long runs. `bun scripts/check.mjs` on that tree: ok.

Not tried: the store card in a real magpie after it fetches the new registry.

Co-authored-by: ming jiang <jm1179356055@gmail.com>
2026-11-11 23:37:33 +08:00
zhou.hanandzhou.han 24a327eeb1 codearts: test an IDE write-ahead log rewritten in one clock tick (#1012)
Test only. Adds a codearts regression for #1007's fix (029c628f): the IDE's -wal is rewritten within one clock tick, with the main database's bytes, the sidecar's size and its mtime unchanged, and the reader still picks up the new credential. No package bump: nothing shipped changes.

Run at the reviewed head d53a142a (on mote, temp HOME):
- packages/codearts `bun test`: 203 pass, 0 fail. `bun scripts/check.mjs`: ok.
- Root `bun test` (suite lock) on origin/main a69931ec merged with #1009, #1012 and #1013: 8373 pass, 0 fail (8392 tests across 590 files, 361s; the rest skipped), on Linux (Ubuntu 24.04, magpie-desktop) because both Macs' suite locks were held by hours-long runs. `bun scripts/check.mjs` on that tree: ok.

Broken by hand: ideReader's sidecar loop changed to `for (const suffix of [])`, so -wal and -journal no longer go into the stamp. Only the new test fails (202 pass, 1 fail: "the IDE's write-ahead log rewritten in one clock tick is read again"); none of the existing tests caught it. With the code restored, it passes.

Not tried: a real CodeArts Agent IDE writing its WAL.

Co-authored-by: zhou.han <18181754+yetihan@users.noreply.github.com>
2026-11-11 23:37:28 +08:00
ming_jiangandming_jiang a69931eccb amp-usage: test the auto-refresh default (#1006)
Adds a test for the amp-usage page's auto-refresh default (300s), which #1000 left untested. The test runs ui/app.js on a small stand-in for the browser. With nothing kept and the last scan 4 minutes old, the page only polls /api/status. At 6 minutes it also calls /api/refresh. Test-only, no release.

Run at the reviewed head 78a0e830, merged with origin/main 1e5b1c83, on mote with a temp HOME:
- packages/amp-usage: `node --test test/*.test.mjs` 48/48 pass, `bun test` 48 pass 0 fail
- `bun scripts/check.mjs`: ok
- root `bun test`: 8370 pass, 20 skip, 0 fail (590 files, 328s)

Broken by hand: I changed `kept("auto", 300)` in ui/app.js to 60, then 600, then 0. The new test is red in both node and bun for each one, and the other 3 tests in the file stay green.

Not tried: a real browser. The test runs on a stand-in for it.

Co-authored-by: ming_jiang <23260162+overstarry@users.noreply.github.com>
2026-11-11 22:45:06 +08:00
yetone 029c628ff8 codearts 0.3.12: an IDE rewrite in the same mtime tick is read again (#1007)
Cause: ideReader kept the last read of CodeArts Agent's state.vscdb
under a stamp of size:mtimeMs:ino (plus -wal/-journal size and mtime).
An in-place SQLite write keeps the inode and page count, so two writes
within one tick of the file system's clock left the stamp unchanged and
the old credential came back. The test's rewriteIde hit exactly that:
two rewrites a few ms apart, each with mtime Date.now()+5000, so when
both landed in one millisecond the renewal test saw IDEAK2's cached read
and said "hasn't renewed" instead of "another account" (~1 run in 3).

Fix:
- ideReader stamps the inode plus a sha1 of the bytes of the database,
  its -wal and its -journal, read in 1MB pieces (no copy, no SQLite
  open; it runs only on an IDE sign-in's renewal). A file that can't be
  read, or is past IDE_DB_MAX_BYTES, gives no stamp, so it is read again
  rather than taken as unchanged.
- rewriteIde gives each rewrite a strictly later mtime (>= 1s after the
  previous one).
- New test: the file rewritten at a fixed mtime with the same size and
  inode is read again; a removed file is not the last read.

Ran (mote, Bun 1.4.2, HOME=$(mktemp -d), at 1e5b1c83 + this change):
- bun test packages/codearts 8 times: 202 pass, 0 fail each.
- bun scripts/check.mjs: exit 0.
- root bun test under lockf ~/suite.lock: 8370 pass, 20 skip, 0 fail.
- Windows (xiaomi-gpu, temp HOME/USERPROFILE): bun test packages/codearts
  twice, 202 pass, 0 fail each.

Broken by hand: the old size:mtimeMs:ino stamp back in ideReader turns
the new test red (1 fail). rewriteIde with a fixed time
(new Date(2000000000000)) and the new reader: the renewal test passes
3 of 3.

Not tried: a real CodeArts Agent writing its state.vscdb; no Huawei API
was contacted.
2026-11-11 22:38:29 +08:00
zhou.hanandzhou.han 1e5b1c8317 codearts 0.3.11: OfficeAce routes by its total credit, not each bucket (#986)
An OfficeAce account is now routed by one 总积分 window: the total of every unexpired plan bucket (`skus[].quotas`) and activity bonus (`bonus_skus`). Each bucket stays visible as an `aside` detail, so a spent daily check-in bonus (每日签到有礼 0 / 100) no longer pauses an account with thousands of credits left elsewhere (#981).

What changed (packages/codearts, 0.3.10 -> 0.3.11)
- fetchOfficeAceUsage sums unexpired buckets into 总积分 (amount, limit, two-decimal rounding; sub-half-cent totals keep their raw value). Every per-bucket window is `aside`.
- 总积分's `runsOutAt` is the soonest expiry among unexpired buckets that still hold credit, and `runsOut` is what those buckets hold on that Beijing day (soonestLapse, shared with #982), never more than the total's remainder. Trial and spent buckets never choose the expiry.
- Overspent buckets are capped at their own total; an empty or unparseable `expired_time` is no expiry instead of Invalid Date.
- When every bucket has expired, a used-up 总积分 (0 / total, used 100) stays so the account is paused, not routed without a limit.
- README (en, zh) says the same.

Rebased onto dea9e4e3 (0.3.10, #998): merge-base is origin/main, and the diff touches only the OfficeAce usage hunks, the tests, the README and the version. The international station signing, the Tokens window, the state.vscdb temp copy and the statement finalize are unchanged.

What was run at the reviewed head 4c454b99 (mica, macOS, Bun 1.4.2, HOME=$(mktemp -d))
- bun test packages/codearts: 201 tests; green except a pre-existing flake on main, "an IDE sign-in is renewed by reading the IDE's file again" (red 3 of 6 on origin/main 4b0aef53, 2 of 6 here; cause found and injected, filed as #1007).
- bun scripts/check.mjs and check.mjs codearts: exit 0.
- Root bun test under suite.lock: 8321 pass, 20 skip, 0 fail.

Broken by hand, each restored before the next, each red:
- a spent bucket choosing runsOutAt (the open item from the last review): "a spent OfficeAce daily bonus does not pause credits left in other buckets";
- runsOut as one bucket instead of the Beijing day's sum; runsOutAt from the latest expiry instead of the soonest;
- details not aside; no 总积分 window; an expired bonus counted; no used-up total when all expired;
- 0.3.10: a credential signed for every station's hosts; reading state.vscdb in place instead of a copy; no Tokens window.

Not tried
- No real Huawei Cloud / OfficeAce account; every response is a fake fetch.
- Windows: the diff doesn't touch the state.vscdb path, so the codearts tests weren't run there for this change.

Refs #981, #982

Co-authored-by: zhou.han <18181754+yetihan@users.noreply.github.com>
2026-11-11 22:16:09 +08:00
ming_jiang 4b0aef5327 amp-usage: Amp usage page with background collection; day-card 0.3.1 (#1000)
Adds packages/amp-usage (@magpie-community/page-amp-usage 0.1.0). It is a magpie page that reads Amp's local thread files and the gateway's usage.jsonl and shows per-day usage. The service listens on loopback only and requires a per-start service token on every API call. The page that carries the token is served only to a navigation (Sec-Fetch-Mode). The gateway log is read incrementally from a saved offset, whole lines only, and is re-indexed on rotation. The UI words are in ui/words.js (en, zh).

Also bumps packages/day-card to 0.3.1.

Round 3 (13c1f33) adds three things:
- a test that bytes before the gateway-log offset are never re-read;
- ui.test.mjs, which checks that every error code the server can return has words in each language, and that an unknown code falls back;
- words.js, moved out of app.js, served at /words.js and included in the pack.

What ran, at 13c1f33 merged with main 14187408, on mica:
- amp-usage `node --test`: 47/47.
- `bun test packages/amp-usage packages/day-card`: 65 pass, 0 fail.
- `bun scripts/check.mjs`, all packages: ok.
- `npm pack --dry-run`: amp-usage 0.1.0 has 19 files including ui/words.js; day-card 0.3.1 has 17 files.
- Root `bun test` with a temp HOME: 8362 pass, 0 fail (8382 tests, 590 files).
- Render smoke in Chromium and WebKit at 1200 and 420px, en and zh: words.js loads, both languages show their own words, no page errors, no horizontal overflow.

Broken by hand, each run with node and bun:
- collector.mjs:102 made to re-read the whole file every scan: the new offset test goes red.
- `const cut = buf.length`, so a partial line is taken: red.
- Raw error codes shown instead of their words (`w.err[code] || code`): red.
- A zh string deleted: red.

Not tried:
- A real Amp account or the real `amp` CLI.
- Changing the auto-refresh default from 300 to 60 fails no test. The author left it untested and round 2 called it optional.

Rounds 1 and 2 also ran the 1M-line log probe (rss steady at about 363MB, scans of 70 to 114ms after the first), the bad-record and paging probes, and the full render matrix including dark mode.
2026-11-11 21:43:59 +08:00
mdwsk88 1418740837 registry: magpie-search-mix's summary fits its card (#1002)
magpie's plugin card shows two lines of a summary (plugins.css .pm-sum, -webkit-line-clamp: 2). magpie-search-mix's summary ran to about four, so the card cut it in the list of APIs. This entry's summary (en and zh) now says what the package does and why in one short sentence. Only `summary` changes; package and name stay as #809 left them.

The author, mdwsk88, is the package's owner: npm's only maintainer and author of magpie-search-mix, and its repository is github.com/mdwsk88/magpie-search-mix. npm's 0.2.0 carries the same text in `magpie.summary` (mdwsk88/magpie-search-mix#6, merged). The text matches the package README: it asks two sources at once (`width` 2 by default), and the README names DeepSeek with Tavily or You.com as a pair it tested.

What ran, at f1cc119b merged with origin/main dea9e4e3, on mica (macOS, Bun 1.4.2, HOME=$(mktemp -d)):
- bun scripts/check.mjs (all packages): ok, and check.mjs magpie-search-mix: ok.
- bun test scripts: 22 pass, 0 fail.
- The text set at the card's own font (12px, line-height 1.45), Chromium and WebKit: 2 lines at 300px and 340px cards, en and zh. At the grid's narrowest card (262px) it takes 3, so the last words are clipped there.

Not tried: the root suite (one registry string changes), and the card in the running app.
2026-11-11 21:12:01 +08:00
zhou.han 806a3f7aed inkstone: the cookie overwrite test freezes its clock (#997) (#1003)
The cookie-probe test "a new row, or an overwritten one, is this sign-in" read Date.now() twice, once for the inserted row's last_update_utc and once for the UPDATE. When both calls landed in the same millisecond the value didn't change, rowKey matched the baseline, and the test went red (#997). The test now freezes Date.now() while it builds the profile and takes the baseline, writes the overwritten row's last_update_utc one second later, and checks that the unchanged row is not taken as a new sign-in. Date.now is put back in finally. Test-only: lib/cookieProbe.mjs is unchanged.

What ran, at eda11c37 merged with origin/main dea9e4e3, on WSL Ubuntu 24.04 (Bun 1.4.2, HOME=$(mktemp -d)):
- bun test packages/inkstone: 129 pass, 0 fail.
- The changed test alone, 30 runs: 30 pass.
- Same-millisecond case injected (a --preload that freezes Date.now): the old test fails, the new one passes.
- bun scripts/check.mjs inkstone: ok.
- Root bun test: 8315 pass, 0 fail, 8334 tests in 584 files.

Broken by hand (each went red, then reverted):
- rowKey without last_update_utc: the new test is red, so it still guards the in-place overwrite.
- profileHasNewCookie always true: the new "unchanged row is not new" assertion is red.

Not tried: Windows and macOS runs of this test.

Fixes #997.
2026-11-11 21:10:53 +08:00
yetone dea9e4e3b3 codearts 0.3.10: the international station and signing in from the CodeArts Agent (#998)
What changed
- Stations. A STATIONS table (mainland, international) is now where the
  signing fence comes from: SIGNED_HOSTS is every station's API hosts
  (https, default port, exact name), and each credential is signed only for
  its own station's hosts. An international credential reaches only
  snap-access.ap-southeast-1.myhuaweicloud.com and a mainland one never
  reaches it. Console hosts are never signed. The plugin's mainland snap URLs
  (and a config `api` on the mainland snap host) are rewritten to the
  credential's station at the fetch choke points. A lookalike host is not
  rewritten, and is refused.
- International usage. When `package.is_token_package` is true,
  statistics/plugin's usageTokenChatMessages is a "Tokens" window:
  usage_token_num of package_token_amount (e.g. "131 / 5.0M"), resetting at
  end_date, span start_date to end_date. The plan is package_name_en there
  (package_name_cn on the mainland). The international station has no opengw,
  credit batches or daily check-in in the issue's probes, so none of them is
  asked there; check-in answers "inactive". The loader's baseURL is the
  station's /api/v2.
- Sign in from the CodeArts Agent on this machine. A second method, offered
  only while the IDE's state.vscdb exists (macOS ~/Library/Application
  Support, Windows %APPDATA%, Linux $XDG_CONFIG_HOME or ~/.config, then
  codearts-agent/User/globalStorage/state.vscdb; MAGPIE_CODEARTS_IDE_STATE
  overrides). Key huaweicloud.codearts-snap, userInfoKey.originData, as in
  the issue. The file (and its -wal/-journal) is copied to a temp folder and
  only the copy is opened; its statement is finalized before the close so
  Windows can remove the copy. A missing, unreadable, half-written or
  incomplete file, or an unknown stationType, is "unknown": no method, or a
  failed sign-in saying why, never with a secret. The credential is checked
  once against current/user on its station. It has no refresh token, so it
  is renewed by reading the IDE's file again, never through STS; until the
  IDE has renewed it (or when the IDE is on another account or station) a
  renewal fails for now only, and the sign-in is kept. The account is the
  IDE's domainId.
- README (en and zh) documents both. The browser method keeps index 0.

What ran (this tree; the root suite at base 740e1af2, the package and
check again after the rebase onto b4916d41, which touched window-warmup only)
- WSL magpie-desktop: HOME=$(mktemp -d) bun test packages/codearts
  (194 pass), bun scripts/check.mjs codearts (ok), root HOME=$(mktemp -d)
  bun test: 8315 pass, 19 skip, 0 fail across 584 files
- Windows (win-run): bun test packages/codearts, 194 pass, including
  ideStatePath on this system (%APPDATA%) and the temp-copy cleanup.
- macOS (mote-run): bun test packages/codearts, 194 pass.

Broken by hand, each red and then restored
- signing by the shared host set instead of the credential's station:
  "a credential is signed only for its own station's hosts" and the
  international end-to-end test
- prefix host match: the lookalike test (...ap-southeast-1...com.evil.com)
  and the existing host test
- onStation by prefix: its lookalike test
- token window without the is_token_package gate: the token window test
- SQLite on the IDE's own file instead of the copy: the locked-database test
- IDE renewal through STS: the never-by-STS test and the end-to-end test
- an unchanged IDE file taken as a renewal: the never-by-STS test
- the IDE method always offered: the offered-only-while-there test
- a stored sign-in without a security token accepted: the unknown-cases test
- no finalize before close (Windows): "leaves no copy of the sign-in behind"
  (passes on Linux and macOS either way; Windows is the case it is about)

Not tried
- No real CodeArts international account and no real CodeArts Agent install
  were used; every test uses fake fetch and temp-dir sqlite fixtures.
- The international chat path: the plugin sends /api/v2/chat/completions as
  on the mainland; the issue's probes used /v1/chat/chat.
- The international model list (/v1/model/builtin there); the built-in
  catalog is the fallback.
- The macOS and Linux IDE paths follow the VS Code/Electron convention; the
  issue's evidence is a Windows path. Mainland stationType words are a guess
  (empty is mainland).

Reported-by: AyakaChen1
2026-11-11 20:59:18 +08:00
zhou.han b4916d4143 window-warmup tests: put XDG_CONFIG_HOME and XDG_CACHE_HOME back after each file (#996, #1001)
window-warmup's tests no longer leave XDG_CONFIG_HOME and XDG_CACHE_HOME set for every later file of the root `bun test` (#996).

What changed (test files only; no runtime code, no version bump, no dist rebuild):
- tests/fake-gateway.ts no longer sets the two XDG variables on import. Its `--serve` demo calls the new pinMagpieDirs() first, so the demo still runs with the temporary dirs.
- tests/test-env.ts: pinMagpieDirsForTest() records the inherited values, pins both to $TMPDIR/window-warmup-test-magpie-{config,cache}, and returns a restore that puts back each inherited value, or deletes one that wasn't set.
- browser, diagnostics, gateway, scheduler and server tests pin at load and restore in afterAll (in a finally after their own cleanup). diagnostics' own override is put back before the file's pin is.
- Every test file that imports fake-gateway.ts, or reaches magpieDirs()' defaults through startService/Scheduler, pins its own; magpie-files and store tests pass env explicitly.

Run at the reviewed head c13d2844 (its parent is origin/main 740e1af2), on magpie-desktop (WSL Ubuntu 24.04, Bun 1.4.2), HOME=$(mktemp -d):
- bun test packages/window-warmup plus a trailing probe file asserting both variables are back: 280 pass, 0 fail with both unset (probe sees null/null), and with both inherited as /tmp/inh-cfg and /tmp/inh-cache (probe sees them exactly).
- bun scripts/check.mjs window-warmup: ok.
- Root bun test (both XDG unset): 8298 pass, 2 skip, 0 fail, 8317 tests in 584 files.

Broken by hand, same probe:
- test-env.ts restore made a no-op: probe red (sees the window-warmup temp dirs).
- only server.test.ts skipping its restore: probe red.
- origin/main's window-warmup tests (740e1af2) with the probe: red, as #996 describes.

Not tried: `bun run typecheck` (CI doesn't run it either), and Windows.
2026-11-11 20:39:49 +08:00
yetone 740e1af252 tests: grok's nocli puts PATH back when its file ends, so gumloop's Node children find node on CI
publish.yml has been red on main since 7ebab07c (run 43011771755, and
43012668584, 43012789287 after it): 4 of gumloop's regression tests
failed with `Executable not found in $PATH: "node"`, so dist and npm
were skipped and gumloop 0.1.0 and agy-cli 0.1.19 reached neither.

Cause: bun test runs every file of the root run in one process.
packages/grok/nocli.mjs sets PATH=/usr/bin:/bin (and HOME, USERPROFILE,
GROK_HOME, GROK_BIN_DIR) for grok's files and never put them back, so
every file after grok's ran with that PATH. On ubuntu CI node is
actions/setup-node's, under /opt/hostedtoolcache, so gumloop's
spawn("node") found none whenever bun ran grok's files before
gumloop's (CI's order). Locally bun ran gumloop first, so it passed.

Change:
- grok/nocli.mjs: the first noRealGrok of a file snapshots process.env
  and registers an afterAll that puts it back, removing what was added.
- gumloop/regression.test.mjs: node's absolute path is found once with
  Bun.which at load and spawned by path; not found, the Node tests fail
  as before (no skip).
- Siblings the same way (a file-level env change never put back), found
  by a full-run env audit: chat/chat.test.mjs (XDG_CONFIG_HOME pointing
  at its deleted temp dir, MAGPIE_API_KEY/GATEWAY_KEY/ADDR deleted) and
  cursor/calls.test.mjs (XDG_DATA_HOME) now restore them in afterAll.
  window-warmup's fake-gateway.ts/scheduler.test.ts XDG pins are left,
  filed as #996 (fake-gateway is also the --serve demo's).
  Other PATH writers (devin, gcp-ai, grok's own tests, sap-aicore,
  agy-cli, layerfs) already restore theirs; the audit saw PATH change
  only at grok's files.

Ran (magpie-desktop WSL, node only in ~/sdk/node/bin, bun 1.4.2):
- Red first, origin/main: `bun test --randomize --seed=3` (and 5) on
  grok/loop-check + gumloop/regression: the 4 CI failures, same error;
  also with --preload ./packages/grok/nocli.mjs.
- Same seeds with this change: 95 pass 0 fail (new gumloop test plus
  origin/main's copy of it).
- Broken by hand: afterAll(putBack) commented out -> both seeds red
  again, 4 fail.
- Root `HOME=$(mktemp -d) bun test` (with an env-audit preload): 8298
  pass, 19 skip, 0 fail, 8317 tests, 584 files; PATH back to the start
  value at the first file after grok's.
- Touched packages (chat, cursor, grok, gumloop, qoder) after the
  chat/cursor change: 1117 pass 0 fail, each XDG value back to start.

Not tried: ubuntu CI itself before pushing (publish.yml runs it next);
Windows (nocli sets PATH empty there, restored the same way).
2026-11-11 19:53:46 +08:00
zhou.hanandzhou.han d45eb69f23 devin 0.1.39: an unreadable identity keeps its own slot (#993, #931)
An unreadable Devin identity no longer falls back to the shared name "Devin". `success` now names such an account `Devin · <12 hex>`, a SHA-256 of the API server and session token. The host de-duplicates plugin accounts by `metadata.email` (magpie `internal/plugin/host.js` `settle`/`whoOf`), so two different unreadable sign-ins used to replace each other's credential. Now each one keeps its own slot. Signing in again with the same key on the same server gives the same name, so it lands in the same slot. When `usage`'s `syncOrg` later reads the account, it renames the slot to the real email in place, as before. Fixes #931.

Ran (mica, bun 1.4.2, HOME=$(mktemp -d), PR head 14fa75a5 merged with origin/main 445f4143):
- bun test packages/devin: 209 pass, 0 fail; bun scripts/check.mjs devin ok
- root bun test: 8293 pass, 4 fail. The 4 are gumloop's "exclusive ledger updates > Node ..." reds that are already known on main (PR CI shows the same four). bun scripts/check.mjs: no failures
- 0.1.39 is free: npm has 0.1.38, and origin/dist tgz/ ends at 0.1.38

Broken by hand, one at a time, each made the new identity test red:
- fallback back to "Devin"
- key left out of the hash (server only)
- a random salt per sign-in (stable slot)
- the raw key in the name

Not changed / not tried: accounts saved earlier as "Devin" keep that name. A new unreadable sign-in with the same key now gets a "Devin · <hash>" slot beside the old one, where before it replaced it. The host's settle only matches by secret when neither side has a name. Not tried with a real Devin account (no vendor calls). magpie's Devin mover (migrate_side.go) only carries the built-in's saved user names and reads nothing from this fallback.

Co-authored-by: zhou.han <18181754+yetihan@users.noreply.github.com>
2026-11-11 19:49:32 +08:00
yetone 445f4143de Revert "agy-cli 0.1.19: tools with large schemas are shortened so agy keeps them in the model's function list (#989, klarkxy on X)"
This reverts commit 8e6c75b1e3.
2026-11-11 19:32:15 +08:00
yetone 8e6c75b1e3 agy-cli 0.1.19: tools with large schemas are shortened so agy keeps them in the model's function list (#989, klarkxy on X)
agy lazy-loads MCP tools (McpToolConfig.EnableLazyLoad and a call_mcp_tool
tool are in the 1.5.5 binary): a tool with a large declaration never reaches
the model's function list and nothing says so. The reporter saw tools of
about 691 tokens and up missing (bash, grep), 561 and below present. The
exact cut-off is not in the binary.

tool-budget.mjs fits each tool under 2000 characters (about 500 tokens; env
AGY_BRIDGE_TOOL_BUDGET, 0 = off). Order of loss: default/examples/title,
nested descriptions to 90 chars, the tool's description, nested descriptions,
and last the largest optional parameters (never required ones). Each changed
tool is logged on stderr as agy_bridge_tool_shrunk, with what was lost and
stillOver when it cannot fit.

Run (mica, HOME=$(mktemp -d)): bun test packages/agy-cli 14 pass, scripts/check.mjs ok.
Broken by hand: without the fitTools call in the request path the smoke
check goes red (5201 chars). Not tried: a real agy 1.5.x with Gemini 4
Carbon, so the 2000-character budget rests on the reporter's numbers.
2026-11-11 19:31:36 +08:00
sj1547139223 7ebab07c2a gumloop 0.1.0: API key sign-in, account models and credit estimates (#967)
Gumloop as a provider for magpie and OpenCode: API key + user ID sign-in, the
account's own model list (bare catalog ids mapped back to provider routes, per
account), streaming and tool calls, a missing system prompt supplied for Muse
and MiniMax M3.1 Flash, and a locally calibrated credit estimate (an estimate,
not an invoice). The ledger is written only under magpie's config directory
(kept in memory in OpenCode), a failed read is unknown and never written over,
and updates go through a filesystem ticket lock (bakery) across plugin hosts.
Only a 403 that names the key reads as an expired sign-in, and only Gumloop's
assumed 403 credit_limit_exceeded reads as out of credits. The last change
checks lock contention at least once after a stall, so an uncontended update
that took more than 250 ms to publish its ticket is no longer dropped.

Ran, at the reviewed head 2173d784 (WSL magpie-desktop, Bun 1.4.2, fresh
HOME; Windows 11, Bun 1.4.2, fresh HOME and USERPROFILE):
- bun test packages/gumloop: 87 pass, 0 fail (3x WSL, 2x Windows); the
  200-charge overlap test 10x WSL and 5x Windows green; check.mjs exit 0.
- Merged with origin/main 017cd73e: package 87 pass, check.mjs exit 0, root
  bun test 8294 pass, 0 fail.
- A 300 ms stall injected before the contention loop in production (no test
  hook): the three charge tests stay green; with the loop back to `while`
  they all go red (the charge is dropped).

Broken by hand, one at a time, each restored and touched:
- loop back to `while`: 3 red, the new stall test among them;
- no staleness check, no ticket-0 wait, no ledger .tmp cleanup, a 2000 ms
  wait, ENOENT counted as stale: each red, as in the earlier reviews;
- the old hook-only deadline reset put back together with `while`: the new
  test stays green (the hook hid the bug), so the reset must stay out;
- retryFs back to the shared deadline: green (a Windows sharing error after
  a stall; not reproducible on Linux).

Not tried: Gumloop's real API, a real magpie or OpenCode session with the
plugin. The npm first publish of the new package is the owner's.

Co-authored-by: sj1547139223 <146150939+sj1547139223@users.noreply.github.com>
2026-11-11 19:25:00 +08:00
yetone 5341ac1e70 agy-cli 0.1.19: every client tool is listed always loaded, so agy no longer hides large ones from the model (#989)
agy loads an MCP tool on demand, outside the model's function list,
unless the server's tools/list marks it with
_meta {"antigravity/alwaysLoad": true} (agy's changelog, 1.3.5; the key is
in the 1.5.5 binary next to SplitEnabledToolsByEagerLazy and
McpServerSpec.force_all_tools_eager). The bridge's agent has tools: [],
so the model had no working way to load them: on klarkxy's 72-tool
catalog, tools from ~691 tokens up (bash, grep, task, ask_user) were
never offered while read, glob and write were. listTools now adds the
key to every tool it hands agy; the stored catalog and its signature
are unchanged.

Ran: wsl-run (magpie-desktop) with HOME=$(mktemp -d): bun test
packages/agy-cli (13 pass), bun scripts/check.mjs (ok), root bun test
(8207 pass, 19 skip, 0 fail) at base 017cd73e; after the rebase onto
02fe223d, packages/agy-cli + packages/astudio (95 pass) and check again.

Broken by hand: listTools returning this.tools as before makes the new
smoke check red ("1 FAILURES (334 checks)", _meta null on all three).

Not tried: a real agy turn on Gemini 4 Carbon (no Google contact from
here), so that agy now puts the large tools in gen_metadata is from its
changelog and strings, not a run. The report gives sizes, not schemas;
the fixture is sized to them (bash ~7KB, read ~140B).

Reported-by: klarkxy
2026-11-11 19:20:59 +08:00
yetone 02fe223d4d astudio: Spark points count only the Spark models, so 0 of them no longer stops the account (#990)
AStudio has two pools: 通用积分 (general) and 星火积分 (Spark). Both
windows were sent as balances with aside: false and no model scope, and
magpie reads a balance window at <= 0 as used up for every model it
counts (allowanceOf on magpie main). So a Spark balance of 0 marked the
whole account used=100, and pace/smart never picked it, though
DeepSeek-V4-Flash and the other non-Spark models bill general points.

Change: the 星火积分 window now carries `models`, the Spark-series ids,
so magpie judges only those models on it (Limit.applies). Spark-series
means a catalog id starting with spark- (BOOTSTRAP's spark-x2.6,
spark-x2.6-4b, spark-x2.5, and the README's table): taken from the
account's live catalog (usage's provider.models) and, for ids that
catalog doesn't list, from BOOTSTRAP. A model the catalog marks free
(Spark-X2.6-Lite, 限免) is left out, since it spends no points; with no
model left the window is shown only (aside: true) rather than sent
unscoped. 通用积分 stays unscoped and still stops the account at 0.
Version 0.2.2.

Ran (wsl-run, magpie-desktop, HOME=$(mktemp -d)):
- bun test packages/astudio: 82 pass, 0 fail
- bun scripts/check.mjs: ok
- root bun test at base 017cd73e: 8211 pass, 19 skip, 0 fail (581 files)

Broken by hand: sending the Spark window without `models` (aside false
as before) turns 3 tests red, among them the reporter's case (general
1500, Spark 0: xopdsv4flash0731in judged not used up, spark-x2.6 still
used up on Spark).

Not tried: a real AStudio account or API call; magpie's own routing over
the new windows (the tests mirror allowanceOf/applies, read from magpie
main). Not known: whether a Spark model falls back to general points
when Spark is 0, so 通用积分 is left gating Spark models too, as before.

Reported-by: noblechang
2026-11-11 19:17:30 +08:00
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