Commit Graph
1122 Commits
Author SHA1 Message Date
yetone bb3f68a47a agy-cli 0.1.26: a quoted error marker no longer ends the turn; a trimmed tool loop keeps its prompt (#1052, #1053)
#1052: Turn.pushText failed the turn at the first "⚠ Agent execution
terminated due to error." anywhere in the reply, so a model quoting it
(inline, in a code block) was cut off and reported as an agy error. agy's
own marker ends the prompt, so the marker is now held, and the turn fails
only when the prompt ends with it still held (Turn.endText, before the
agentError check). Text or a tool call after it sends it on as text.

#1053: when a replay went over the prompt budget mid tool loop,
renderInitialPromptParts kept only the opening message and the newest
history, and dropped the user prompt the loop works on. Now, when the
current turn carries tool_results, the latest user message without one is
kept too if it fits, in order, with an omission note per gap.

Not changed: #1052's retry banners (nothing shows them reaching the
client as message chunks) and #1051 (the supersede rule is deliberate,
covered by A15 and the lineage sibling test; evidence asked for).

Run on WSL (Bun 1.4.2, temp HOME):
- bun test packages/agy-cli: 15 pass, 0 fail.
- test/repeat-batch.mjs: 17 pass, 0 fail (3 new).
- bun scripts/check.mjs agy-cli: ok.
Broken by hand, each 16 pass 1 fail, then restored: the task prompt not
pinned; pushText back to the first-indexOf rule; turn.endText() removed.
Not tried: a real agy (no install, no Google endpoints).

Reported-by: hiee3
2026-11-12 21:47:42 +08:00
yetone fc87cc8855 zcode 0.1.61: a reset past its end is not counted as a card (nathan_ift_us on X)
customer-package-reset/list can still flag a reset available after its
expireTime has passed; the vendor's page lists such a reset among the
expired. resetsOf counted on the flag alone, so an account that owns no
usable reset showed "2 resets" with a stale end (11/8). A reset whose end
has passed is now skipped; one with no end still counts.

Shape read from the vendor's own usage page chunk (bigmodel.cn
ResetQuotaCard: fiveHourResets/weekResets, available === true,
expireTime, recordId, grantType) and the captured list in usage.test.mjs.

Run: bun test packages/zcode on mote with a temp HOME, 256 pass. The new
test is red on the old index.mjs (19 pass, 1 fail). The older fixtures'
fixed 2026 dates are moved to 2027 (they were past by now).
Not tried: nathan_ift_us's real list (no access to the account), so the
cause is inferred from the date, not seen on the wire.
2026-11-12 21:36:31 +08:00
yetone c1f84f048c workbuddy 0.2.31: a WorkBuddy AI chat carries the client's chat_request_send growth event (#691)
WorkBuddy AI has no check-in; its daily credit follows a finished chat in
the official client. The reporters' capture shows the official chat body
carries extra_vars.growthEvent, a JSON string array holding one
chat_request_send event (conversation id, input length, model id and
name, mode "craft"), and initiator "user". The WorkBuddy AI CLI 5.6.2
builds the same event in reportChatRequestSendTelemetry/appendGrowthEvent.
The plugin now adds that event to every WorkBuddy AI chat (the CN site is
unchanged), keeps any events and initiator the caller already sent, gives
the event the retrying account's conversation on a retry, and inserts
extra_vars into the body as text so the rest of it goes as written
(#461). initiator comes from the 5.9.4 capture; the 5.6.2 CLI doesn't set
it.

Run (WSL, Bun 1.4.2, temp HOME):
- bun test packages: 366 pass, 0 fail (6 new in growth.test.mjs).
- bun scripts/check.mjs workbuddy: ok.
Broken by hand on a separate test Mac: dropping the event, the initiator,
the retry rewrite or the text insert: 6 fail, then restored.
Not tried: a real WorkBuddy AI account. Whether the next day's credit
lands is unproven, so #691 stays open for the reporters.

Reported-by: xxhhlk
Reported-by: dgqyushen
2026-11-12 21:24:51 +08:00
yetone 9f3763c061 raccoon 0.1.11: credits spent under a balance over every grant count as used (#1030)
0.1.10 (#936) made a balance a little over every listed grant (within
10%) the Credits window's total, so the card always read 0 used and the
total went down as credits were spent: the reporter saw 0 / 9,965 and
then 0 / 9,964. Now the total is the highest balance read for the same
account and the same set of grants, and what the balance has gone down
by since is used (1 / 9,965). A new grant, or one expiring, changes the
set and starts the count again. The highest balance is kept in memory
only: a restarted host starts from the balance it reads.

Run on a separate test Mac (Bun, temp HOME):
- bun test packages/raccoon: 53 pass, 0 fail (1 new, built from the
  reporter's six income bills and balances).
- bun scripts/check.mjs raccoon: ok.
Broken by hand: the total taken from the current balance again (the
0.1.10 rule): the new test fails, 52 pass. Restored.
Not tried: a real Raccoon account. Why the balance is over the grants
(65 credits here) is still unknown, so #1030 stays open for the
reporter.

Reported-by: ULTIMATE215
2026-11-12 20:59:55 +08:00
yetone 7b42e404f5 note: bc9f611e carries qoder 0.2.67, not the message it was pushed under
bc9f611e was committed with another session's stale message file ("qoder
0.2.60: the business record names the model"). Its content is qoder 0.2.67:
the "Total credits" window carries the plan's resetsAt so Smart sees a Teams
account renewing tomorrow (@tnt12231 on X); usage.test.mjs has the test, red
without the resetsAt line. Nothing of 0.2.60 is in it.
2026-11-12 20:33:32 +08:00
yetone bc9f611e34 qoder 0.2.60: the business record names the model (plugins#692, #638)
Qoder and Qoder CN booked every call as Auto whatever model_config named
(chansee97, #692; square-235 on #638 after 0.2.54's model_config change did
not help). The reference PR shuishuipingan/qoder2api-hub#119 says the
official CLI's business block carries model_key. Checked in the client
itself: @qoder-ai/qodercli 1.1.82 (npm pack, read only) builds the record
in qoder-worker-runtime (v3 -> snn, then {..., model_key: <chosen model>})
and keeps it for the prompt. Qoder.app 0.4.3 and QwenWorkCN.app 1.0.46 on
this Mac build theirs without it, so QwenWork's site says
businessModelKey: false and is unchanged.

qoderBody now adds business.model_key = the call's model key for qoder and
qoder-cn.

Run (mote): bun test packages/qoder, 388 pass. With the old index.mjs put
back, the 6 new tests fail (business.model_key missing). bun scripts/check.mjs
qoder.
Not tried: a real Qoder or Qoder CN account, so the billing change is not
confirmed; the attribution claim rests on the client's code and the PR's
capture.
2026-11-12 20:32:58 +08:00
yetone 768eafd6dc agy-cli 0.1.25: nc.exe is built under magpie's renamed Bun too (tearicerice on X)
windowsNcBuild() accepted only a runtime named bun / bun.exe. magpie's plugin
host runs the Bun it downloads as magpie-bun(.exe) (internal/plugin
bunupdate.go magpieBun), so on Windows 0.1.24 always returned null and fell
back to nc.cmd: the console window and conhost per `agy acp` MCP call stayed
(#1047). The name now matches (magpie-)?bun(.exe). An opencode build, which
reports a bun version but has no `build` command, and Node still get null.

Run: node --test packages/agy-cli/test/windows-nc.mjs on mica, 6 of 6 pass.
Broke by hand: the old regex puts the new magpie-bun.exe assertion red (1 of
6 fails). win-run on xiaomi-gpu: a copy of Bun renamed magpie-bun.exe,
platform.mjs picked it, `build --compile --windows-hide-console` exited 0,
nc.exe PE subsystem = 2 (GUI).
Siblings: no other package checks a Bun basename (grep).
Not tried: a real `agy acp` session on Windows.
2026-11-12 20:32:36 +08:00
法助 3d691e6e15 page-usage-board 0.1.1: WorkBuddy token estimates no longer set credit expiry (#1050)
WorkBuddy's daily `tokens (est.)` window is a token-rate allowance with an
estimated cap, set beside the credits meter (packages/workbuddy README). On
the quota wall it was picked as the card's soonest-expiring row and drove
the expiry sort, so a WorkBuddy card read as credits lapsing today. Now
quotaWins() drops that window for WorkBuddy providers (workbuddy,
workbuddy-ai) before soonWin, the total fallback and the sort. Every other
provider keeps every window.

Run at the reviewed head 628b6baa, in a Linux VM (Ubuntu 24.04, Node 22,
Bun 1.4.2, temp HOME):
- node --test in packages/page-usage-board: 37 pass, 0 fail.
- bun scripts/check.mjs page-usage-board: ok.
- git merge-tree against origin/main: clean.
Broken by hand: quotaWins returning every window turns the new test red
(1 fail), restored after.
Not tried: the page in a real magpie window with a WorkBuddy account; no
macOS or Windows run.

Co-authored-by: fazhu4 <166514093+fazhu4@users.noreply.github.com>
2026-11-12 19:28:13 +08:00
yetone 80d3a00ee3 agy-cli 0.1.24: no console window or leftover conhost on Windows (#1047)
agy dials --ide-mcp-port by running `nc` from PATH, and on Windows the
bridge's nc was nc.cmd: cmd.exe running mcp-server.mjs, two console
programs. When agy starts a console program with a console of its own
(CREATE_NEW_CONSOLE, or CREATE_NO_WINDOW), each dial gets a window or a
conhost.exe. Each session also made its own bin dir, and a host that
exited left its parked agy's cmd/bun children and its workspace dirs
behind.

- Under Bun (magpie's runtime), nc is now a GUI-subsystem nc.exe that
  Bun builds from mcp-server.mjs on the user's own machine (`bun build
  --compile --windows-hide-console`, ~0.3s on the test box). A GUI exe
  gets no console under any creation flags, and it still talks over the
  stdio pipes agy hands it. Nothing prebuilt ships. It lives in
  %TEMP%\magpie-agy-bridge-nc-<hash of runtime, Bun version and server
  source>, so every session and every later host reuses one build. A dir
  no host has used for a week, or a half-done build dir older than an
  hour, is swept. If the build fails, or the runtime isn't Bun (e.g.
  opencode.exe), nc.cmd is used as before.
- At exit on Windows one `taskkill /T /F` ends every live agy with its
  tree (cmd, nc). The workspace rm retries while the just-killed
  processes let go of their cwd. Only a shim dir this host made is
  removed; the shared nc.exe dir stays.

Run on Windows 11 (build 26200, xiaomi-gpu), Bun 1.4.2. A fake agy (Go)
answers ACP and dials `nc 127.0.0.1 <port>` 3 times per session, with
CreationFlags none, CREATE_NO_WINDOW or CREATE_NEW_CONSOLE. 4 sessions
per run, all 12 dials answered in every run below. conhost counts are
those under the host after 4 sessions, while agy is parked:
  old, none:       5 conhost; agy 4, cmd 4, bun 4; 4 workspace dirs leaked
  old, nowindow:   9 conhost (+2 per session); same leak
  old, newconsole: 9 conhost (+2 per session); same leak
  new, none / nowindow / newconsole: 5 conhost (the parked agy's own);
    agy 4, nc.exe 4, no cmd, no bun; one magpie-agy-bridge-nc-<hash>
    dir, nothing else left in TEMP after exit
  new, idle eviction (3s): back to 1 conhost, no agy/nc left
  new, host hard-killed: no agy/nc left; the 4 workspace dirs stay (no
    code runs after a hard kill; the same on old, which also leaks its
    bin dir)
  old, DETACHED_PROCESS: the dial never answers (agy start times out),
    so that isn't what the reported agy does.
The system-wide conhost count was 1 before and after every run.

Tests: test/windows-nc.mjs (6 tests, on any OS through the kit's
platform, execPath and versions overrides): the build command, the
shared dir built once and reused by a later host, no nc.cmd, the
nc.cmd fallback, the one-run tree kill at exit and which dirs it
removes.
Run at this tree on mica (Bun 1.4.2, temp HOME): bun test
packages/agy-cli 15 pass 0 fail; bun scripts/check.mjs exit 0.
On the Windows box: 14 pass, 1 fail. The red is smoke.mjs's "no call to
the loaded tool reaches agy's validator in the old prompt". It fails the
same way at origin/main 8768126 on the same box, and is filed as #973.
Broken by hand, each red in windows-nc.mjs: never using nc.exe (2
red), a build without --windows-hide-console (2), a rebuild per host (1),
SIGKILL per child instead of the taskkill tree (1), removing the shared
dir at exit (1).
Not tried: a real agy on Windows (it isn't installed on the box, and was
not downloaded); whether a window is visible (ssh runs in session 0,
where none is, so conhosts were counted instead); the reporter's build
26300. A host killed hard can still leave an agy that ignores stdin EOF:
only a job object around the plugin host (magpie's
internal/plugin/host.go starts it with a plain cmd.Start) would end it.

Reported-by: Tericerice <Tericerice@users.noreply.github.com>
2026-11-12 17:39:45 +08:00
yetone 28879fdc18 doubao-work 0.1.6: a model the app added since the last menu read is found at once (#1048)
The model list is read off the app's menu on sign-in and again only once
the cached list is six hours old. A model Doubao added in between (the new
DeepSeek, Kimi and GLM rows) was answered 404 "没有模型", whether picked
from the list or typed by hand. Now a request that names a model the
cached list doesn't have reads the menu again first, queued behind any
running ask, at most once a minute so a made-up name doesn't open the
menu each time. A menu that can't be read leaves the model unknown and
the list as it was. The 404 now names the models the menu has.

Run on a separate test Mac (Bun 1.4.2, temp HOME):
- bun test packages/doubao-work: 39 pass, 0 fail (3 new).
- bun scripts/check.mjs doubao-work: ok.
Broken by hand, each red then restored:
- the plugin never asks the menu again: 1 fail.
- no once-a-minute limit: 1 fail.
Not tried: the real 豆包工作 or 豆包 app (no install for a review); the
reporter's menu may differ in a way the read doesn't handle, so #1048
stays open for them.

Reported-by: lumiai101
2026-11-12 01:38:05 -08:00
SivanColaandSivanCola 8768126af3 deepzora 0.1.0: Deepzora as a magpie agent through a reversible TOML bridge (#1043)
Adds @magpie-community/agent-deepzora: Deepzora on magpie's Agents page, through a reversible bridge that adds a magpie-agent provider to ~/.deepzora/config.toml and the key to ~/.deepzora/.env, and puts both back on disconnect. The package is reasonix-desktop's bridge with Deepzora's names; vendor.mjs is byte for byte the merged reasonix-desktop copy (sha256 46e08060…).

Run at the reviewed head 858f09aa, on a separate test Mac, Bun 1.4.2 and Node 22.22.0, temp HOME:
- bun test packages/deepzora: 12 pass; node --test: 12 pass
- bun scripts/check.mjs: ok; npm pack --dry-run: 13 files, 57.0 kB
- a probe over the bridge in temp dirs (corrupt and half-written TOML, user edits across a switch and a disconnect, pre-existing keys in four forms, CRLF, read-only dir, 0-byte config): each as expected
- full root bun test at 858f09aa: 8482 pass, 20 skip, 0 fail

Broken by hand: 17 breaks, 13 red. Four stay green (an edited credential on switch, a half-written control file read as disconnect, no provider_access cleanup, no lock), the same gaps reasonix-desktop's tests have; listed in the review.

Not tried: a real Deepzora binary or session, acceptance.mjs and resident-acceptance.mjs, Windows (Deepzora uses %APPDATA%\deepzora there; the descriptor has no per-OS paths), a Deepzora Desktop settings save while connected.

The first npm publish of @magpie-community/agent-deepzora is the maintainer's.

Co-authored-by: SivanCola <SivanCola@users.noreply.github.com>
2026-11-12 16:27:26 +08:00
yetone 2479b36f23 cursor 0.2.45: a test switch lets Cursor search the web and saves that trace (#635)
A new plugin option, "Cursor web search (test)" (web_search_test, off by
default), sits next to Wire trace. On, a Run adds web_search_tool_call
(ToolCall field 18) to x-cursor-agent-allowed-tools and answers Cursor's
search query with an approval, as cursor-agent does when it auto-approves.
Every other tool of Cursor's own is refused as before. A Run in which
Cursor asked to search saves its WireTrace to cursor-traces whether it
succeeded or failed; a Run that never searched saves nothing unless Wire
trace is on and it failed. The trace is WireTrace as it is (kinds, field
numbers, sizes, times) plus one "web search" event; no search term or
result is written.

Protocol, from cursor-agent 2026.11.05-86047df's agent.v1 descriptors (the
plugin ships no .proto):
- AgentServerMessage 7 interaction_query: InteractionQuery {1 id uint32,
  oneof query: 2 web_search_request_query (WebSearchRequestQuery {1 args:
  WebSearchArgs {1 search_term, 2 tool_call_id}}), 9 web_fetch, ...}
- AgentClientMessage 6 interaction_response: InteractionResponse {1 id,
  oneof result: 2 web_search_request_response (WebSearchRequestResponse
  {1 approved {} | 2 rejected {1 reason}})}
- cursor-agent's x1.webSearchApproved builds exactly that approval; with
  no args it rejects "Missing web search arguments", and so does this.
Before: native failed the Run on any interaction query ("unsupported native
interaction query", 502); stateless left it unanswered. Both stay so with
the switch off, and for every query but a web search with it on.

Run on mote, HOME a fresh mktemp -d:
- bun test packages/cursor: 421 pass, 0 fail
- bun scripts/check.mjs: ok
- the new off tests against origin/main 907847b's index.mjs and
  native-session.mjs: pass (the off behaviour is the old one); the on
  tests there: red, as they should be
The full root suite was not run (other reviews were using mote and mica).

Broken by hand, each red (11 tests named plugins#635):
- approval sent as a rejection: 5 red
- native answer not gated on the switch: off test red
- header always adds web_search_tool_call: both off tests red
- header adds shell_tool_call too: 6 red
- stateless never sends the answer: 2 red
- a successful Run without a search saved: 2 red
- a successful Run that searched not saved (ended() a no-op): 2 red
- frame bytes written into the trace: 4 red (secret found)
- any interaction query taken as a search: 3 red

Not tried: Cursor's real servers (fakes only, no real account). Whether
Cursor sends tool_call_started (update 2) for its own search, which would
keep StepCalls from counting it as completed by Cursor, is unknown; the
real trace this switch records is for that. With the switch on, every Run
holds a trace in memory until it ends, as with Wire trace on.
2026-11-11 23:41:17 -08:00
qiuhao-wang001andqiuhao-wang001 907847bdf5 trae 0.2.34: an enterprise account's usage is its console's seat pool (#1040)
An enterprise Trae CN sign-in names console.enterprise.trae.cn. For such an account, the usage card now reads the console's seat pool:
- the limit is seat_pool_currency_quota, where 9999999999 means unlimited;
- the spend is this seat's total_cost_currency from get_user_model_usage;
- the reset date is get_personal_core_data's ResetTime.

The consumer credits row stays beside it, marked aside, so magpie does not route on it. If the spend can't be read, the card shows "? / ¥800.00" with no share; it never reads as ¥0. The Trae Global console path is unverified: a refusal there is an error card and keeps the sign-in.

Run at b96d0e58 (mote, temp HOME, fake server only):
- bun test in packages/trae: 262 pass, 0 fail.
- bun scripts/check.mjs: exit 0.
- git merge-tree against origin/main 3632d53b: clean.
- 15 probe cases, among them a spend read failing with 500, 401, an error code, a list under data, and the seat's own row missing.

Broken by hand, one at a time: 10 changes. All but the error label turned a test red: the unknown spend, Global's sign-in being kept, CN's console 401, own-seat summing, a null pool, and whenOf reset times.

Not tried: a real Trae account, the real console, and the GUI card.

Co-authored-by: qiuhao-wang001 <qiuhao-wang001@users.noreply.github.com>
2026-11-12 14:32:29 +08:00
yetone 3632d53be7 day-card 0.3.2: an app's picture icon prints in greys, not as a black block
ZacharyZhang on X: Cindy's logo printed as a black rounded square. Its
icon is a full-colour illustration on a rounded tile with clear corners.
drawIcon took anything under 80% solid and without a light ground for a
mark and filled its shape with the ink, so the whole tile went black.
mlx-serve (a jellyfish on a dark tile) and mothx (a glyph on a pink
disc) did the same.

Now an icon that fills its own box (a square, rounded or not, or a disc:
at least 75% of its bounding box, and the box at least 40% of the icon)
is a tile. A tile with no light ground prints in greys from its own
darkest tone (3rd percentile) to its lightest (97th), ink to paper; a
tile of one flat tone still takes the old near-white threshold. Marks and
pictures on a light ground print as before.

Run: a harness drew 18 icons (magpie's PNG agent icons, several colour
SVG logos and the bundled Amp mark) with the old and new drawIcon at 18px
x3 in Chromium and WebKit (Playwright 1.62.0, wsl-run on magpie-desktop),
no page errors. Changed: cindy, mlx-serve, mothx now show their picture;
atomcode is a grey tile instead of a black one. Every other icon is the
same as before. bun test packages/day-card: 18 pass, 0 fail.
Not tried: the real magpie app's webviews; crush's pixel heart still
prints as a ragged silhouette, as before.
2026-11-12 14:18:17 +08:00
yetone 2b7da486ac antigravity-cloak 0.1.5: say what a 429 with quota left means, and how to find the words (#1031)
nullburn's DeepSeek Harness requests kept getting Antigravity's
"Resource has been exhausted" with ~99% of the 5-hour window left, while
the title request on the same model went through. Replays traced it to
a prompt that a separate DSH plugin injects, not to DSH, magpie or this
middleware. The README said nothing about telling this refusal from real
quota, or how to find what is matched.

The README (en, zh) now has "When the 429 comes back anyway": quota left
plus other requests on the model going through means the prompt is
refused; replay with parts of the system prompt taken out, half at a
time; then add a phrase to extraWords or change the text at its source.
It says the middleware doesn't hide arbitrary prompts, as the reporter
asked.

Run (mica, HOME=$(mktemp -d)): bun test packages/antigravity-cloak 16
pass; bun scripts/check.mjs exit 0. Docs and version only, no code.

Reported-by: nullburn
2026-11-12 12:20:14 +08:00
yetone acf9b5fd03 antigravity 0.1.7: DeepSeek Harness's @-path paragraph goes reworded (#1028)
DSH desktop puts a paragraph on @ paths ("Tokens prefixed with @ are paths the user explicitly referenced…") in every system prompt. xueyinmei-dot replayed a recorded DSH request against gemini-4-argon: with the paragraph word for word, most answers came in ~3s at ~300 tok/s with no thinking and ended after one shallow step; with only that paragraph removed, or reworded, the request was answered normally (20 of 20 replays with the rewording, and a 12-step real DSH session).

shape() now sends that exact paragraph as their rewording, which says the same thing, after the zero-width breaks. Any other text, including a prompt that only mentions @ paths, goes as written. The match is the whole paragraph, so another app's prompt is not touched.

Run on mica (Bun 1.4.2, temp HOME): bun test packages/antigravity 95 pass 0 fail; bun scripts/check.mjs exit 0.
Broken by hand: outgoing() without reword() turns the new test red (shape.test.mjs 21 pass 1 fail).
Not tried: a real Antigravity account (the rewording's effect rests on the reporter's replays). magpie's built-in Antigravity path (internal/gateway/codeassist.go) gets the same rewording in its own commit.

Reported-by: xueyinmei-dot
2026-11-12 12:15:18 +08:00
wolf ae6a435ca8 registry: DaFeiYu desktop pet guide page (#1035)
Lists magpie-dafeiyu 0.1.5, a guide page for the DaFeiYu desktop pet. The page uses only the window.magpie bridge (theme, language, ready), makes no requests and declares no permissions; the pet itself is a separate app the user downloads.

Run at 7c74886b: npm pack magpie-dafeiyu@0.1.5 and every file read (no BOM, permissions [], dev dependencies not shipped); bun scripts/check.mjs on mica exit 0. Not tried: the page inside a real magpie window.
2026-11-12 12:11:13 +08:00
yetone b6741cc159 nowledge-mem: the layout test stops Chrome at a bound and says what it wrote (#972)
The test waited for Chrome to print the DOM and exit, with nothing bounding the launch. On CI it takes 5 to 13s (0.4s in WSL), and a few times it ran into the 30s test timeout with no word on why.

Now the results are read as soon as Chrome prints them and Chrome's whole process group (setsid) is stopped then. A launch that prints nothing in 25s is stopped, and the test fails with Chrome's stderr instead of a bare timeout. The cause of the slow CI launches is still unknown; the next red will carry it.

Run in WSL magpie-desktop (Playwright Chromium 1234 as chromium, Bun 1.4.2, temp HOME): 5 of 5 pass at about 450ms.
Broken by hand: a fake chromium that only sleeps fails at 25.0s with "Chrome gave no results within 25000ms; stderr: starting", and its sleeps are gone afterwards.
Not tried: google-chrome on an ubuntu runner, other than through CI.
2026-11-12 12:09:56 +08:00
tungloong b64dfb91cb agy-cli 0.1.23: thinking is not counted twice on the SQLite path (#1032)
measuredUsage summed field 3 (output) and field 9 (thinking) of SQLite gen_metadata, but field 3 already carries the thinking, so the SQLite path billed thinking twice. Each step now counts max(output, thinking), as promptUsage does since #1023.

Run at b3873f84 on mica (Bun, temp HOME): bun test packages/agy-cli 14 pass 0 fail; bun scripts/check.mjs exit 0.
Broken by hand: putting back item.output + item.thinking turns 4 tests red, including the PR's new one.
Not tried: a real Antigravity CLI session.
2026-11-12 12:03:47 +08:00
yetone 4e3a786814 codearts 0.3.14: a CodeArts Agent sign-in is kept (#998)
Signing in with "Sign in from CodeArts Agent" said ok, but the account
was never stored. A host keeps an OAuth sign-in only when the result has
a `refresh` field (OpenCode's CLI and magpie's host.js both test
`"refresh" in result`), and the IDE method's success had none. It now
has `refresh: ""`. This sign-in has no refresh token: it is renewed by
reading the IDE's state file again, and every reader of the refresh
token (firstOf) already skips an empty string.

The IDE sign-in test now checks the field is there and empty.

Ran on mica (Bun, HOME=$(mktemp -d)): bun test packages/codearts 203
pass 0 fail; bun scripts/check.mjs exit 0.
Broken by hand: without the refresh line, "signing in from the CodeArts
Agent: checked with its station…" goes red (202 pass, 1 fail).
Not tried: a real CodeArts Agent sign-in (no account here).

Reported-by: AyakaChen1 <AyakaChen1@users.noreply.github.com>
2026-11-12 11:06:52 +08:00
Klarkxy b829a5541e agy-cli 0.1.22: thinking is not counted twice in billed output (#1023)
ACP's outputTokens already includes the thinking tokens, so `completion_tokens`
is outputTokens again, not output + thinking. The totalTokens shape check
compares against input + output (and input + cache + output), without
thinking.

Evidence (klarkxy, agy 1.5.4): for single-turn Flash and Carbon prompts,
ACP's totalTokens equals input + output exactly (2322 + 4728 = 7050,
2316 + 9390 = 11706). Output minus thinking is 67 and 68 tokens, which
matches the visible replies. The store's gen_metadata output (field 3)
equals ACP's outputTokens, with thinking (field 9) below it. 0.1.19 sent
9389 and 18712, double-counting.

Run at a0898318 merged onto origin/main (1199adda), on mica with a temp
HOME: bun test packages/agy-cli gave 14 pass, 0 fail, and scripts/check.mjs
exited 0. CI's test and on-npm jobs pass. Earlier, at d18f2346, putting
`output + thinking` back by hand turned five tests red.
Not tried: a live agy session here.

Co-authored-by: klarkxy <klarkxy@users.noreply.github.com>
2026-11-12 10:52:21 +08:00
zhou.han 92c20ffef6 Eight auth hooks declare rotating refresh tokens (#1027)
Eight auth hooks declare `rotating: true`: cline, codearts (and OfficeAce),
factory, minimax, nous, qoder, sensenova, workbuddy. Each package's own
code says the vendor refuses a spent refresh token. magpie then stops
carrying these sign-ins to another computer through Sync, a backup or a
Restore (internal/provider/signins_carry.go). Trae was dropped: its refresh
keeps the old token when the answer has none, and there is no evidence it
rotates. Each package's patch version is bumped (cline 0.1.15, codearts
0.3.13, factory 0.1.46, minimax 0.2.9, nous 0.1.3, qoder 0.2.66, sensenova
0.2.3, workbuddy 0.2.30). Each was checked against npm, or against
origin/dist for the dist-only packages, before the merge.

Fixes #884.

Run at cc2f9199 (a fast-forward of origin/main), on mica with a temp HOME:
bun test over the eight packages gave 1588 pass, 0 fail, and
scripts/check.mjs exited 0. CI's test and on-npm jobs pass. At 45c8fdb4,
mote gave 1834 pass with Trae included.
Not tried: a real refresh against each vendor.

Co-authored-by: yetihan <yetihan@users.noreply.github.com>
2026-11-12 10:52:16 +08:00
ming_jiangandoverstarry 401b549fb3 amp-usage 0.1.1: the Windows window is this computer, not a remote browser (#1025)
On Windows magpie's window is http://wails.localhost (WebView2). page/boot.js counted only localhost, 127.0.0.1 and an empty host as this computer, so the Windows window got the "remote browser" message (#1024). It now counts *.localhost, ::1 and 127.* too, the same rule as chat, fingerprint, kimi-desktop, page-model-quota and window-warmup. magpie.service still wins.

What was run at 84a6a812739b96191e9d63805cd408e0abef717a (mote, macOS):
- boot.js in a node vm with a mocked location and magpie bridge, new and old side by side. wails.localhost, WAILS.LOCALHOST, 127.0.0.2 and [::1]: old shows the remote message, new opens http://127.0.0.1:3497/. localhost, 127.0.0.1 and an empty host open it in both. 192.168.1.5, evil.com and localhost.evil.com show the remote message in both. A magpie.service is used in both.
- packages/amp-usage: node --test test/*.test.mjs, 48 pass, 0 fail. bun scripts/check.mjs amp-usage passed.

Not tried: a real magpie window on Windows. No test of boot.js in the package yet.

Co-authored-by: overstarry <overstarry@users.noreply.github.com>
2026-11-12 09:33:24 +08:00
Klarkxy 97fdba8ca6 minimax 0.2.8: native Magpie image, video and web search (#1008)
MiniMax Code accounts now serve magpie's image, video and web search natively: /v1/images/generations and /v1/images/edits through generate_image, video through submit_video_generation, and search through the connector's web tools.

- Edits: magpie's multipart body (model, prompt, n, size, quality, image / image[] parts) is parsed, and each image goes through the live catalog's upload_temp_url signed-form flow. A mask part is refused with a 400 (generate_image takes no mask). A video frame sent as data: is uploaded the same way, and https refs pass through.
- A 401 is renewed per tool call, and only that call is sent again, so a 401 on get_asset_url never runs a paid generate_image twice.
- Upload hosts are https only. A video download drops content-encoding and content-length (fetch already decoded it).
- Envelope refusals carry a status: 1002, 1039, 1041, 1045, 2045, 2056 and 2062 are 429; 1008 and 2053 are 402 (MiniMax's published error codes, not confirmed for the MiniMax Code agent API).
- 0.2.8, since 0.2.7 (#1014) is on npm. native.mjs is in files.

What was run at c020d32e51f9b28e29528ea59d38bc167baf8624 (temp HOME, fake fetch only, no real MiniMax calls):
- mote (macOS): bun test packages/minimax, 193 pass, 0 fail. bun scripts/check.mjs exit 0.
- WSL Ubuntu 24.04: 193 pass, 0 fail.
- Broken by hand, one at a time, each turned a test red: no per-call 401 renewal (2), mask accepted (1), http upload host accepted (1), no envelope status (2), content-encoding kept (1). Earlier rounds broke multipart parsing, the status in toolHttpError and mediaRef's schemes, each red too.
- Merges cleanly onto main 234e073c.

Not tried: the real upload_temp_url answer, the /visible/ wait (8s) against MiniMax, and a real magpie drawing through a MiniMax account.
2026-11-12 08:47:15 +08:00
yetone 234e073c60 nowledge-mem test: headless Chrome no longer hangs on its component updater (#972)
The "narrow settings footer" test spawns Chrome with --dump-dom. Chrome 151
(Chrome for Testing, and the runner's stable) intermittently never exits:
its SODA on-demand component update and the component updater/breakpad
start-up stall, so the process outlived the test's 30s and was killed.
This failed the publish run 43122260448 (page-chat 0.1.14) and 52e31c4a.

Cause fixed, not the timeout: the test now starts Chrome with the speech
(SODA), component-update, breakpad, field-trial and default-app start-up
work turned off, so --dump-dom exits as soon as the page is dumped.

Run (WSL magpie-desktop via wsl-run, Chrome for Testing 151 as `chromium`,
HOME=$(mktemp -d), bun 1.4.2):
- old code: red, timed out at 30s (reproduced; plain chrome --dump-dom of a
  trivial page hung 15s in 4 of 4 runs with only the SODA flag)
- with the flags: green 3 of 3, ~0.8s each; the flag set exited in 0.4-1s in
  8 of 8 bare chrome runs
Not run: the full bun test suite; GitHub's own runner.
2026-11-12 08:06:44 +08:00
zhou.han 1492d9c3be workbuddy 0.2.29: a routed-over refusal pins the free window (#1022)
A WorkBuddy AI 429 that magpie routed past to another member was never in the usage ledger, so the free window's estimate never learned the vendor's reset (#910). The plugin now reads magpie's routing trace (routing/YYYY-MM-DD.jsonl and .jsonl.gz, three days, both files when a day has both) for WorkBuddy 429 tries and pins the window at the reset they name.

- A gateway rest pins the window only when rest.by is "resets" (the vendor named it). cooldown, backoff, quota, window and retry-after leave it alone.
- The rest key's account (lowercased by magpie's restKey) is compared case-insensitively. order[].who's spelling is kept, and a who/key conflict drops the try.
- The parse cache is one entry per path, provider and model, with the file's fingerprint inside it. Paths outside the current three days are dropped.
- Lines without "status":429 are skipped before JSON.parse.

What was run at b48fd3fcc494a708aba65e47643738dfd6a34e80 (temp HOME, fake data only, nothing reached WorkBuddy):
- mote (macOS): bun test packages/workbuddy, 360 pass, 0 fail, under TZ=UTC, Asia/Shanghai, America/Los_Angeles, Pacific/Pago_Pago and Pacific/Kiritimati. bun scripts/check.mjs passes.
- Windows 11 (xiaomi-gpu): 360 pass, 0 fail.
- Broken by hand, one at a time, each turned at least one test red: any rest kind pins (1), exact-case account match (2), no stale-path drop (1), fingerprint back in the cache key (1), no who/key conflict check (1), no provider prefix check (1).
- Merges cleanly onto main 201bd277 (the two commits since touch chat and agy-cli only).

Not covered by a test: removing the oldest/now filter in routingRefusalRows turns nothing red. magpie's trace has no try later than now, and an older edge closes no counted window, so it is a guard only. Not tried: a real WorkBuddy account or a real magpie session.

Co-authored-by: yetihan <yetihan@users.noreply.github.com>
2026-11-12 07:57:59 +08:00
yetone 201bd27706 chat 0.1.14: the model picker is clamped to the room above the composer (qiwiview on X)
positionPop sized the menu from the button's top, but the menu sits above
the composer, so with many models it ran out of the page frame's top and the
first models couldn't be scrolled to. It now measures from the composer's
top, has no 220px floor, and opens downward when that has more room.

Run: new pop-clamp.gui.mjs (60 models, heights 320/420/600/900, chromium and
webkit) on mote: 8 ok. On the old app.js: 8 FAIL, menu top -45 to -50.
Not tried: the live magpie window; bun check.
2026-11-12 07:45:31 +08:00
yetone 52e31c4a1f agy-cli 0.1.21: text that names a notice tag it never closes is routed by who wrote it, not refused (PolarizingLight on X)
A tool turn answered with text beside the result that merely mentions a
notice tag it does not close ("<system-reminder", "<channel") threw "text
beside a live tool_result; send it after the tool response completes". In
a long Codex thread (ChatGPT desktop) that text comes from a developer
message magpie wraps in <system-reminder> whose own text quotes a reminder
tag (the wrapper then leaves a stray close tag), a hook's context, or the
user typing the tag. Now: a wrapped developer or system message is a
notice (broken up with cloak), a user's text steers and is replayed whole,
other roles ride as a notice. A notice that opens and is cut short
("<system-update>not a complete...") is still turned away.

Not found: a real failing request. magpie's logs on this Mac hold none, and
Codex's rollouts here hold no tag of this kind after a tool output, so the
exact bytes the reporter's thread carries are inferred, not seen.

Run: test/compat.mjs (new case red on 0.1.20, green now), agy-cli.test.mjs
whole on mote (12 pass). Broken by hand: old index.mjs makes the new case
fail. Not tried: a real ChatGPT desktop thread against agy-cli.
2026-11-12 07:07:29 +08:00
tungloongandtungloong 01eaa6dda4 agy-cli 0.1.20: each step's usage from agy's own store, and 1.5.1+ inputTokens read as uncached (#983)
agy 1.5.1+ reports ACP `inputTokens` as uncached prompt tokens only; `promptUsage()` tells the exclusive shape from the inclusive one by `totalTokens`, so cache reads are no longer clipped and the learned cache ratio no longer pins to 1.0. Each HTTP step of a multi-step tool loop is settled from agy's own per-call rows in `conversations/<id>.db` (`gen_metadata` on 1.5.1+, `steps` type 15 on 1.4.x-1.5.0) when they reconcile with ACP's total; same-generation tool continuations settle at 0, a cancelled or fallen-back turn stops trusting the store, and a clipped cold-start replay bounds its fallback estimate.

The reader (`step-usage.mjs`) never opens a store read-write. Under Bun it opens with `SQLITE_OPEN_READONLY | SQLITE_OPEN_URI` (Bun's SQLite on Linux and Windows parses `file:` URIs only with that flag), finalizes statements and waits on no busy timeout. A checkpointed WAL store with no `-wal`/`-shm` is read through `?immutable=1` and gains no side files; if `-wal` appears during that read it is read again live. Store paths are resolved to absolute first, and Windows `\\?\` and UNC paths get their own `file:` form. On an uncheckpointed store the only file a reader touches is SQLite's `-shm` WAL index.

Reviewed head 9054f47295d51d6f83f8585dd550312ebff8448a (base dba24067; merges cleanly onto main 7c44d027).

What ran at that head, Bun 1.4.2 everywhere, fresh temp HOME (and USERPROFILE on Windows):
- macOS (mote): `bun test packages/agy-cli` 14/14; step-usage 10/10, usage-settlement 33/33; `node --test test/step-usage.mjs` (Node 22.22) 10/10; `bun scripts/check.mjs` ok.
- Linux (WSL Ubuntu 24.04): `bun test packages/agy-cli` 14/14; step-usage 10/10, usage-settlement 33/33; Node 22.23 10/10; check.mjs ok.
- Windows 11: step-usage 10/10 (the loopback UNC share was reachable, so its branch ran), usage-settlement 33/33, Node 10/10, check.mjs ok. `bun test packages/agy-cli` 13/14: smoke's one red is "no call to the loaded tool reaches agy's validator in the old prompt", the known #973 (1 of 334 checks), not touched here.
- Root `bun test` on mica, merged onto origin/main 7c44d027, under suite.lock: 8407 pass, 20 skip, 0 fail across 593 files (fresh temp HOME).

Broken by hand (restored after each):
- Linux: SQLITE_OPEN_URI dropped -> step-usage 3 red, usage-settlement 2 red; `path.resolve` dropped -> the URI/relative-path test red (Bun and Node); the "no -wal after a failed immutable read returns null" guard dropped -> the mid-read test red (Bun and Node).
- macOS: the re-read after `-wal` appears removed, and the failed-immutable-read path returning null outright -> the mid-read test red under Bun and Node (at 262145f4; the code is unchanged since).
- Windows: the `\\` branch of `immutableUri` disabled -> the URI/UNC test red.

Not tried: a real agy session or account (fake agy and fixture stores only); Bun versions other than 1.4.2; a remote (non-loopback) UNC share.

Co-authored-by: tungloong <19512489+tungloong@users.noreply.github.com>
2026-11-12 04:30:07 +08:00
yetone 7c44d02796 zcode 0.1.60: an unreachable plan key or a full plan is a wall, sent once (#1020)
takomitkm saw one GLM-5.3-Flash-Trial request tried 8 times over ~389s,
each failing with "ZCode's Z.ai coding plan key: ECONNRESET: The socket
connection was closed unexpectedly". That text is not the replay: it is
located(), ZCode 3.16's key-location read of the coding plan key
(api_keys/copy/<id>), which runs first in serve(), before any gift or
plan choice. Its failure was thrown, magpie read the throw as a 502 and
asked again (same-one retries, then patience rounds), and the read had
no timeout, so one hung read held the request for minutes. It also told
the user to sign in again for what was the network.

- located(): the key read is bounded (20s). A read that never reached
  Z.ai (ECONNRESET, refused, a timeout, a name that didn't resolve)
  uses the last key read for that location when there is one; with
  none, it is a 429 wall answer (error.code user_model_rate_limited,
  one of magpie's wallCodes, yetone/magpie@067e4c484): sent once,
  rested as a rate limit, the next account asked. An answer that
  refused the read (401, 500) is said as before, sign-in hint included.
- free first's replayOnPlan(): a coding plan whose last usage read
  (codingUsage, teamUsage) counted a window full with its reset ahead
  is not sent to; the replay answers the same wall. The mark is
  dropped by a read with room, at the reset, or 30 minutes after the
  read. A replay that can't reach the plan answers the wall too; a
  caller's abort stays an abort. The gift-first fallback is unchanged.
- The wall's words stay off magpie's quota and credit words, so it
  rests a minute, not a quota's rest.

Tests: packages/zcode/wall.test.mjs (new, 12), built on the reporter's
literal error text; no network (fetch is a fake).

Run:
- packages/zcode bun test on wsl-run (magpie-desktop): 255 pass 0 fail.
- Full suite: `HOME=$(mktemp -d) bun test` on wsl-run (magpie-desktop),
  since mote's and mica's suite locks were queued for hours: 8407 pass,
  0 fail, 19 skip, 593 files. `bun scripts/check.mjs`: exit 0, 59 ok
  (zcode among them).
- Broken by hand (wall.test.mjs on wsl-run), each red, then green
  restored: serve's catch off (2 red), the full-plan check off (1),
  the replay's catch rethrowing (1), the read's timeout removed (1),
  the last key unused (1), the old "sign in again" message (2).

Not changed: a socket error on the plain coding plan path (no free
first) still throws, and magpie still retries any thrown plugin error
as a 502 eight times; filed on yetone/magpie (yetone/magpie#6208).
Not tried: a real Z.ai account whose key read drops, or a real full
plan; magpie's classification of the wall body was read from
origin/main's walled()/failure(), not run.

Reported-by: takomitkm
Refs #1020
2026-11-12 03:15:36 +08:00
yetone 51f24a363a workbuddy 0.2.28: list an enterprise's custom: models (#1015)
An enterprise account's own models ("custom:<name>|<name>", modelType
"enterprise") come in /v3/config's models but not in the cli agent's
list. WorkBuddy's CLI (bundled in WorkBuddy 5.5.6, AgentManager.
computeModels) appends every config model whose id starts with
"custom:" to the agent's list itself, after the agent's own ones.
liveModels read only the agent's list, so the models were missing
entirely, and a forced chat to them worked. They are now appended in
the config's order with their context, output, images, price and
efforts, and the id goes to WorkBuddy as given, "|" and all. They stay
on chat (nativeOf matches only a bare claude- id), where the reporter's
chat was served. Both sites share liveModels; nothing else enumerates
the config. The CLI also appends models tagged "custom" or "chat":
those in a desktop's cached config are its local models with their own
url and apiKey, so they stay out.

PR #1016 (yetihan) joined the two spellings instead (an agent-listed
custom:x|x against a bare detail id x); the issue's literal entry,
run against d2e21b7b, lists neither model (expected 2, got 0).

Run (mica, HOME=$(mktemp -d), at a181b898, this change on edc6dbcd;
the rebase onto 934e6b33 adds antigravity commits only):
bun test packages/workbuddy 342 pass, 0 fail across 32 files;
bun scripts/check.mjs exit 0. Earlier the same on mote at dba24067.
The root `bun test` was not run before the push: both machines'
suite.lock were held by other sessions' Go and GUI suites (mica's for
6h), and it is queued on mote behind them; its result goes on #1015.
Broken by hand: the append turned off, 5 of 6 custom.test.mjs red
(the no-cli-agent case passes, as it should); the de-duplication
removed, the "listed once" test red.
Not tried: a real enterprise account; none is available, so the
fixture is the issue's own JSON shape and the "not in the cli agent's
list" placement is inferred from the report and the CLI's code.

Reported-by: CnsMaple
Co-authored-by: zhou.han <18181754+yetihan@users.noreply.github.com>
Refs #1015
2026-11-12 02:20:29 +08:00
yetone 934e6b3312 antigravity 0.1.6: gemini-4's rejected call (400 INVALID_ARGUMENT after the model ran) is asked again, up to twice (shzutbi1 on X)
Gemini 4 now and then builds a call Google's validator rejects; the same
request passes on a resend. A 400 INVALID_ARGUMENT that took 3s or more, or
an error chunk in the stream before any non-thinking part, is sent again for
gemini-4 models only. Thinking-only chunks are held back until the first
answer part, so a retry never repeats thinking to the client; once an answer
has begun the stream goes through as it is (a reply can't be taken back). A
fast 400 and other models are returned as before.

Run: bun test in packages/antigravity on mica, 78 pass. Broken by hand:
RETRY_BAD_CALL=0 turns 4 new tests red.
Not tried: a real Antigravity account (the 400 is intermittent).
Cost: thinking shows once the first answer part (or the end) arrives, not live.
2026-11-12 01:08:25 +08:00
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