Commit Graph
941 Commits
Author SHA1 Message Date
yetone e35aa928ad antigravity 0.1.0: Antigravity with a Google account, ported from magpie's built-in
Signs in with Google (Antigravity's client, PKCE, loopback) or imports a
refresh token / account-manager export, sets up the Code Assist project
(loadCodeAssist, onboardUser on the default tier), lists the account's
models with level variants, and sends every request through
v1internal:streamGenerateContent in the app's envelope, with the
built-in's request shaping (system-prompt cloak, tool ids and results,
schema flattening, Claude and Gemini rules), its error mapping (turned-away
429 -> 400 unapproved channel, 404 model, refused refresh -> 401 expired)
and its usage windows and pools.

A stream's last chunk is an empty text part; sent back in the next turn,
Claude refuses it ("text: Field required"). Both the whole-reply reader and
the request shaper drop it.

Run:
- bun test packages/antigravity on mote: 78 pass, 0 fail.
- bun scripts/check.mjs antigravity: registry.json ok, antigravity ok.
- Real account (the built-in's saved Google account, read only, sandbox
  HOME): model list; stream and generateContent on gemini-3.8-flash; the
  effort header picking -low; claude-sonnet-4-6, claude-opus-4-6-thinking,
  gpt-oss-120b-medium all answer; a Claude Code system prompt to Gemini
  answers 200 (cloak); an unknown model 404; usage gives plan, model
  windows and the Gemini and Claude & GPT 7-day pools; a tool call round
  trip on Claude Sonnet, Opus thinking, Gemini and GPT-OSS.
- Broken by hand: without the empty-text drop the new shape test and the
  generateContent test go red, and the real Claude round trip answered 400.

Not carried over (README): the 6h rest of a turned-away account, Google
Search grounding and image models, countTokens (404, magpie estimates),
sending the system prompt uncloaked, multi-account import, models.dev
names. Not tried: the browser sign-in end to end (the import path was).
2026-11-10 17:30:21 +08:00
yetone 34786edadb qoder 0.2.65: two tool calls at one index with their own ids are two (#930)
Qoder Ultimate sent two native tool calls at tool_calls[].index 0, each
with its own id and name. events() kept one call per upstream index, so
the second call's arguments were sent as more of the first:
{"key":"A"}{"key":"B"}, which the client refused as unparseable JSON.

A fragment with a non-empty id that differs from the open call's id at
that index now starts a new call with an output index of its own. A
fragment with no id, or the open call's id, still goes on with the open
call (OpenAI's argument fragments, and relays that repeat the id). A call
pushed aside before it got a name still counts as nameless (#579).
After two ids at one index, id-less fragments go to the newer call; the
report suggested failing there instead, but OpenAI streams each call's
fragments right after its start, so the newest is the one open.

Siblings with the same index-keyed fold, fixed the same way:
- zed 0.1.19: chatWhole (a streamed chat reply folded for stream:false).
- codearts 0.3.7: completionFromChunks.
- zen-free 0.1.27: stream.mjs chatAccumulator, and tool-response.mjs's
  chat buffer, which gives each call its own index when two collided.
- page-chat 0.1.13: lib/server.mjs folds through toolCallFolder.
Looked at and left: codearts' stream name restorer and kimi-desktop's
Agent hold pass fragments through unchanged and join no arguments;
zed's streaming path passes Zed's chunks through, and magpie's gateway
already starts a new call on a new id (internal/gateway/chat.go).

Run (WSL magpie-desktop, bun 1.4.2, node 22):
- pedh's repro.mjs with his fixture: [0,0] gave one tool event plus an
  args event on 0.2.64; now two tool events (index 0 and 1), each with
  valid JSON. [0,1] unchanged.
- HOME=$(mktemp -d) bun test packages/qoder packages/zed
  packages/codearts packages/zen-free packages/chat: 987 pass, 0 fail,
  1 skip (the epub reader's, as before). bun scripts/check.mjs: every
  package and registry.json ok.

Broken by hand:
- qoder back to index-only: 3 of the new tests fail (two ids, id-less
  after a second id, streaming adapter).
- qoder starting a call on any fragment without the open id: 8 fail,
  the id-less continuation test among them.
- qoder treating any id as new: the repeated-id test fails.
- zed, codearts, zen-free (both) on main's code and chat keyed by index
  only: each new collision test fails (5 of 5).

Not tried: a real Qoder account (no Qoder Ultimate here), real Zed,
CodeArts or OpenCode Zen replies with a collision, and the chat page
in a browser.

Reported-by: pedh <pedh@users.noreply.github.com>
2026-11-10 16:56:37 +08:00
garry569andgarry569 d8f8981d33 factory 0.1.43: droid 1.7.0 models (#927)
droid 1.7.0's new models in the Factory plugin: Fable 5.2, Kimi K3.1 Pro,
MiniMax M3.1 Flash, Nemotron 3.5 Super, Inkling, Muse Spark 1.2, Beam 1.0,
and GPT-6 Sol/Luna, GPT-5.6 Sol and GLM-5.2 Fast. Each is at droid's
limits, efforts, images and token multiplier, with apiProviders[0] as the
upstream. gpt-6-sol/gpt-6-luna at service_tier "priority" now go to their
Fast Mode models. GLM-5.2 Fast is its own chat model and is not a tier of
GLM-5.2. GPT-5.6 Sol Fast Mode gets Sol's 20% promotion until 2026-11-22.
Muse Spark 1.2 is left out of CORE (no billingPool "core"). GPT-6.1 Terra,
Muse Spark Open, GPT-6.1 Sol Ultra Fast and Muse Spark 1.3 are left out,
each with a reason. The first 24 models are unchanged (#119).

Review at 9524dcfc6e45b7c2c15245bd1e200d72aeebe17f:
- droid 1.7.0 linux-x64 downloaded in WSL (magpie-desktop). SHA-256
  4700746f52ec88e3758a18737be13bb74519276de97bc329054e8dae08f15f42
  matches. All 24 excerpt lines of testdata/droid-1.7.0-models.txt are in
  the binary byte for byte (grep -F). The base entries gpt-6-sol (0.8),
  gpt-6-luna (0.04), gpt-5.6-sol (2) and glm-5.2 match the plugin's.
- Each new row was checked against its entry: id, context/output, efforts
  (off dropped, or kept as none only for GLM-5.2 Fast), images,
  multiplier, upstream and wire.
- First 24 ids are equal on main and the PR, and main's order is kept.
  CORE gains exactly kimi-k3.1-pro, minimax-m3.1-flash,
  nemotron-3.5-super, inkling, beam-1.0 and glm-5.2-fast.
- In WSL, bun 1.4.2, HOME a temp dir: `bun test packages/factory` gave
  193 pass, 0 fail. `bun scripts/check.mjs` passes.
- Broken by hand. main's index.mjs with the new tests: 14 fail. Muse kept
  in CORE: 7 fail. The Sol Fast promotion removed: 2 fail. Fable 5.2 moved
  first: the first-24 test fails. Luna Fast at 0.04: 3 fail. Beam with
  images: 1 fails.

Not tried: real requests to Factory. Kimi K3.1 Pro, Nemotron 3.5 Super,
MiniMax M3.1 Flash, Beam 1.0, GLM-5.2 Fast and Fable 5.2 are behind
statsig gates whose default is off in the binary. The author's account
listed them, but other accounts may not, as with Gemini 4 Argon.

Co-authored-by: garry569 <garry569@users.noreply.github.com>
2026-11-10 16:05:29 +08:00
yetone dda4afdc36 nowledge-mem 0.1.6: requestTimeoutMs and the hook budget go up to 30s (#926)
A deep Mem search can take longer than 5s, and the page refused any
requestTimeoutMs over 5000 or gatewayTimeoutMs over 10000. Both now go up
to 30000; the defaults (1500 and magpie's 1000) are unchanged. magpie
v0.1.3538 (yetone/magpie#5890) runs a hook up to its own 30s budget;
the README says an older magpie cuts anything over 10s.

- validate.js, settings page and labels (en, zh, zh-TW, ja, de): 50-30000
  and 100-30000.
- nowledge-mem-agent checked: its 10000 ms values are fixed internal
  timeouts, not user options with a cap; unchanged.
- slow-recall.test.mjs: a fixture server answers /memories/search after
  6100 ms; requestTimeoutMs 15000 recalls it, 30001 is invalid, and a
  caller abort stops the fetch at once (the server sees the abort) and
  keeps the request as it came.

Run (wsl-run, magpie-desktop): bun test packages/nowledge-mem
packages/nowledge-mem-agent: 161 pass, 2 skip (live Mem and the
Playwright layout check, skipped as on main), 0 fail; bun
scripts/check.mjs: rc 0. The README's magpie version was filled in after
that run.
Not tried: a real Nowledge Mem server with a slow deep search.

Reported-by: aboat0625-cpu
2026-11-10 15:31:40 +08:00
Chanyeong Lim 3fedabba29 pig 0.1.2: talk to Magpie over the Responses API so reasoning survives turns (#925)
PiG's Magpie provider now speaks openai-responses instead of openai-completions, so encrypted reasoning items round-trip across turns. Magpie's gateway takes Responses clients for every upstream and translates for Chat-only ones (covered by internal/gateway TestResponsesClientChatUpstream, TestDshResponsesReachChatVendor). agent-pig 0.1.2.

Reviewed at 87085bce. Run on the merged tree in WSL: bun test packages/pig 11 pass / 0 fail; bun scripts/check.mjs rc=0.
Not tried here: a real PiG binary; the author reports real tool calls and resume through Codex and a Chat-only upstream.
2026-11-10 13:38:07 +08:00
yetone 61adb384fc agent-office 0.3.5: Cursor's editor and CLI chats show in the office (WaiooT on X)
WaiooT asked to see Cursor in Agent Office. It read no Cursor files: Cursor
showed only through the gateway hook, which never sees Cursor's own
requests (they go to Cursor's servers).

It now reads <CURSOR_DATA_DIR or ~/.cursor>/projects/<slug>/agent-transcripts/
<chat>/<chat>.jsonl (and the older agent-transcripts/<chat>.jsonl). A chat
with cursor-agent's chats/*/<chat>/meta.json (CURSOR_CONFIG_DIR, else
$XDG_CONFIG_HOME/cursor, else ~/.cursor) is "Cursor CLI" with that cwd;
the rest are the editor's, a new "cursor-app" agent named "Cursor", with
the cwd found by matching the slug against real folders (bounded, cached),
else the slug's last part. Lines carry no time, so the file's mtime is
used, and the user line's <timestamp>. turn_ended ends a turn (success
done, error with its text, else stopped). The editor writes no
turn_ended, so its chat counts as done 30s after a last answer with no
tool pending. No token counts: Cursor doesn't record them locally.

Run on mote at this tree (Bun 1.4.2, HOME=mktemp -d): repo bun test 7866
tests, 7846 pass, 20 skip, 0 fail; bun scripts/check.mjs exit 0;
stamp-page.mjs --check exit 0 (agents.js restamped).
The fixtures are the bytes a sandboxed cursor-agent wrote here (a Read
tool run that ended "WritableIterable is closed", and "Say ok.").
Broken by hand: without the editor's quiet-done rule the chat stays
"thinking" (red); without meta.json's agent the CLI chat is cursor-app
(red).
Not tried: a real Cursor editor writing a transcript (no editor in a
sandbox here; the format is cursor-agent's, which the editor shares per
magpie's Sessions reader), subagent transcripts, the page in a real
magpie window.
2026-11-10 13:37:39 +08:00
yetone 34f7e7b6cd doubao-work: find 豆包工作 (DoubaoWork.app), not 豆包 (#917)
binary() looked only for /Applications/Doubao.app (豆包,
com.bot.pc.doubao). The reporter has only 豆包工作 at
/Applications/DoubaoWork.app/Contents/MacOS/DoubaoWork
(com.work.pc.doubao), so sign-in always said the app was missing.

choose() now picks { app, binary, dataDir } from both apps, 豆包工作
first, in /Applications and ~/Applications on macOS and under
%LOCALAPPDATA% on Windows. A user already signed in to 豆包 through
the plugin (its profile exists) stays on 豆包 while it is installed, so
the update signs no one out. 豆包工作 keeps its profile, port and model
list in a doubaowork/ subfolder. DOUBAO_WORK_APP still names the binary.
The chat page check (owns, connect) accepts doubaowork://doubaowork-chat/chat
and chrome://doubaowork-chat/chat as well as 豆包's. The busy and
not-installed messages name the chosen app and its download page.

Run (mote, worktree at 6cb5dbe8 + this change; origin/main 1bdc4d4b only
adds an autoclaw change):
- bun test packages/doubao-work: 36 pass, 0 fail.
- bun scripts/check.mjs: exit 0, doubao-work ok.
- Live on this Mac with DoubaoWork 2.36.3 (copied out of the official
  dmg) and a sandbox DOUBAO_WORK_HOME: choose picked 豆包工作, App.start
  launched it, owns accepted it, the page reported
  chrome://doubaowork-chat/chat, input present, signed out; the model
  menu read 自动 / 豆包 2.1 Lite / 豆包 2.1 Pro; the new-task and 云电脑
  steps ran on the real page. A second connect reused the running app.
- 豆包 2.35.8 with a temp profile: same chat page test ids.

Broken by hand (mote): choose searching only 豆包 made "a Mac with only
豆包工作 drives 豆包工作 (#917)" red; the old owns regex made "both apps'
chat pages are the plugin's" red (34 pass, 2 fail). The old code has no
choose/isChat and binary() returns Doubao.app, so the #917 test is red
on it.

Not tried: a signed-in request (no 豆包工作 account here). Windows: the
path %LOCALAPPDATA%\DoubaoWork\Application\app\DoubaoWork.exe comes from
DoubaoWork_installer_2.36.3.exe's config (install_dir_name DoubaoWork,
exe_file_name DoubaoWork.exe) and 豆包's layout; not installed on the
Windows box. Running 豆包工作 and 豆包 side by side.

Reported-by: sinoyster
2026-11-10 12:16:37 +08:00
yetone 1bdc4d4b63 autoclaw: mask DeepSeek Harness throughout system, not only its first line (#924)
DeepSeek Harness names itself three times in system: the identity line
("You are an AI agent powered by DeepSeek Harness.") and, from its dev
context, "The runtime context names the DeepSeek Harness implementation
checkout.", "...through the DeepSeek Harness Web GUI..." and "Current
DeepSeek Harness implementation checkout: ...". FLAGGED rewrote the first
only. The reporter's replay (five sends each) was still 406 with the
identity line rewritten and 200 five of five with every occurrence masked.

autoclaw 0.2.21:
- the identity line, its comma optional, becomes "You are an AI agent
  powered by a local coding harness."; every other "DeepSeek Harness" in
  system or developer text becomes "DeepSeek" (the reporter's proposal,
  which their replay measured; no product name in the replacement).
- "powered by the glm-<x> model" in any case is written "powered by the
  GLM-<x> model", the form probed to pass on 11-03. Only that sentence:
  model ids, paths and code naming glm-5.3 are left. The reporter's other
  sentence ("powered by the model glm-5.3-flash") was already rewritten
  case-insensitively before this.
- Same roles as before: system and developer only (string content and
  text parts); user messages, tool results and tool arguments untouched,
  and a test checks that on both gateways.

Fixtures are dsh's own strings byte for byte (@deepseek-ai/dsh
0.2.1-rc.2: dsh-system-prompt harness:identity, dsh-harness-dev-context
HARNESS_SOURCE_PROMPT, WEB_SURFACE_PROMPT and its runtime line), plus the
reporter's comma line and lowercase GLM sentence. The reporter quoted the
Web GUI line without the product name; dsh's source has it.

Run: lockf ~/suite.lock mote-run -C <worktree> bash -lc 'bun install
--frozen-lockfile; bun test packages/autoclaw && bun scripts/check.mjs':
112 pass 0 fail, check.mjs ok.
Broken by hand, each on mote, each restored (cmp against the saved file):
- origin/main's index.mjs with the new tests: 4 fail (the three new
  tests and the all-lines table).
- the "DeepSeek Harness" -> "DeepSeek" rule removed: 3 fail (full-text,
  loader, table).
- unflag applied to every role: 5 fail, the new loader test among them
  (user and tool text would change).
Not tried: a real request to AutoClaw; the 406 -> 200 is the reporter's
measurement and was not reproduced here. Whether the gateway refuses a
lowercase "glm" where it takes "GLM" is the reporter's word, not probed.
Not run: the full bun test.

Reported-by: connoryang331
2026-11-10 12:06:55 +08:00
yetone f73ba656b2 cursor: auth.calls lists the account's calls made outside magpie (0.2.44, WaiooT on X)
magpie's Usage page counts only what went through magpie, so Cursor's
editor and cursor-agent use was missing ("求支持统计cursor的使用情况").
auth.calls reads GetFilteredUsageEvents page by page from the time magpie
asks for and gives each of the account's own events: id, time, model,
tokens (input uncached; cache read/write apart), cost (totalCents / 100)
and conversation. A team's other members (owningUser vs GetMe's userId)
and the conversations this plugin ran itself (kept 40 days in
$XDG_DATA_HOME/opencode-cursor-auth/conversations.json, written
temp-and-rename) are left out. A refused page fails the reading.

Run: bun test in packages/cursor on mote (410 pass), scripts/check.mjs.
calls.test.mjs's fixtures carry the field names of a real Pro account's
reply. Real account: the hook read 43 events (30 days) from the owner's
Cursor sign-in, tokens and costs as the dashboard has them.
Broken by hand: without the own-conversation and owningUser filters the
first calls test goes red.
Not tried: a team account with other members; Cursor's editor (none
installed here), so an editor event's shape is taken as the same.
2026-11-10 11:57:54 +08:00
yetone 2025e8ac89 tests: mail-watch puts MAGPIE_CONFIG_DIR back; page-usage-board's children drop it
bun test runs every package in one process. mail-watch's test set
MAGPIE_CONFIG_DIR to its temp dir at module level and never restored it,
so page-usage-board's spawned service inherited it through ...process.env.
MAGPIE_CONFIG_DIR wins over the cwd probe, and "config dir: the host cwd
carrying magpie markers wins" read /tmp/mail-watch-test-*/usage.jsonl on
CI, which kept every publish run red after #844.

mail-watch's afterAll now restores the variable. page-usage-board's test
spawns build their env without an inherited MAGPIE_CONFIG_DIR or
USAGE_JSONL.

Run:
- On main (545ed66), mote: `bun test packages/mail-watch
  packages/page-usage-board` failed this one test (79 pass, 1 fail).
- With the fix, WSL Ubuntu 24.04: full-repo `HOME=$(mktemp -d) bun test`,
  as in CI, gave 7835 pass and 0 fail.

Not tried: the full repo on macOS. mote's suite lock was queued for hours.

Supersedes #921, which chdir'd the child and left the env as it was.
2026-11-10 11:52:34 +08:00
orinsid 545ed66e74 page-usage-board: a usage dashboard page (#844)
Adds @magpie-community/page-usage-board: a usage dashboard page with its
own zero-dependency local service (quota cards with expiry tiers, TTFT,
7x24 heatmap, optional remote attribution).

Reviewed at 8ca2562: the author's 80137b0 plus a maintainer merge of main
(registry entry re-appended after upstream's newer packages).
Since the 6b2625d review: [::1] in MAGPIE_ADDR stays IPv6 loopback (only
0.0.0.0/[::] map to 127.0.0.1), the config-dir test compares real paths
so it passes on macOS, and the registry-block test tolerates CRLF.

Run on mote at 8ca2562: packages/page-usage-board `bun test` 36 pass,
`node --test test/*.test.mjs` 36 pass; `bun scripts/check.mjs` all ok.
Not tried this round: the page in a live magpie window.
2026-11-10 10:36:04 +08:00
zt8989 e9c7de3708 doubao-work 0.1.4: read the model list from Doubao's own menu (#916)
Reads Doubao Work's model list from the app's own model menu, keeps it in
models.json, and offers those models (0.1.4).

Reviewed at 43b3d5d (the author's 50c1448 plus a maintainer fix: the
config hook now keeps a model the user declared themselves, as every
other package does).

Run on mote: bun test packages/doubao-work 34 pass; bun scripts/check.mjs
doubao-work ok. Broken by hand: model lookup back on the built-in table
fails 2 tests; the old merge order fails the user-settings assertion.
Not tried: a real Doubao app (the author ran it on macOS, 8 models).
2026-11-10 10:31:28 +08:00
yetone 042e8517b4 doubao-work 0.1.3: Windows too (WANGY1ER on X)
WANGY1ER asked on X for Windows: the plugin said "macOS only", because
binary() knew only /Applications/Doubao.app. Doubao's Windows app is the
same Chromium 147 fork with the same chat page (doubao://doubao-chat/chat),
so the plugin drives it the same way.

- binary(): %LOCALAPPDATA%\Doubao\Application\app\Doubao.exe, the per-user
  install's own exe (Application\Doubao.exe beside it is a launcher).
- dataDir(): %LOCALAPPDATA%\magpie-doubao-work.
- copies() is empty on Windows: Chromium keeps one copy per profile there,
  so the user's own Doubao keeps running and the plugin's copy opens
  beside it, in a second window. No "quit Doubao first" on Windows.
- Linux stays unsupported: Doubao has no Linux build. Its download page's
  platform list is ios, android, mac, OpenHarmony, windows. The sign-in
  says so.

Run:
- bun test packages/doubao-work: 29 pass on mote (temp HOME, as CI),
  win-run (Windows 11) and wsl-run (Ubuntu 24.04). bun scripts/check.mjs ok.
- Live on xiaomi-gpu (Windows 11, Doubao 2.34.6 / Chromium 147), with the
  owner's own Doubao running in the console session: the plugin's App
  started app\Doubao.exe from its own profile beside it, its DevTools port
  answered with doubao://doubao-chat/chat, owns() took it, and each step
  of an ask ran in the real page: NEW_TASK "", CLOUD "" (mode 云电脑),
  自动 and 豆包 2.1 Lite picked, 豆包 2.1 Pro "upgrade", fill wrote three
  lines into tiptap. The owner's copy was untouched throughout.

Broken by hand:
- binary() without its win32 line: "the app is found on macOS and
  Windows" is red on mote and Windows.
- copies() without its win32 line: "on Windows a running copy never
  blocks" is red on mote.

Not tried: a signed-in request on Windows. That Doubao has no account
signed in (its cookie jar is empty), so Enter was not sent; signed-in
STATE relies on data-testid=sidebar_bottom as on macOS.
2026-11-10 09:35:45 +08:00
yetone 801a311480 free-tokens: say it reads AIHOT when the plugin host starts, not on open (0.1.1)
The host part's server() runs each time magpie starts the plugin host
(magpie opening, a plugin installed or changed), not each time the page
is opened. The READMEs and index.js said "on open"; the review of #885
asked for this wording and the merged text still had the old one.

Run: bun scripts/check.mjs free-tokens ok, bun test packages/free-tokens
62 pass (mote). Text only; no behaviour change.
2026-11-10 09:28:58 +08:00
Mingchen Yuandsljdxde 7262e70c6c free-tokens: AIHOT Token 羊毛 page (#885)
New page plugin: AIHOT's Token 羊毛 (free model allowances), sorted into "ready" / "plugin to set up" / "no plugin" against the user's own magpie plugins. Only the vendors in src/allowlist.js are shown; anything else (relays included) is dropped before it reaches the page.

AIHOT's written approval (2026-11-10) is quoted on the PR: free, no ads or sponsors, each user reads it once on their own computer, no proxy, mirror or redistribution, credited in the footer.

Run at 07da91b0 (on mote):
- bun test packages/free-tokens: 62 pass. bun scripts/check.mjs free-tokens: ok.
- The page served with magpie's page CSP in a sandbox="allow-scripts" frame, Chromium and WebKit: tiles 1/2/1 for a fixture of MiniMax (signed in, checked in today), ZCode (installed, not signed in), Zed (not installed), DeepSeek (no plugin) and an unlisted relay (dropped); install popover gives @magpie-community/opencode-zed-auth, login popover "magpie plugin login zcode"; a title holding <img onerror> is shown as text; brand icons load; no dialog.
- Every mapped package checked: 8 on npm, 5 on the dist branch, and each pid is the package's provider id.
- Broken by hand: checkin null guard removed, title unescaped, Zed's npm name unscoped; each turns a test red.

Not tried: a real magpie window with the plugin installed, and the live aihot.news route (no network in the run).

Co-authored-by: sljdxde <sljdxde@users.noreply.github.com>
2026-11-10 09:28:19 +08:00
Pursuit806andjinyue806 7b52e3fc47 astudio: claim the daily reward without the desktop app (0.2.1) (#883)
AStudio's daily reward is claimed without the desktop app: check-in completes the pending DAILY_REWARD_DIALOG popup (popupId + instanceKey only, once) and reports claimed/done only from today's GRANT ledger row. init-app and auth/bearer-token are no longer called from check-in. Version 0.2.1.

Reviewed at 199d128f3 line by line (guards broken by hand, each turned a test red); e744ee9 is that code rebased onto main plus the version bump. index.mjs, index.test.mjs and README.md are byte-identical to 199d128f.

Run at e744ee9 on mote: node --test 78/78; bun test 78/78 under TZ=UTC, America/Los_Angeles and Asia/Shanghai; bun scripts/check.mjs astudio ok. The author reports a real claim (+100) on two accounts at 2026-11-09 00:00:17 +08:00 with no desktop process; not repeated here (no AStudio account).

Co-authored-by: jinyue806 <jinyue806@users.noreply.github.com>
2026-11-10 07:33:11 +08:00
SpecStream c0329b2c0c specstream 0.1.0: web search and extract tools, and a web search API entry (#866)
SpecStream's Search API and Extract API as tools for every agent, and as a web search entry in Settings > Models > Web search.

Reviewed at 2ae405947ab71dab6f9557a4191a860bd92a2ddf. Run on mote: bun test packages/specstream (9 pass), bun scripts/check.mjs, bun test scripts (22 pass). Both endpoints, called for real without a key, answer 401 {"error":{"code":"missing_api_key",...}}, which unwrap() raises with its status, so a refused key rests in the rotation.

Not tried: a call with a real key.
2026-11-10 04:37:22 +08:00
netube e689973203 agent: add nanobot with model, Library MCP and workspace skills (#908)
Adds the nanobot agent adapter (packages/nanobot): magpie's model, Library MCP servers and workspace skills written into ~/.nanobot/config.json through a journaled, owner-tracked bridge, and restored on disconnect.

fc46523d resolves symlinked parent directories (macOS /var, dotfile-managed ~/.nanobot or ~/.config) while still refusing a symlinked final file, and keeps the preset on host exit; only a disconnect restores.

Run at fc46523d: `bun test` in packages/nanobot, 60 pass / 0 fail on mote (macOS, default TMPDIR under the /var link, which failed 18 of 22 at c6f8f639) and on the magpie-desktop WSL distro (Ubuntu 24.04). Not tried: a real nanobot binary driven through magpie.
2026-11-10 03:26:10 +08:00
yetone 929eb2c0b1 opendesign 0.1.12: a model asked on another of amr-link's APIs is signed for that API (#888)
amr-link serves every model on chat completions, Responses and Anthropic's
messages (keyblues measured all fourteen). The plugin declares one API per
model (MODEL_WIRE, kept: it is where each model thinks, plugins#141), and
magpie's host signs a request with the declared package's header. So a model
asked on another API (magpie's per-model API choice; the OpenDesign provider
has all three URLs) went with the wrong header: a chat model on /messages
with a Bearer, glm-5.3-flash on /chat/completions with x-api-key.

The loader now returns a fetch that signs by the request's path: x-api-key
(and anthropic-version when missing) on /messages and /messages/count_tokens,
Bearer on everything else. A request on the declared API goes as before.

Zero-config native protocol per agent needs magpie: its plugin contract has
one API per model (provider.pluginAPIs returns pluginProtocol's one), so the
gateway translates every other agent's protocol to it. Reported, not changed.

Run on mote under lockf ~/suite.lock:
- bun test packages/opendesign: 31 pass, 0 fail (at ff9d3a64 and again at
  the rebased head).
- bun test (full, isolated HOME): 7578 pass, 0 fail, at base ff9d3a64. A run
  with mote's real HOME had the suite's isolated-HOME guards (zcode) and
  Devin's local-CLI tests red, untouched packages; isolated, they pass.
- bun scripts/check.mjs: ok.

Broken by hand: the loader without `fetch: signFor(key)`; the new test and
the loader test went red (2 fail), green again with it back.

Not tried: against the real gateway (no OpenDesign key), so x-api-key on
amr-link's /v1/messages for a chat-declared model is the reporter's result,
not mine.

Reported-by: keyblues
2026-11-10 02:56:52 +08:00
yetone 7a28b38870 day-card 0.1.2: a day just begun reads <0.1×, an app's drawn icon prints as a drawing
Found by trying Copy image and Save PNG in the real app with real usage:

- VS AVERAGE DAY read "0.0×" early in a day ($0.07 against a ~$180
  average). Any ratio above 0 and under 0.1 now reads "<0.1×".
- Alma's icon (a drawing on its own light ground) printed as a black
  square, because every colour icon was filled with the ink. A picture
  that is mostly light with something dark drawn on it now prints in
  the ink with its near-white parts left the paper's colour. Mono logos
  and colour marks with no ground of their own (Claude, DeepSeek) are
  still filled solid.

Run:
- mote-run bun test packages/day-card: 12 pass, 0 fail (two new
  versus cases: 0.07/180 → "<0.1×", 0.5/5 → "0.1×").
- Real app: magpie 0.1.3443 (/Applications) in a sandbox HOME on
  127.0.0.1:3486, the owner's usage.jsonl copied in, this app.js and
  view.js in the installed package. The page shows "<0.1×" and Alma's
  drawing; Claude and DeepSeek marks unchanged. Copy image showed
  "Copied" and put a 1708x2278 PNG on the clipboard; Save PNG said
  "Saved to ~/Downloads/magpie 2026-11-10-2.png" (the first save's
  file kept, not overwritten), byte-identical to the clipboard PNG.

Not tried: Windows and Linux webviews.
2026-11-10 02:10:30 +08:00
yetone e035ea40bb notify 0.1.3: a push when a subscription account is signed out
shannnnnks on X: with several Codex accounts behind magpie's gateway, one
is now and then signed out; they want notify to push it.

magpie v0.1.3443 calls a hooks file's onSignIn once when an account in
use must be signed in again (Codex revoked or refused, Claude, Copilot or
plugin sign-in lapsed, ...), and when a Claude sign-in ends within days.
notify pushes "⚠️ Codex account x signed out / Sign in again in magpie."
(zh with lang "zh") to the same channels. On by default (accounts: true);
one push per account and state per accountCooldownMinutes (60). Webhook
event: {kind: "signed-out"|"ending", provider, account, endsAt?}. ntfy
takes the message's tag, "warning" here. README, registry summary.

Run on mote: bun test packages/notify, 65 pass (7 new: default push, zh,
Claude ending days, accounts false, cooldown, unknown states, webhook
event); bun scripts/check.mjs ok. The new tests can't import onSignIn
from the old notify.hooks.mjs, so they fail there.
Not tried: a real push from a real revoked account.
2026-11-10 01:45:30 +08:00
yetone 7d5a68700e day-card: the card is a receipt, a Daily AI statement on paper (0.1.1)
A user installed the Day card and found it looked nothing like the
receipt in https://x.com/jasonaxb/status/2119432517170430196, and asked
for the same look. The card is now that receipt, with magpie's words in
place of the original's own:

- cream paper over a teal-to-mint ground, a zigzag torn bottom edge
  and a soft shadow; heavy monospace, letter-spaced labels and dashed
  rules;
- DATE and ISSUED, then the TOTAL API COST (API-equivalent, not an
  invoice), then STREAK, REQUESTS, ERRORS (only when there were any)
  and VS AVERAGE DAY (cost against the mean of the active days before
  this one; tokens when nothing was priced);
- AGENT / MODEL with logos printed in ink, by cost; then TOTAL TOKENS,
  INPUT, OUTPUT and CACHE HIT RATE;
- the original's tagline and App Store footer are magpie's own lines,
  and its RANK is left out: magpie has no ranking to read.

The frame can't fetch a font file (sandboxed, opaque origin), so the
face is a subset of JetBrains Mono 2.304 (OFL, license beside it) as
woff2 data in page/fonts.js, loaded with FontFace. About 13.5KB per
weight, 400/700/800.

The average now leaves out the day itself, and money(0) reads $0.00.

Run, on mote at this tree:
- bun test packages/day-card: 12 pass (tests rewritten for the receipt:
  fields, cost order, versus, dates with a held clock, fonts.js is
  woff2 and loads before app.js, only usage:day is read).
- bun test scripts: 22 pass; bun scripts/check.mjs: exit 0.
- The page in a sandboxed frame under the page CSP, with the
  reference's numbers and real magpie icons, in Chromium and WebKit
  (Playwright 1.62.0), en, zh, de and ja: all three weights load, no
  page errors, the long German title shrinks to fit; the English card
  checked side by side with the tweet's image.

Not tried: the real magpie app's WKWebView, and Copy/Save from it.
2026-11-10 01:35:35 +08:00
yetone 806fbff8bd sensenova 0.2.2: the reasoning tiers SenseNova's docs list per model
muran_91096 on Discord asked for max, and quoted SenseNova's docs:
glm-5.3 takes low/high/max, deepseek-flash none/low/high/max,
deepseek-v4-flash none/minimal/low/medium/high/xhigh/max, kimi-k3
low/medium/high/max. The plugin offered none/low/high to every model,
so max was missing, and kimi-k3 and glm-5.3 were offered a "none"
the docs don't list.

DOC_EFFORTS holds those four; the live listing (modelOf) and the
declared models (variantsOf) give exactly them. Every other model keeps
the narrow common three. Anthropic's wire skips minimal and xhigh.

Run (mote): bun test in packages/sensenova, 58 pass; bun
scripts/check.mjs all ok. Broken by hand: without the DOC_EFFORTS lookup
the new api.test case fails.
Not tried: a real request at each tier (no SenseNova account here); the
tiers are the vendor's docs, not measured.

Reported-by: muran_91096 (Discord)
2026-11-10 01:20:17 +08:00
yetone c61d83d0a1 loomy 0.1.5: the daily wallet sends the share spent and the credits spent (#889)
magpie reads a window's `used` as the share spent (0-100) and `amount`
as what was spent of `limit`. Loomy sent the credits spent as `used` and
what was left as `amount`, so 800 spent of 5,000 read as 800%, and an
account window cap of 4 credits compared the 4,200 left with the cap:
it held a fresh account and let a spending one go past it (9won_25273
on Discord, over by more than 1,000). Now 16 and 800. A zero allowance
is 0, never NaN. The permanent wallet comes back as a balance alone, with
no total, so it stays an amount shown aside.

Run on mote at origin/main f54991b9 + this: bun test in packages/loomy
31/31. Broken by hand (the old used/amount put back): 3 usage tests red,
the new fresh-and-empty test among them.
Not tried: a real Loomy account.

Reported-by: 9won_25273 on Discord
2026-11-10 00:26:38 +08:00
Qin Huijian f9124bc831 empty-reply 0.1.0: a reply with reasoning but no text ends early, so the agent retries (#900)
Adds packages/empty-reply (0.1.0): a reply made of reasoning alone, with
end_turn (Anthropic) or response.completed (Responses), loses its end
events so Claude Code and Codex retry; a whole reply becomes an error
body or status "failed". max_tokens, refusal and incomplete are kept.
A stopgap for yetone/magpie#3358 until the gateway checks this itself.

Reviewed at 900 head: bun test packages/empty-reply 17 pass,
bun scripts/check.mjs all packages ok, bun test scripts 22 pass (mote,
Bun 1.4.2). Read every case in cases.json against the Anthropic and
Responses stream shapes. The author ran Claude Code 2.1.319 and
codex-cli 0.167.0 against a reasoning-only Chat upstream (ordered and
rotate). Not run by the reviewer in a live gateway.
2026-11-09 23:51:33 +08:00
yetone cbb58f654a day-card 0.1.0: a day of your usage drawn as a card, copied or saved as a PNG
A new page plugin, @magpie-community/page-day-card, for JungleyYeh on X,
who asked for a "daily AI statement".

- It shows a chosen day (today by default, others from a date menu): its
  tokens, cost, calls and errors, then each agent with its models and
  icons. Below them come the streak, the average active day and the last
  two weeks.
- Copy puts the card on the clipboard as an image; Save writes it as a
  PNG.
- The design is quiet, with no gradients and no coloured accents, in
  light and dark. It speaks en, zh, zh-TW, ja and de.
- It asks for one read, usage:day, and needs magpie 0.1.3427 (623e797fd)
  for that read and for magpie.image.copy/save.

What was run (mote):
- bun test packages/day-card: 11 pass, 0 fail. Before engines.magpie
  was set, the guard test was red on the placeholder.
- bun scripts/check.mjs: exit 0.
- Real use: the page in magpie's real GUI server with a sandbox HOME
  holding a copy of real usage, in Chromium and WebKit, light and dark,
  en/zh/zh-TW/ja/de, at 420 and 1100 px, with an earlier day picked and
  Copy pressed. No page errors (magpie 623e797fd's body has the rest).
2026-11-09 23:23:24 +08:00
mikidarenandmikidaren 5d172c46c7 rhino9-ai 0.3.2: Magpie-Rhino, Magpie in Rhino 9's AI panel (#868)
Adds packages/rhino9-ai (0.3.2), an agent descriptor for the Magpie-Rhino companion: Rhino 9's AI panel gets a Magpie entry that uses magpie's models, custom groups and routing strategies through Rhino MCP. Windows only.

Reviewed across four rounds. The last round, at b02996c6, covered the descriptor, the registry entry, OnLoad's folder and the companion at v0.3.2. Since then, 0422f2a1 changes only docs: the Agents table row uses the folder name, and the package README describes the remembered execution mode.

Read for this head: the companion's v0.3.2..v0.3.3 diff (123ea20, d5a36af).
- The new PanelPreferences keeps a single AutoExecute bool in ~/.config/rhino9-magpie/panel-preferences.json, written through temp-and-rename. It defaults to off.
- A preferences file that can't be read leaves confirmation on.
- confirm_design_basis and the scale dialog still ask whatever this setting is.
- v0.3.3 was published by github-actions[bot] from run 42614204457 at d5a36af, and that run passed.

Run (mote) at 0422f2a1: `bun test packages/rhino9-ai` 5 pass, 0 fail; `bun scripts/check.mjs rhino9-ai` ok. The last full `bun test` (7566 pass) was at b02996c6. Only Markdown changed since.
Not tried: Rhino 9 itself (not on the test machines).

Co-authored-by: mikidaren <mikidaren@users.noreply.github.com>
2026-11-09 20:39:24 +08:00
yetone eb3cb370a0 codearts 0.3.6: an account with no free channel is sent its plain model (#905)
gateway/config answers an account with no benefit channel with
{"error_code":"4000","error_msg":"invalid channel, group not found"}.
That was read as a failed read, so state.benefit stayed null and the
built-in fallback list sent glm-5.3-flash with maas_type: benefit. The
gateway answers that header on such an account with a 200 whose first
frame is InferHub.APIG.0101.404, mapped to 400, so magpie stopped the
group's fallback.

- gateway/config's "group not found" (any status) is now a list of no
  free models; a network failure or another error still keeps the
  fallback.
- InferHub.APIG.0101.404 to the benefit header sends the request again
  without it and remembers the model has no benefit.

Run on mote: bun test in packages/codearts 173 pass / 0 fail;
scripts/check.mjs ok. Broken by hand: with main's index.mjs the three
new tests fail (both 4000 statuses and the 0101.404 retry).
Not tried: a real account without the free channel; the fixtures are
the reporter's bytes from #905.

Reported-by: hyperp0p
2026-11-09 20:15:24 +08:00
Qtlz a5a63a109f agy-cli 0.1.3: an assistant prefill tail is continued, not refused (#904)
A request ending in a text-only assistant turn (SillyTavern prefill,
"continue"/"impersonate", bot frameworks) was refused with a 400. That
trailing run now stays in the tail, after the session ledger's newest
entry, so the agy session is reused across prefill turns, and it is
rendered as a continuation of the model's own reply. A prefill beside a
live tool_result, or with no user turn before it, is still a 400.
AGY_BRIDGE_PREFILL=0 brings the old refusal back.

Reviewed at f7b249cec9e827b7ef49197a207180f3f7085cfe, run on mote:
bun test ./agy-cli.test.mjs 8 pass / 0 fail; bun scripts/check.mjs ok.
Broken by hand: with main's index.mjs and these tests, test/prefill.mjs
and the smoke test fail (6 pass / 2 fail).
Checked: renderTurnMessagesParts only gets the current turn's tail, never
history, so a finished reply is never taken for a prefill.
Not tried: a real agy account.
2026-11-09 20:12:15 +08:00
yetone 951ac55c94 window-warmup: the fake gateway's reset no longer logs "error: 连接中断" (#902)
The "响应中途连接重置" test's fake gateway broke the connection with
controller.error(new Error("连接中断")) on a served ReadableStream. Bun.serve
prints such a stream error as an unhandled error (its error() callback is
never called), so every green run of the package showed "error: 连接中断"
with a stack, which read as a failing test. It was not the bun version, HOME
or a port: a 20-line probe on bun 1.4.2 printed the same for any
controller.error or throwing pull() in a served stream, with an error()
handler set and seeing nothing.

The reset is now a forced close: the fake records the request, then
server.stop(true) closes the connection before any answer, which the client
sees as ECONNRESET (the same path as before), and nothing is logged. The
truncate case keeps its half body and clean close. Test-only: no version
bump.

Run on mote (bun 1.4.2, HOME=~/runs/home-902):
- origin/main 36141e38, bun test tests/gateway.test.ts, 3 of 3: 63 pass,
  0 fail, one "error: 连接中断" logged each run.
- this commit, same, 3 of 3: 63 pass, 0 fail, nothing logged; whole
  package 279 pass, 1 skip, 0 fail, nothing logged.
- Broken by hand: with the ECONNRESET/EPIPE branch of send() removed, the
  reset test is red (62 pass, 1 fail), so it still reaches that path.
Not run yet: the full root bun test at this commit, queued under
~/suite.lock behind other sessions' suites; its result goes on #902.
2026-11-09 18:54:29 +08:00
Duhu 36141e381e chat 0.1.12: recall tools from unspaced Chinese questions in large MCP catalogs (duhu2000, #872)
The chat page picks up to 12 tools from a large MCP catalog. It now splits unspaced Chinese into two-character terms instead of treating the whole question as one word. Terms are weighted by how rare they are in the catalog (IDF), and a tool named exactly in the question, hyphenated names included, is boosted to the top. The selection moves into lib/tool-selection.mjs with its own tests. page-chat goes to 0.1.12.

Run at d10e93a62832e31ead84ddef438b615b13935e26 merged onto main 1aab125bf, on a separate macOS machine (bun 1.4.2, sandbox HOME):
- packages/chat `bun test`: 75 pass, 1 skip, 0 fail.
- `bun scripts/check.mjs`: exit 0.
- Root `bun test`: 21 fail and 4 errors in devin, zcode and window-warmup, none in chat. Main 1aab125bf shows the same 21 and 4 in the same tests. The devin and zcode ones refuse a HOME that isn't from `mktemp -d`.
- Broken by hand, one at a time: without the exact-name boost, "exact identifier outranks…" goes red. With IDF replaced by 1, "rare term outranks…" goes red. Without `-` in the Latin term regex, the exact-identifier test goes red.

Version: page-chat is served from the dist branch, where the newest is 0.1.11.
2026-11-09 18:38:39 +08:00
yetone 588b3611cb kiro 0.1.35: the sign-in's ways, question and choices in magpie's languages
mahiro233 on magpie's Discord (plugin 0.1.34, magpie v0.1.3372): in a
Chinese window, the account sheet's "Choose a sign-in method" and its
three choices read in English. Each way, question and choice now gives its
words in Chinese, Traditional Chinese, Japanese and German, as magpie's
own labels, messages and hints fields beside the English (magpie reads
them from its next release; OpenCode and an older magpie show the English,
which is unchanged). "AWS Builder ID" stays the product's name; its hint
is translated. The API key way also gives its field a "ksk_…" placeholder.

The same report said there's no API key option. The plugin has had one
since it began (the third way, "Kiro API key (ksk_…)", as kiro-cli uses
KIRO_API_KEY), but magpie opened a moved Kiro's first way at once, and its
question left no way to the others; magpie's side of the fix is in
yetone/magpie.

Run on mote: packages/kiro bun test with HOME under the temp dir, 171 pass
0 fail; bun run check ok (exit 0).
Broken by hand: with origin/main's index.mjs, signin-words.test.mjs goes
red (the first way's zh label undefined).
Not tried: a real sign-in (no words on the wire changed); the full root
suite.
2026-11-09 18:22:25 +08:00
Joey Shao d51e9e3cad mclaw 0.5.3: fail at authorize when there is no browser or display (#898)
mclaw's authorize now runs a preflight before it returns opened:true. When
no Chromium browser can be found, or Linux has neither DISPLAY nor
WAYLAND_DISPLAY, it returns {type:'failed'} at once instead of claiming a
window opened and failing later in callback (source issue
joey-41/opencode-mclaw-auth#1, the same shape as inkstone #825).
requireBrowser() is now the only place that looks up the browser, and
holds its one error message. It now looks for Edge, Chromium and Brave on
macOS, Edge on Windows, and microsoft-edge and /opt/google/chrome on Linux.
MCLAW_CHROME_PATH is checked first (X_OK, or F_OK on Windows) and a bad
path gets its own error. Headless renewal still goes through requireBrowser
only, with no display check. The cancel test now uses two independent
AbortControllers (#746 follow-up). README and CHANGELOG updated, 0.5.3.

Reviewed head 40784afa76c89285cb039460f55cc0f9fb059e21, on main 89fcfb2e.
Read every line of the diff: it adds no network endpoint, credential read,
install script or obfuscated code.

Run at that head, on mote (macOS), HOME a scratch dir:
- packages/mclaw `bun test`: 41 pass, 0 fail.
- repo `bun test` (HOME=$(mktemp -d), as CI): 7604 pass, 0 fail.
  `bun scripts/check.mjs`: exit 0. (The package has no node:test files;
  every test is bun:test.)
- Broken by hand, each red and restored:
  - no preflight call in authorize: both login preflight tests red;
  - no DISPLAY check: the browser-path and login no-display tests red;
  - MCLAW_CHROME_PATH not validated: the bad-override test red;
  - candidates not access()-checked: the real-executable test red.
- Real env, no seams, in WSL (magpie-desktop): DISPLAY/WAYLAND_DISPLAY
  unset → authorize returns failed with the no-display message, no
  opened. DISPLAY set + MCLAW_CHROME_PATH=/no/such → failed with the
  override message. DISPLAY set, no browser installed → requireBrowser
  throws the no-browser message.
- Candidate tables against real machines: mote finds
  ~/Applications/Google Chrome.app; xiaomi-gpu (Windows 11) finds
  C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe.
- PR CI (ubuntu, headless) test job green.

Not blocking, left for a later version: on Windows, Edge (installed on
every machine) now comes before a LOCALAPPDATA Chromium, so a renewal of
a profile Chromium made would open in Edge. Linux's table has no Brave,
though the README names it.

Not tried: a real MClaw sign-in (no account), or a headed sign-in through
Edge or Brave.
2026-11-09 17:58:05 +08:00
yetone 89fcfb2ea6 autoclaw 0.2.20: a 401 for a body larger than any answered, its sign-in holding, is a 413 (#891)
The CN managed gateway answers a ~200k-token request 401 "AutoClaw 登录状态失效"
while the same token gets 200 seconds before and after (hj01857655: 401 at
207k and 218k tokens, every 200 that day at most 129k). The plugin read it
as expired, so magpie marked the account signed out and stopped.

Now each provider remembers the largest chat body its gateway answered. A
401/403 (not quota, not ban) for a larger body has its sign-in checked on
the wallets route; a sign-in that holds there turns it into 413
request_too_large with X-Magpie-Sign-In: kept, so magpie's gateway asks
another member (a byte cap rests nobody) or tells the agent to compact.
No threshold is guessed. A body no larger than one answered, nothing
answered yet, a sign-in refused on wallets, or a check that fails stays
the sign-in, as before. Same rule on the overseas path (both hosts
refusing) since both providers share the fetch.

Run: lockf ~/suite.lock mote-run bun test packages/autoclaw, 109 pass
0 fail. Broken by hand (sizeRefusal returns null at once), wsl-run
bun test packages/autoclaw: the CN and overseas 413 tests red, 107 pass
2 fail; restored.
Not run: the full bun test (left at the coordinator's call, lock queue
long). Not tried: a real ~200k request on the CN gateway; the fixture is
the reporter's 401 body.

Reported-by: hj01857655
2026-11-09 17:22:25 +08:00
yetone efd8da8064 tabbit 0.1.3: the international app's sign-in reads "Tabbit Safe Storage", and Keychain failures say what to do
Signing in with "Read Tabbit Browser sign-in" failed at once, with no
Keychain prompt, as "Command failed: security find-generic-password -s
Tabbit Browser Safe Storage -w" (shiqi_40904, Discord, macOS 27.2).

Cause: Tabbit ships two macOS builds, and the plugin knew only one
Keychain name. Read out of both 1.16.27 installers (Info.plist, and the
framework code that picks the name from a flag set at start-up):
- Tabbit.app (com.tabbit-ai.Tabbit, international): data folder
  ~/Library/Application Support/Tabbit, service "Tabbit Safe Storage",
  account "Tabbit".
- Tabbit Browser.app (com.tab-browser.Tabbit, China): data folder
  "Tabbit Browser", service "Tabbit Browser Safe Storage", account
  "Tabbit Browser".
The plugin found the international store and asked for the China name;
security answered "item not found" (exit 44) with no prompt. The spaces
were never the problem: the name was already one argv entry, and the
message is only Node's way of printing the command.

Now:
- Each store asks its own build's item first, then the other's.
  Not found moves on at once; security only prompts for an item that
  exists, so a not-found never waits for a prompt.
- With both builds installed, the store that is signed in is read.
- The Keychain call is async with a 2-minute timeout (it was a 15 s
  execFileSync that dropped stderr), so the user has time to answer.
- Errors say what to do: not installed or not signed in -> open Tabbit
  and sign in; not in the Keychain under either name (both named);
  prompt denied (128/51) -> click Allow; no answer in time; keychain
  locked (36); anything else carries security's own stderr. Each
  points at "Paste Tabbit token".
- The method is now "Read the Tabbit app's sign-in (macOS)"; README
  lists both builds.

Run on mote (macOS, Node 22.22.0, Bun):
- node --test tests/*.test.mjs: 83 pass, 0 fail. bun test (temp HOME):
  83 pass. bun scripts/check.mjs: exit 0.
- Broken by hand: safeStorageNames returning only the China name (the
  old behaviour) turned 3 tests red, among them "the international
  build signs in with its Tabbit Safe Storage item (the report)".
- Again after rebasing onto ff9d3a64 (the pushed parent; it changed only
  system-prompt and trae): tabbit node --test 83 pass, whole-repo
  bun test (temp HOME) 7588 pass 0 fail, check exit 0.
- Tests use a fake security and fixture cookie stores; nothing reads
  this machine's Keychain or browser profiles.

Not tried: a real Tabbit account or a real Keychain prompt (none here),
so the prompt's exit codes come from Security.framework's OSStatus
values, not a recorded run. Dev builds' "TabbitDev ..." names are not
tried. magpie pins no min for tabbit (git grep finds none).

Reported-by: shiqi_40904 (Discord)
2026-11-09 17:17:41 +08:00
yetone ff9d3a6446 system-prompt 0.1.1: models matches a model's own name, and a routing group's try on it
@liucl on X (11-09): a prompt only for gemini-3.8-flash. `models` was
checked with String(body.model ?? ctx.model).startsWith(m), but an agent
wired to magpie names its model magpie's way, provider first
(google/gemini-3.8-flash, openrouter/google/gemini-3.8-flash), or names a
routing group (group/...). So "models": ["gemini-3.8-flash"] never
matched, though the README said "models whose names begin with one of
these prefixes".

A prefix now matches the whole id or the part after any "/" of it, case
aside; full-id prefixes (google/, deepseek) work as before. magpie's
middleware gets the agent's body at onRequest (ctx.model is modelOf(body),
serveAgent in internal/gateway/middleware.go), so a group request names
the group there. The member is known on each try: onProvider gets
ctx.provider {id, model} and can change that try's body
(docs/subsystems/gateway-middleware.md, triedOn). A request onRequest
didn't match is matched there against the member's model (and id/model),
so only the tries on gemini-3.8-flash get the prompt. ctx.state.given
keeps a try from adding it a second time after onRequest did.

Run on mote: packages/system-prompt bun test, 24 pass 0 fail (13 new
cases); bun scripts/check.mjs, all ok. In magpie's own engine: a
throwaway test in a detached magpie worktree at origin/main (removed, not
committed) loaded this module through internal/middleware's Begin,
Request and Tried in moejs: google/ and openrouter/google/gemini-3.8-flash
got it once, gemini-3.8-pro none, group/fast got it on the google
gemini-3.8-flash try and not on a deepseek try, no failures counted.
Broken by hand: with the old startsWith in onRequest, the 4 name cases go
red; with onProvider not exported, the 2 group-try cases; without
ctx.state.given, the "not given it twice" case.
Not tried: a real agent through a real magpie gateway and Gemini account.
Without override, an agent's own system prompt is kept and none is
added, as before; the README's example sets override.
2026-11-09 14:54:54 +08:00
yetone 065758f58b trae 0.2.33: a model whose top level is extra_high reaches max, sent as extra_high
@avalongarden6 on X (11-09, with screenshots): TRAE CN's app offers
DeepSeek-V4.1-Flash, GLM-5.3 and Kimi-K3 思考强度 轻/高/极高, and 极高 is
the model's maximum. magpie ranged the Trae CN member of a routing group
低–很高 (low–xhigh) while WorkBuddy, Qoder and WENMAI members ranged
…–最高 (max). magpie offers a group the levels its members share
(buildGroupEntries in internal/provider/group.go), so with Trae CN in it
the group lost max for every member.

A list entry whose top level is extra_high and that names no max of its
own is now offered max beside low/high/xhigh (offered, in variantsOf), and
effortOf sends max as extra_high, as it sends xhigh. magpie reads the
variants' keys as the model's Efforts (internal/provider/plugins.go), so
the member ranges 低–最高 (effortSpan in app.js) and a group set to max
fits max to the member's own levels (fitFor, catalog.NearestEffort), finds
it, and the plugin sends Trae extra_high. An entry that names Trae's own
max keeps it: max is max, extra_high is xhigh. A model topping lower
(light/high) is offered no max and sent none for it, as before.

Trae has no mover in magpie (no trae in internal/provider/migrate*.go), so
no min is raised.

Run on mote: packages/trae bun test with HOME under a temp dir, 246 pass
0 fail; bun scripts/check.mjs trae ok (registry ok).
Broken by hand: without effortOf's max -> extra_high line, 4 reasoning
tests go red (the #434 chatBody case, the variant round trip, the new
max/xhigh mapping test and the fetch-level max test); with variantsOf
offering the entry's own levels only, 4 go red (the variant lists and the
new test).
Not tried: a real TRAE CN account (no request with extra_high from max
was sent to Trae itself), nor a magpie routing group end to end; the
range and the group's max are read from magpie's code, not seen in its
GUI. A user who ticked a Trae model's levels by hand in magpie keeps that
list, without max, until they tick it.
2026-11-09 14:51:21 +08:00
yetone 1aab125bf1 kiro 0.1.34: each model shows Kiro's credit multiplier
01huadalang on Discord: "kiro 加上积分倍率消耗". Kiro's
List-Available-Models gives each model rateMultiplier with rateUnit
"Credit"; listModels now carries it as the model's rate, which magpie's
plugin host reads (rateOf) as Model.Rate, on the account's list and on the
config's model. A null, non-number, zero or negative multiplier, or a unit
other than Credit, gives no rate.

Values from a real Free account on 11-09 (origin KIRO_CLI and AI_EDITOR
answer the same, and kiro-cli chat --list-models shows the same
rate_multiplier): auto 1, claude-sonnet-4.5 1.3, claude-haiku-4.5 0.4,
deepseek-3.2 0.25, minimax-m2.5 0.25, minimax-m2.1 0.15, glm-5 0.5,
qwen3-coder-next 0.05. rate.test.mjs keeps sonnet's and the default
model's objects as Kiro sent them.

Usage is not multiplied again: the credits a request's meteringEvent
reports (usage.credit) already include the rate. One prompt cost 0.005349
on haiku and 0.017385 on sonnet, 3.25x, which is 1.3/0.4. The README says so.

Run on mote: packages/kiro bun test with HOME under the temp dir, 170 pass
0 fail; bun scripts/check.mjs kiro ok. Real run: listModels with kiro-cli's
sign-in returned all eight rates and runtimeModel carries them.
Broken by hand: without the rate in listModels both rate tests go red;
without the unit check the "no rate" test goes red.
Not tried: a Pro account's list (only Free); the rate in magpie's GUI. The
full root suite at this head was cut off when mote dropped mid-run
(connection closed by the host); it was not run to the end.
2026-11-09 12:45:12 +08:00
yetone c8125b92b5 commandcode 0.1.24: a Go, GOAT or Pro Credits window tells its count in credits, so magpie adds accounts up
chen2652 on magpie's Discord (v0.1.3361): three Command Code Go
accounts, folded together on the Routing page, showed no summed
credits. The Credits window of a units plan said only its share and
a display string, so magpie's mergeQuotas could only take the mean of
the shares, and only for cards on one plan. It now carries amount (the
credits used, as the display rounds them), limit (the month's pool)
and unit "credits", so magpie adds them up: "16.40 / 30 credits".

Bought and free credits (dollars at model cost) left the display's
"+ $X extra" for the account's balance, a row of its own under the
windows on magpie's Usage card. With a limit set, magpie's GUI and TUI
say the count from amount and limit, not the display, so the extra
would have been lost from the card otherwise.

Not changed: Max, Ultra and Teams Pro, whose Credits pool is dollars,
keep display and share only (magpie would print "$" as a unit after
the numbers).

Run: bun test in packages/commandcode on mote (100 pass, 1 skip, as
before), bun scripts/check.mjs (all ok). The test expectations for
the units plans' Credits window now include amount, limit and unit,
and GOAT's bought credits are the balance.
2026-11-09 12:26:36 +08:00
YangHonghang d54df279c0 window-warmup 0.1.4: Antigravity windows are warmed right after they reset, the service token survives restarts, and a new task opens at the bottom (YangHonghang, #878)
Antigravity-style idle cards (a resetsAt that rolls with each read, or the
old reset + 5h once a window has lapsed) are now read as idle and warmed
right after the reset; the service token is kept in the plugin's data
folder so an open page survives a host restart; a page whose token is
refused reloads once (an ww-reauth=1 marker in its URL stops a reload loop
and is removed after the next good request); a new task opens at the
bottom of the list.

Reviewed at 108d4752539b12e18f52aec7e320cf069b159792, run on macOS (mote,
Bun 1.4.2, HOME and TMPDIR in the run's own folder, Playwright 1.62.0):
- packages/window-warmup `bun test`: 285 pass, 0 fail, 0 skip
  (browser.test.ts ran in Chromium and WebKit).
- `tsc --noEmit`: exit 0. `bun scripts/check.mjs window-warmup`:
  registry.json and window-warmup ok. dist matches a fresh build
  (tests/dist.test.ts).
- Broken by hand, each red in scheduler/server/app tests: the 60s gap
  guard, the revoke branch's `resetRolls = false`, the probe wake-up's
  minDelay, the per-resetsAt probe cap (probedFor), the alreadyReloaded
  guard, and reauthURL's marker.
- A review-only browser test (not committed): a sandbox="allow-scripts"
  frame reached through a guide page that location.replace()s to the
  service, then the token rotated twice. In both engines the frame
  reloads with ww-reauth=1, the marker is removed by replaceState after
  the next good request, and the second rotation reloads exactly once
  more. The first rotation reloaded twice (two in-flight 401s each call
  location.replace); it settles and does not loop.

Not tried: a real Antigravity account (the author ran it 2+ days in
Docker), Windows and Linux.
2026-11-09 11:50:38 +08:00
Changtian Li bc5b8332ec kimi-desktop 0.1.6: per-role reasoning effort and context input budget (#813)
kimi-desktop 0.1.6: separate reasoning effort and an optional context input budget for the primary and secondary roles.

The change (f07e7f4a..1d14a185, since the round-6 approval):
- The settings page and API save `<role>ReasoningEffort` and `<role>ContextTokens` for each role. Only efforts and context limits the catalog publishes are offered; an unknown limit allows no custom budget.
- Inference drops Kimi's top-level `thinking`, `reasoning` and `reasoning_effort`, and sends the chosen effort, or none for the provider default. Kimi's native menu aliases no longer choose the model.
- A custom budget counts a copy of the request through magpie's `/v1/messages/count_tokens`. Over the budget gives 400 `context_length_exceeded`; a failed count gives fixed 503 `context_count_unavailable`. No generation is sent in either case. Without a budget, nothing extra is sent.
- Role-scoped worker profiles (`v2:[model, role]`) tell primary from secondary even on the same model. Older roleless profiles keep their binding and use defaults.
- 1d14a185 removes blank lines only.

Run at 1d14a1859f63fd4bb512d492d1de419ad3e6c79a on mote (macOS, Bun 1.4.2, HOME/TMPDIR/XDG in the run's own folder):
- `bun test` in packages/kimi-desktop: 626 pass, 0 fail, 29 files.
- `bun scripts/check.mjs kimi-desktop`: exit 0.
- 14 hand breaks, each red in the package suite:
  - drop `applyReasoningOptions`;
  - strip thinking fields only when an effort is set;
  - drop the budget check, or make it `>=`;
  - `useFresh` false, or without its model check;
  - a legacy roleless profile treated as primary;
  - a profile name without its role;
  - no `registerRoles`;
  - no `optionsMatch` in save;
  - no `refreshLiveModelOptions`;
  - count with `redirect: 'follow'`, or with no reply size limit;
  - a 131072 fallback for an unknown catalog context.
- CI at the head: test and on-npm pass. The PR merges onto main f379bf90+ with no conflicts.

Not blocking, left for a follow-up:
- Each inference now reads connection.json (adapter.mjs:547) with no fallback to the live connection. An unreadable file turns every request into 502, even without a budget.
- The comment above `applyReasoningOptions` ("Preserve the legacy connection untouched…") no longer matches the always-strip policy.
2026-11-09 10:07:07 +08:00
yetone e68748a78e opendesign 0.1.11: cap glm-5.3-flash and gemini-3.8-flash output at what amr-link takes (#827)
amr-link's /v1/models publishes context_budget 232000 for glm-5.3-flash
and 264000 for gemini-3.8-flash. Its API refuses anything over 131072 and
65536 with a 400, "Open Design: The request could not be completed.",
which names no field. Gitleonan measured this on 2026-11-09 with two
accounts (one of them took 232000 for GLM). A client that sends no limit,
such as Codex, gets the published number from magpie
(forwardTranslated's askedOutput), so every turn on those models failed.

modelOf now caps limit.output for those two models (CAP). It applies to
the seed and to every live catalog entry. A copy an earlier version kept
in the provider's config is capped too: config hands kept models back as
they were. models.mjs is left alone because refresh-models.mjs writes the
vendor's number back into it, and the live catalog's number overrides the
seed's anyway. A catalog number under the cap is used as it is.

This does not fix the red test dot through a Remote magpie. That comes
from the stream glm-5.3-flash sends when it reaches max_tokens: it ends
after content_block_stop with no message_delta or message_stop. magpie's
test asks for 16 tokens, and the model always thinks first, so it always
reaches the limit. On the issue I point to the magpie code for that path.

Run (on mote): bun test packages/opendesign gives 30 pass, 0 fail.
Broken by hand: with origin/main's index.mjs, the new test fails, and
with the config cap removed (the modelOf cap kept), it fails on the kept
gemini copy's 264000.
Not tried: a real amr-link request. There's no Open Design account here,
so the caps are the reporter's measurements, not ours.

Reported-by: Gitleonan
2026-11-09 09:56:29 +08:00
yetone e2d15ba653 qoder 0.2.64: a model off for credits used up is a 429 quota (#880); qodercli 1.21.2's single-file runtime on Windows (#879)
#880: on an international personal_professional_trial account whose 800
credits were used up, Qoder's listing had dfmodel off, and ask() answered
its own 400 `unknown or disabled model "dfmodel"`, which magpie reads as
the request's fault: a routing group neither failed over nor rested the
account (yetone/magpie#5726).

- models() records the keys the live listing names and has off (l.off).
- ask(): a known model the listing has off, on an account whose usage
  (/sash/api/v2/me/usage, device token rotated once as usage reads it; a
  PAT account's on its job token) says the pools spent in turn have no
  credits left, is answered 429 "usage limit reached: the account's
  credits are used up (800 / 800 credits), and Qoder lists "dfmodel" off
  for it until they refresh", before any job-token renewal. magpie's
  failure() reads that as failQuota (429 + usage limit, no brokeWords).
- Kept as before: a model off while credits are left, or when the usage
  can't be read (unknown, not quota), goes to the #484 renewal and the
  400; an id Qoder never served is the 400 at once with no usage read.
- usage() reads the envelope through the same usageEnv helper.

#879: qodercli 1.21.2 on Windows caches the helper as
.qoder\.bin\runtime-info-win32-x64-<hash>.exe beside sgsdk.dll, and
campaignRuntime took only the 1.1.66 folder umid-win32-<arch>-<hash>\.
Both are now taken, the newest by mtime; another arch's file and a
non-.exe (a .tmp) are passed over.

Run (mote, load ~900): packages/qoder bun test 424 pass 0 fail; bun
scripts/check.mjs qoder ok.
Broken by hand: the new tests against the old index.mjs: 5 red
(#879's single file found the umid folder instead; #880's 429 was 400;
spentOf missing).
Fixtures: #879 uses the reporter's file names
(runtime-info-win32-x64-faa59bbe39db0bd1.exe, sgsdk.dll). #880's issue
gives the plan, 800 credits used 100% and dfmodel off, but not the
listing's or usage's bytes; their shape is the other qoder tests'.
Not tried: a real out-of-credit Qoder account; Windows itself (the
runtime test forces platform win32 on mote); where Qoder desktop 1.21.2
keeps its helper now that resources\umid is gone (the reporter's second
point; QODER_RUNTIME_INFO still covers it); the repo-wide bun test (mote
at load ~900; only packages/qoder changed).

Reported-by: zane668 (#880)
Reported-by: ArmedHelicopter (#879)
2026-11-09 09:52:58 +08:00
yetone 40c9725666 autoclaw 0.2.19: rewrite Grok CLI's identity line for the CN gateway (#875)
Grok CLI through AutoClaw 国内 got four 406s in a row on 11-08. Its system
prompt opens "You are Grok released by xAI. You are an interactive CLI
tool ...", and FLAGGED had no rule for it, so the line went out as written.

Grok CLI writes that line in two shapes. Its own system_prompt.txt files
(grok 1.0.67, in ~/.grok/sessions on this Mac) show "You are Grok released
by xAI." for a model it doesn't know, and "You are Grok 4.7 released by
xAI." for one it does, in the interactive and autonomous variants alike.
The reporter's suggested regex matched only the first. The new rule takes
both: "You are the Grok[ 4.7] assistant released by xAI". It touches only
the "released by xAI" sentence, so "You are Grok-Mini." or "You are Grok,
a helpful assistant." are not changed. REFUSED_HINT now names Grok CLI.

Run (on mote): bun test packages/autoclaw gives 104 pass, 0 fail. The
new tests use the reporter's line byte for byte, plus the versioned and
autonomous lines from Grok CLI's own files.
Broken by hand: with origin/main's index.mjs and the new tests, 3 fail:
the Grok rewrite test, the all-lines table and the CN loader test.
Not tried: a real AutoClaw 国内 request. There's no account here, so
nobody has checked that the rewritten line passes the gateway. The same
pattern has passed for ZCode and Codex.

Reported-by: hj01857655
2026-11-09 09:51:34 +08:00
yetone f379bf907c doubao-work 0.1.2: say at once that an open Doubao must be quit
The owner's sign-in spun with no end. Doubao runs one copy at a time: with
the user's own Doubao open, the plugin's copy (its own profile, debugging
port) quits within a second of starting, so the port never opens.
waitSignedIn took every error but app_missing as "not signed in yet" and
started it again for five minutes, saying nothing.

- App.start looks for a running copy of the binary on another profile
  before it starts one, and fails with app_busy. The user's copy can't be
  driven instead: Chromium allows debugging only off the default profile.
- waitSignedIn ends on any app_* error (busy, missing, start timeout) and
  on abort; only a window still loading is waited for.
- Sign-in and requests say: quit Doubao (⌘Q) and try again. A request
  gets 503.

Run: bun test packages/doubao-work on mote (+ check.mjs), Linux (WSL) and
Windows: 28 pass, 0 fail. With waitSignedIn's old catch put back, the new
waitSignedIn test is red (60s timeout instead of app_busy). Live on this
Mac, with a Doubao running from another profile: waitSignedIn threw
app_busy in 92ms, nothing spawned, no profile made. That a second copy
quits was tried first: Doubao with a fresh profile and port exited in ~1s,
port never up.
Not tried: the owner's Mac (10.0.0.175) itself.
2026-11-09 06:53:05 +08:00
yetone e918aa6c4b doubao-work 0.1.1: plain model names, text-only input
magpie shows a model as "<name> · <provider>", so "豆包工作 · 自动" read
"豆包工作 · 自动 · 豆包工作" in pi. The names are now Doubao's menu names.

The models gave no modalities, so magpie asked models.dev about "auto",
another vendor's model, and told pi it takes images and a thinking level
map. Each model now says text in, text out.

Run: bun test packages/doubao-work on mote (with check.mjs), Linux (WSL)
and Windows: 25 pass, 0 fail. The new assertions fail on 0.1.0's names.
2026-11-09 06:42:10 +08:00
yetone 29ceed20c9 doubao-work: test the sign-in and the app start on every OS
c1ed1b51's publish run went red on ubuntu: the sign-in test read the real
binary(), which is "" off macOS, so the callback said "macOS only". Its
App test spawned /bin/sh, which Windows doesn't have. Both passed on mote
(macOS) only.

createPlugin takes appBinary (default binary()), and the sign-in test gives
each case: a Mac path signs in, "" says macOS only. A new test holds
binary() per platform and DOUBAO_WORK_APP. The App test uses a file it
makes.

Run: bun test packages/doubao-work, 25 pass on mote (temp HOME, as CI),
wsl-run (Ubuntu 24.04) and win-run (Windows 11). bun scripts/check.mjs ok.
2026-11-09 06:12:13 +08:00
yetone c1ed1b511e doubao-work 0.1.0: 豆包工作 as a provider, by driving the Doubao desktop app
Doubao Work runs its agent loop in ByteDance's cloud and has no API. This
plugin uses the desktop app the way a person does and gives the reply back
as an OpenAI chat completion:

- cdp.mjs (knows nothing about Doubao): starts a Chromium-based app from a
  profile of its own with DevTools on a port it picked and saved, reuses it
  while it runs, never kills anything; Page evaluates and presses keys.
- doubao.mjs: per request a new 工作任务, switched to 云电脑 (Doubao's agent
  never touches this computer), the model picked (Pro needs a paid plan:
  403), the whole request written into tiptap one paragraph a line, Enter,
  and the reply read from the message's content_blocks_v2 (markdown, and
  thinking as reasoning_content) until is_finish. One request at a time.
- prompt.mjs / openai.mjs: system prompt, tools and turns flattened into one
  message; tools asked for as <tool_call>{json}</tool_call> and given back
  as tool_calls; SSE that holds text from the first call (or a tail that
  may start one), and that throws a failure before the reply begins so it
  goes back as an HTTP error.
- Sign-in waits for the account in the separate Doubao window.

Run:
- bun test packages/doubao-work on mote: 24 pass.
- Full suite on mote the way CI runs it (HOME=$(mktemp -d) bun test):
  6936 pass, 20 skip, 0 fail. bun scripts/check.mjs: doubao-work ok.
- Broken by hand: sleep without its aborted check; "an abort between two
  polls stops the ask too" goes red (runs to the 180s idle timeout), green
  with it. Found by the first run: an abort landing between polls was lost.
- Live, the loader against a signed-in Doubao 147 on macOS: auto plain
  answer 200 in 3.9s; doubao-2.1-lite streamed Bash tool call (first byte
  3.6s, total 4.8s); tool result follow-up answered "412 lines"; Pro gave
  403 doubao_upgrade; a 300-word story streamed as 20 content deltas with
  its ```python fence kept; a client abort ended the stream and the next
  request answered 200.

Not tried: through magpie's plugin host and a real agent (Claude Code
sized requests); Windows and Linux (unsupported, sign-in says so). A
stopped request stops being read but Doubao finishes its task (README).
2026-11-09 06:05:35 +08:00
caikn b228cc6a68 sap-aicore 0.3.2: accept session metadata, forward context_management with its beta (caikn, #851)
sap-aicore 0.3.1 refused two top-level Messages fields that real agents send:

- `metadata` (omp sends `metadata.user_id` on every request): now accepted and
  dropped in `bedrockBody`, the one builder both /invoke and
  /invoke-with-response-stream use, so it never reaches Bedrock.
- `context_management` (omp and Claude Code with thinking on send
  `{"edits":[{"type":"clear_thinking_20251015","keep":"all"}]}`), with
  `anthropic_beta`: both are accepted as opaque native fields and forwarded
  unchanged. When `context_management` comes without `anthropic_beta`, the body
  gets `anthropic_beta:["context-management-2025-06-27"]`, which SAP/Bedrock
  needs (without it SAP answers 400 "Extra inputs are not permitted"). An
  explicit `anthropic_beta` (including [] or null) is sent as given. SAP judges
  unknown edits and betas; its 400 surfaces once, redacted, with no retry. The
  author verified the literal directive against live SAP deployments (Opus 4.8,
  Opus 4.6, Sonnet 4.6, whole replies and streaming). Closes #864.

The test for #812 ("late failure does not delete a newer candidate") now waits
for the first token fetch to start instead of a 10ms sleep, and checks r1
failed, r2 succeeded and two fetches ran. Closes #812.

Version 0.3.1 -> 0.3.2 (the dist branch has 0.3.1; the package is not on npm).

Run at 76e1bfef2 (base 966cf717; origin/main 46fef953 has no sap-aicore change
since), on mote, HOME and TMPDIR under ~/runs, Bun 1.4.2:
- bun test packages/sap-aicore: 343 pass, 0 fail
- bun scripts/check.mjs sap-aicore: registry.json and sap-aicore ok
- bun test (repo root): 6895 tests, 6875 pass, 0 fail, 20 skip (HOME under TMPDIR; not through mote's suite lock, whose queue was hours long)
Broken by hand (messages.test.js + messages-stream.test.js, 46 tests):
- default beta line removed: 4 red (both agent-thinking tests, both defaulting tests)
- beta always set, overriding an explicit one: 4 red (override and novel-beta tests)
- context_management/anthropic_beta out of ALLOWED: 7 red
- main's messages.js: 9 red (adds both metadata tests)
The #812 test is unchanged since 19cabed44, where a 30ms delay injected in
authorize turned the old test red and the new one green.

Co-authored-by: Kanyin Cai <kanyin.cai@sap.com>
2026-11-08 21:48:44 +08:00
yetone 46fef953c8 catpaw 0.2.1: the credits' refresh time is the window's reset, so Smart routing ranks the account (#867)
The 可用积分 window was always aside with no reset, so Smart routing never
ranked catpaw accounts by it. The credit/balance response the plugin
already reads carries userPlan.nextRefreshTime, a ms epoch string
("1796054400000"), when the plan's credits refresh. It is now the
window's resetsAt; magpie's Allowance.Renewal ranks by it, soonest first.

Why resetsAt and not runsOutAt (the issue's suggestion): 重置 is the
window's renewal; runsOutAt is for credits lost apart from a reset, and
with runsOut set the GUI would say "N credits expire", which nobody has
checked. Routing ranks both the same (Renewal takes the sooner).

used stays 0 and there is no limit: the vendor gives only the balance,
and a difference of balances would be made up. The GUI's rendering of
the window is unchanged (aside is not sent to it); it now shows the
reset line. A credit of 0 is not read as used 100: catpaw has free
models that may still answer.

No reason for aside was recorded (eeb344f1, PR #174); it read as "no
reset known". nextRefreshTime missing, empty, not 13+ digits (a
seconds value, a date string, a fraction, negative) or an object keeps
the window aside, as before: a failed read is unknown. A past refresh
time is kept as read; magpie treats a passed reset as not known.

Run at this tree on mote (mote-run):
- packages/catpaw bun test: 64 pass, 0 fail (13 new)
- bun scripts/check.mjs catpaw: exit 0
- repo-root bun test under a mktemp HOME: 6904 pass, 0 fail, 501 files
  (without an isolated HOME, 21 fail: zcode/devin tests that refuse a
  real HOME by design)

Broken by hand, then restored:
- window always aside again: 2 fail (reporter's string shape, numeric)
- any non-empty value accepted: 3 fail (seconds, negative, fraction)

Not tried: a real catpaw account (none here); the reporter's balance
shape is taken from the issue. Not tried in a running magpie's Routing
page.

Reported-by: orinsid
2026-11-08 20:56:34 +08:00