Commit Graph
669 Commits
Author SHA1 Message Date
yetone 5499be8536 page-chat 0.1.7: magpie's own MCP servers that are on are used beside the Library's (ferock on Discord)
ferock on Discord: with "使用 magpie 的全部 MCP 服务器" on, a chat got
only the servers in library.json, never magpie's own web search, image
recognition or image generation.

ownMcp (lib/gateway.mjs) asks the gateway's GET /v1/magpie/mcp (magpie
v0.1.2397) for the ones on now and mounts each at the gateway's address
with the gateway key. readMcp adds them after the Library's, which every
route takes its MCP list from: the page's list (libraryView), a chat's
tools, a tool call and the connection check; a Library server of the
same name (an installed magpie-image) is used in its place. One turned
off in magpie's Settings is left out of the next chat. An older magpie
(404), a gateway that doesn't answer, or a bad reply lists none, as
before. lib/mcp.mjs loadServers (library.json only) is unchanged; the
page calls listTools/callTool with server objects, never by name.

Run (mote): bun test chat.test.mjs, 29 pass; the new test is red on the
old lib (Expected 2 more tools, Received 0), checked by hand.
bun scripts/check.mjs ok. magpie's side was run against its real binary
(magpie commit cac655c14's body).

Not tried: the page in magpie's window against a real magpie with the
switch on (the test drives the page's service with a fake gateway).
2026-10-31 20:38:10 +08:00
yetone 2fc8945de4 orcaterm 0.1.2: a new upstream conversation per request, and the envelope unwrapped wherever it shows (#564)
ferocknew saw a reply come out as the assistant's own envelope
({"action":"completion","ph_1":"--","taskCompletion":"…"}) and another
session's transcript end with OrcaTerm's output format.

Cause: the plugin kept one upstream conversationId per account and
session (and "default" when no session was named). OrcaTerm keeps a
conversation's turns by its id, while the plugin already sends the whole
transcript, so a reused id put upstream's copy of earlier turns (the RE_ACT
output format and raw envelopes) in front of each request; two sessions on
one id (no session id, or magpie's first-user-turn hash shared by a title
request or a same-opening chat) read each other's. Three more routes let an
envelope through: one written with bare line breaks or quotes is not JSON
and went out whole; an envelope sent only as thinking was the fallback
text as it was; and an earlier envelope the agent kept in its history went
back up as the assistant's turn, which the model then imitated.

Now every request gets a fresh cid-<uuid>-orcaterm (the user id stays per
session), a hand-written envelope is read for its answer
(looseEnvelopeAnswer), the thinking fallback and the history turns go
through the same extractor. The plugin adds nothing to other providers'
requests: its only non-auth hook is chat.headers, gated on providerID.

Run on mote: bun test in packages/orcaterm 110/110 pass; bun scripts/check.mjs
orcaterm ok; bun test scripts 3/3. leak.test.mjs at the old index.mjs: 4 of
7 red (bare line breaks, thinking-only, history turn, shared conversation
id); the reporter's literal envelope itself already unwrapped when clean.
Not tried: a real OrcaTerm account (none here), so upstream's keeping of
turns by conversationId is from the plugin's own measurements, not re-run.
2026-10-31 20:36:11 +08:00
yetone 8693d77c00 trae 0.2.26: a token_usage naming no cache count is unknown, not a 0% miss (yetone/magpie#3991, #3979)
Trae CN users see cache read 0 / write 0 on every call since 10-28
(modeyang: 786 trae-cn calls on 10-29 all 0, 77 hits on 10-27; an
identical resend also 0). The plugin passes on what token_usage says:
cache_read_input_tokens / cache_creation_input_tokens. A token_usage
with no cache field at all (chansee97's real super_completion_query
capture in #455: {"prompt_tokens":1717,"completion_tokens":2,
"total_tokens":1719}) came out as a usage with no cache field, which
magpie can only read as a counted miss. CDX-5 (#434) reports Trae's
chat replies switched to that shape at 10-27 23:07; not verified with
raw bytes. Trae's own client (3.5.20, libai_agent.dylib) still has the
9-field TokenUsageEvent, so the fields exist in the protocol.

Now:
- no cache field named at all -> magpie_cache_unknown: true (as the
  Kiro plugin does), so magpie shows the cache as unknown;
- DeepSeek's prompt_cache_hit_tokens, cached_tokens and
  prompt/input_tokens_details.cached_tokens are read as cache reads
  (largest of them, so a 0 in one spelling never hides a hit);
- an explicit 0 stays a counted miss.

This cannot make Trae cache; if Trae no longer reports cache, the
plugin cannot know the hit rate.

Run (mote, bun 1.4.2):
- packages/trae bun test: 230 pass, 0 fail
- whole repo HOME=$(mktemp -d) bun test: 4324 pass, 9 skip, 0 fail
- bun scripts/check.mjs: exit 0
Broken by hand: the old index.mjs with the new tests fails 4 (3 new
cases + request.test's stream usage).

Not tried: a real Trae CN account (none available), so whether Trae
now omits the cache fields or sends 0 is not confirmed.
2026-10-31 20:21:40 +08:00
yetone fee318fed4 workbuddy 0.2.7: deepseek-v4.1-flash lists none (#563); copilot.tencent.com's takes 100000 tokens (#561)
#563: deepseek-v4.1-flash and deepseek-v4.1-flash-sg list a "none"
level. Both sites' /v3/config call them onlyReasoning, so WorkBuddy's
own client hides the off switch and the plugin listed none of it. They
take it anyway. On WorkBuddy AI on 2026-10-31, reasoning_effort "none"
answered 200 with 0 reasoning tokens (twice on -flash, once on -sg).
"low" spent 1221 and 1127 reasoning tokens, and no effort (the plugin's
default high) spent 1219. glm-5.3-flash still lists no none. The
default effort stays the config's high.

#561: on the China build (copilot.tencent.com), deepseek-v4.1-flash's
context is capped at 100000 (SITES.workbuddy.contextCap, contextOf). A
smaller config value is kept. The reporter's vendor error was "prompt is
too long: 100001 tokens > 100000 maximum", seen 11 times on 2 accounts,
while glm-5.3-flash on the same endpoint takes 1M. The config says
1000000 on both sites. WorkBuddy AI's deepseek-v4.1-flash took 148,793-
and 181,887-token prompts, so that site keeps the million.

Run:
- deepseek-flash.test.mjs (new, against testdata/config-561.json, the
  real configs cut to the models compared) and efforts.test.mjs,
  against the old index.mjs on mote: 5 fail, 3 pass. The ones that
  pass are the glm/no-none and unchanged-sibling checks.
- The workbuddy package on mote, HOME=$(mktemp -d) bun test: 297 pass,
  0 fail.
- bun scripts/check.mjs on mote: ok.
- Real WorkBuddy AI account in a sandbox HOME, through the plugin loader:
  the none/low/default and long-prompt numbers above.

Not tried: the China build itself. Both CN sign-ins I have (desktop on
this Mac and on the Windows box) answer 401 on chat, so the 100000 cap
rests on the reporter's literal error, not on a reply of my own.
2026-10-31 20:17:58 +08:00
qingnian108 a431798fe1 agent-console 1.0.0: a page plugin that drives the local Agent CLIs (#535)
Adds Agent Console (@magpie-community/page-agent-console 1.0.0), a community page plugin that drives the Agent CLIs on this computer (Claude Code, Codex, ACP agents) through a local daemon on 127.0.0.1, with its source in packages/agent-console and a registry entry. Claude Code is the user's own `claude` CLI driven over stream-json (daemon/src/providers/claude/cli.ts); no Anthropic SDK is installed, bundled or in the branch's history. Cold install ~45 MB (node-pty ~26 MB), stated in the README and registry summary in en and zh.

By qingnian108 (#535).

What was run at 8e8f910 (mote, macOS, throwaway HOME, no real accounts):
- packages/agent-console: `npm ci --ignore-scripts --workspaces=false`; `node scripts/verify-build.mjs`: all five bundles byte-identical (daemon/dist/main.js 08c95aa3…, app/app.js 9a6911f3…); `vitest run`: 45 files, 254 passed, 17 skipped; `npm run check` clean.
- Real Claude Code 2.1.316 (npm @anthropic-ai/claude-code, sandbox HOME/CLAUDE_CONFIG_DIR, local fake Messages API): `AC_REAL_CLAUDE=… vitest run --config vitest.real.config.ts test/real/claude-cli.real.test.ts`: 4 of 4 (initialize lists 51 slash commands, streaming turn, Bash permission approved and denied, interrupt, --resume with set_model).
- Probe: the driver's exact argv with `--permission-mode bypassPermissions --allow-dangerously-skip-permissions`: the tool runs with no can_use_tool request.
- Repo root: `HOME=$(mktemp -d) bun test`: 4006 tests, 0 fail; `bun scripts/check.mjs` exit 0.
- Install as magpie does: `npm pack --ignore-scripts` (552 KB) then `bun add --ignore-scripts`: 45 MB node_modules, no @anthropic-ai/*, index.mjs imports.
- Read every changed line since 41c7a94: argv values limited to SAFE_ARG tokens (no cmd.exe metacharacters reach the shim path), no new network hosts, no install scripts, no eval; no commit in main..8e8f910 contains claude-agent-sdk.

Not tried: magpie's desktop window loading the page; a Windows .cmd/.ps1 claude shim end to end.
2026-10-31 20:11:22 +08:00
yetone 62ba6d7267 agent-office 0.2.1: cold image scans frame only the unfinished EOF record (#559)
Bumps the version for #559's scanner change and moves its changelog
lines from 0.2.0 into a 0.2.1 section; cli.test's ping expects 0.2.1.

Run on mote at this tree (0e3562b + this commit): packages/agent-office
HOME=$(mktemp -d) bun test 167 pass 0 fail; stamp-page.mjs --check 0;
root bun scripts/check.mjs 0. #559's full suite at its head: 4321 pass,
9 skip, 0 fail.
2026-10-31 19:10:19 +08:00
QingJ 0e3562b25f agent-office: frame only fragments unfinished at EOF in cold image scans (#559)
The incremental session scanner frames only fragments still unfinished at
EOF, instead of passing every 64 KiB fragment of a complete cross-chunk
record through the character framer. A framed-part index stops a later
tick from walking text it already framed. Adds regressions for the four
mutation gaps named on #551 and a WebKit CSP diagnostic script.

Reviewed at 5f564b034df26e12b60c40f683922ce0389abdd1 on main 7714b61.
Run on the Mac mini test box (mote, Bun 1.4.2):
- packages/agent-office: HOME=$(mktemp -d) bun test: 167 pass, 0 fail;
  bun scripts/stamp-page.mjs --check: exit 0.
- Full repo: HOME=$(mktemp -d) bun test: 4321 pass, 9 skip, 0 fail
  (338 files); bun scripts/check.mjs: exit 0.
- Broken by hand: eager framing restored -> both cold-scan tests red;
  framed index not advanced -> 2 red (cold-scan EOF, unfinished quoted
  brace never reparses); ExtendedTail disabled -> extended-EOF test red.
  Each restored -> 167 pass.
- bench-scan.mjs 100 1 1, initial scan: ~29-32 ms at this head vs
  ~294-319 ms at main.
- Host probe: office.hooks.mjs imported without
  MAGPIE_AGENT_OFFICE_PAGE in a sandbox HOME with one Claude session;
  snapshot() ok and page/live.js written.
Not tried: a real magpie install of the page.
2026-10-31 19:09:38 +08:00
QingJ 7714b617c7 agent-office 0.2.0: real 3D office, workbench, incremental session scan
Agent Office 0.2.0 (QingJ01, #551): a real 3D office, the workbench, and the earlier review's fixes. The session scanner now reads growing JSONL logs incrementally. It keeps a saved offset with 128 guard bytes, carries UTF-8 and partial JSON across ticks, applies a record complete at EOF once, and resets on truncation, inode or birthtime change and same-size rewrites. Readers update per kind (Claude response usage replaced, Grok sidecar daily totals replaced, metadata refreshed apart from logs).

Run at the reviewed head 3bf522f, merged on main 622f950, on mote under HOME=$(mktemp -d):
- agent-office bun test: 163 pass, 0 fail. Full bun test: 4310 pass, 9 skip, 0 fail. check.mjs agent-office and stamp-page --check: exit 0.
- 100MB log: append scan ~50ms -> 0.04-0.2ms (4x100MB: ~240ms -> 0.13-0.29ms). Through office.hooks: first scan 82ms, then 0.11-0.24ms per append.
- Fuzz with real Claude, Codex and Grok logs in random appends vs a fresh scanner: 0 mismatches.
- Broken by hand: 9 mutations of the cursor and readers go red. Gaps left as follow-ups: the inode check alone, ExtendedTail, the Codex title cursor and summary.json re-reads. Also follow-up: the first scan of an image-heavy log (336ms vs 42ms, framePart).

The package is new on npm: the owner publishes 0.2.0 by hand the first time.
2026-10-31 18:19:53 +08:00
yetone d05f55e7c9 commandcode 0.1.21: a Google model's tool schemas have nested $refs written out
kthink on Discord: dsh on google/gemini-3.8-flash was refused 400
AI_UnsupportedFunctionalityError "Google schema conversion only supports
references to direct children of root-level $defs or definitions ...
#/properties/func/properties/triggers/items". dsh reuses part of its own
schema by a pointer into properties. For a Google model (google/..., or an
id naming gemini) such a $ref is now written out in place, on the Provider
API and on Go's /alpha/generate; a ref to a direct child of $defs or
definitions goes as it came; a loop or 32 deep ends at the target's type.
Data named $ref (default, enum) and refs that name nothing are untouched.
Every other model's schema goes as it came.

Run (mote, HOME from mktemp -d): bun test in packages/commandcode, 94 pass;
bun scripts/check.mjs commandcode ok. google-schema.test.mjs against the old
index.mjs: 6 of 7 red, including both end-to-end tests (GOAT, Go) that
send the dsh-shaped schema to google/gemini-3.8-flash.

Not tried: a real request. Both Command Code keys in magpie's plugin-auth
answer 401, so the fix is not checked against Command Code's gateway.
Siblings (other plugins with Gemini models) are not checked: #557.
2026-10-31 18:04:23 +08:00
yetone 622f950392 commandcode 0.1.20: Go, GOAT and Pro's month is said in credits; Provider has no month (#556)
NeuroPaw (#556): PLAN_NAMES sizes GOAT's month at 70 and Pro's at 80,
while Command Code's pricing now says GOAT "up to $100" and Pro "up to
$110", per model.

Checked against Command Code's live pages (2026-10-31). The usage limits
page says "on Go, GOAT and Pro, credits are usage-value units -
full-allowance models like GLM-5.2 get $1 of usage per credit", and that
GOAT's 14 credits in 5 hours and 35 in 7 days are "worth up to $20 / $50
of usage on a $100 model like Ling 3.1 Flash, or $14 / $35 on a $70 model
like GLM-5.2" (Pro: 16 / 40, up to $22 / $55 on a $110 model, $16 / $40
on an $80 one). billing/credits' windowLimits caps are those credits (the
recorded GOAT reply has caps 14 and 35, monthlyCredits 69.80). So the
month is 70 credits on GOAT and 80 on Pro, in the units monthlyCredits
counts in: the CLI's 70 and 80 still match, and raising them to 100 and
110 would mix dollars into a credit count. What was wrong is the card
calling those credits dollars ("$0.20 / $70.00"). The pricing page lists
Provider as "$15 /month ... Pay as you go" with no credits, and the
table's 15 made a "$x / $15.00" month for it.

- Go, GOAT and Pro (both Pro ids): the Credits window is the month's
  credits, said as credits ("0.20 / 70.00 credits"); bought and free
  credits, dollars at model cost, are said beside it ("+ $5.00 extra")
  and no longer added to the pool.
- Max, Ultra, Teams Pro (1 credit = $1): the CLI's pool, in dollars,
  unchanged.
- Provider: no month of credits, so its card is the balance.
- The 5-hour and weekly windows are unchanged.

The response has no field with the plan's total, so the month's size
still comes from the table; /alpha/usage/summary was not read (see Not
tried).

Run (mote, Bun 1.4.2, HOME=$(mktemp -d), at this tree on b70725c):
- bun test (whole repo): 4201 pass, 0 fail, 4210 tests across 329 files.
- bun scripts/check.mjs commandcode: ok.

Broken by hand:
- plan-credits.test.mjs against origin/main's index.mjs: 4 of 5 red
  (GOAT real reply, credits labels, GOAT extras, Provider balance); the
  Max parity test stays green, as it should.
- GOAT set to 100 (the issue's option 2) in the new index.mjs: 3 of 5
  red.

Not tried: a live Command Code account. Both keys here (~/.commandcode
and magpie's plugin account) are answered 401 by billing/credits,
billing/subscriptions and usage/summary today, so the GOAT reply is the
one recorded in testdata (2026-09/10). Which planId today's $20 Pro has
(individual-pro, 30 in the CLI, or individual-pro-v1, 80) is not
confirmed; both are left as the CLI has them.
2026-10-31 17:19:44 +08:00
yetone b70725c1a6 cursor 0.2.35: a step ends on calls Cursor completed itself, or on a checkpoint waiting on every call (#550)
Windsland52's wire trace (stateless path): partial c1 -> completed c1,
partial c2 -> completed c2, partial c3 -> started c3 -> one exec, then
the tool count (update 27), 7 set_blob, a checkpoint whose
pending_tool_calls (ConversationStateStructure 4) holds one id, and
240s of heartbeats. Cursor's count includes calls it completed itself
(#7 then #3, with no #2 and no exec), which never reach this side, so
the step waited for calls that were never coming while Cursor waited on
the one exec's result. The native path had the same gap and failed after
batchWait. Cursor's own client (cursor-agent 2026.10.01) takes a
toolCallCompleted for a call it never started, and never waits on
toolRequestsListed.

Now, on both paths, a #3 for a call seen as #7 in the same step, never
started (#2) or exec'd here, counts toward the step's tool count, and a
checkpoint after the count whose pending calls equal the calls this side
holds ends the step too. The strict "more calls than the count" check
still counts only calls that came and were answered here. The quiet
error and batchWait name the count, the calls, the answered and those
completed by Cursor; the Wire trace keeps each update's count, tool
kind, pending and why the Run was cut. Update 8 is named (token count).

Run at this head: stall-550.test.mjs (10 tests, built from the trace's
195 inbound frames in order) and the cursor suite 376/0 on mote; the
root suite with a temp HOME 4196 pass, 0 fail, and check.mjs cursor ok
on mote; native-session, native-e2e, stall-550, conversation and
stepusage 191/0 on Windows (win-run).
Broken by hand, each red only in its own test: the stateless
completed-by-Cursor rule, the stateless checkpoint rule, the native
completed rule, the native checkpoint (waitedOn), and the #7-in-this-step
requirement.
Not tried: a real Cursor account; the real count value (the trace gives
only 2..127); that a #3's call_id equals McpArgs.tool_call_id; what the
two completed calls were; whether Cursor can checkpoint mid-step with
pending equal to the calls before more execs.
2026-10-31 16:36:38 +08:00
yetone 1a5b184991 cursor 0.2.34: the quiet error names its checkpoint; an opt-in Wire trace saves a failed Run's frames (#550)
Windsland52 (#550, 0.2.33, cursor/grok-4.6 at xhigh): four Runs ended
"Cursor went quiet: 24 heartbeats and nothing else for 240 s, its last
message checkpoint". They asked for the checkpoint to be named, and for a
way to see what Cursor sends after it. No change to quiet's budget or to
retry, as asked.

The quiet error now says, for a checkpoint: its number in the Run, which
of its step's checkpoints it was (native path; the stateless path doesn't
count steps), how many came in a row, and the kinds before it, e.g.
"its last message checkpoint #1 of the Run, the first of step 1, after
blob request x2, thinking". Other kinds read as before.

Wire trace is a new plugin option (wire_trace), off by default. With it
on, a Run that fails (not one the caller cancels), native or stateless,
writes <magpie's folder>/cursor-traces/<start>-<rand>.json (temp and
rename, mode 600, newest 20 kept). It holds both directions' frames as
time, size, kind, top-level field numbers with wire type and size, and
the field numbers and sizes one level inside: the shape, never the bytes.
No text, thinking, tool name or argument, blob or blob id, checkpoint
content, token, header, account or conversation id is read into it. The
error message is scrubbed of email-, uuid-, auth-id- and token-shaped
strings. It also has quiet's counters, the model id and plugin version.
The first 2000 and last 3000 frames are kept, the rest counted. The
folder comes from input.directory, which magpie sets to its config
folder. The option exists only in magpie, so OpenCode's project folder is
never written to.

Run on mote at this tree (33027a8 + this change):
- HOME=$(mktemp -d) bun test at the root: 4186 pass, 9 skip, 0 fail.
- bun scripts/check.mjs cursor ok.
- native-session + native-e2e on xiaomi-gpu (Windows, win-run): 165
  pass, 0 fail.
Broken by hand, on mote:
- The new tests against origin/main's code: 5 fail.
- Raw frame bytes added to each entry: both e2e trace tests red (secret,
  token found).
- Tracing cancelled Runs too: the cancelled test red.
- Ignoring the option: "off unless the option is on" red.
Not tried: a real Cursor account. The stall hasn't been reproduced here,
so the fixtures follow what #550 reports (heartbeats after a checkpoint),
not a captured Run. Not tried in the magpie GUI either: that the option
shows as a toggle under Plugin options is from how Included usage only
shows, not looked at.
2026-10-31 15:10:54 +08:00
sakisakisa-design 33027a8fb8 aelios 0.1.0: Aelios memory recall and opt-in recording as gateway hooks (#549)
New package @magpie-community/gateway-aelios 0.1.0: asynchronous gateway hooks for Aelios memory, by sakisakisa-design (Aelios's author).

- Recall before each human turn, appended after the last user message. Recording of completed turns is opt-in (record: false by default).
- Traffic goes only to the user's own serverUrl (HTTPS or loopback HTTP, redirects refused, a key required). Only local and magpie-key origins by default.
- Local admission: an authenticated, dialogue-free GET /v1/hook/identities decides which model maps to which identity. Unmatched turns, or an unavailable list, send no dialogue.
- The request is slimmed (system prompts, thinking and tool results dropped, historical credentials masked). The recorded reply is slimmed to text and tool calls before the secret check and the send.
- Settings page served by a loopback Bun service (Host, Origin null and per-process token checks).
- The cleanMessageText/appendMemory logic ported from AGPL Aelios is relicensed MIT by its sole author (PR thread).

Run at the reviewed head 620cd47 on mote (macOS, Bun 1.4.2):
- bun test packages/aelios: 178 pass. Full HOME=$(mktemp -d) bun test: 4176 pass, 0 fail. Merged onto main 39de030: 4179 pass, 0 fail. check.mjs: exit 0 at both.
- Broken by hand: recording the raw reply turns 5 tests red; admitting every model turns 11 red.
- Probe against a fake Aelios: no thinking, reasoning, signature or encrypted_content is recorded for Anthropic, Responses or Chat. A secret in visible text skips the record. An unmatched model, or an identities endpoint answering 404, malformed JSON or a network error, sends only the GET.
- Real magpie Bun host (origin/main ceeb73a0f, GatewayBegin/Finish): recall injected, the slimmed record sent, nothing for an unmatched model or a remote origin.
- PR CI: test red only on gcp-ai's browser test 40s timeout (#471, unrelated, passes on mote).

Not tried: a real Aelios deployment, or a real agent behind a running magpie.
2026-10-31 14:52:01 +08:00
yetone 39de03001d page-chat 0.1.6: one switch uses every MCP server in magpie's Library (Magiczerowxy/magpie-chat#4)
ferocknew asked for a way to give new chats every MCP server without
ticking each one. The MCP list in the settings sidebar now starts with a
switch, "使用 magpie 的全部 MCP 服务器". On, a chat uses every server in
library.json, read again on each chat, so a server added to magpie later
is in too; the rows show checked and disabled. Off (the default, and what
a 0.1.5 settings.json reads as), ticking works as before, and the ticks
set before turning it on come back.

The whole path: the setting is mcpAll in the service's settings
(cleanSettings keeps it, default false). runChat wants tools when mcpAll
is on even with nothing ticked, and pickServers() picks every Library
server; "检查连接" (/api/mcp/tools) checks the same set. The page sends
useTools when mcpAll is on. The service picks servers from the saved
settings, while the page saves them 320ms after a change, so send() now
saves pending settings before /api/chat; a switch flipped just before
sending (or a server just ticked) counts.

Run (mote, bun 1.4.2, HOME a temp dir): bun test chat.test.mjs, 28 pass;
bun scripts/check.mjs chat ok. Three new tests: a chat against two fake
Streamable-HTTP MCP servers gets only the ticked one with the switch off,
both with it on and nothing ticked, a third added to library.json after
turning it on, and /api/mcp/tools lists all three; a 0.1.5 settings.json
reads as off; the page's wantsTools and the save-before-send.
Broken by hand: pickServers ignoring mcpAll fails the first two tests;
cleanSettings dropping mcpAll fails the same two; useTools back to
"mcp ticked" fails the third.
Real page, Playwright 1.62.0, 1200 and 760 wide: switch off by default
with the old tick, on makes every row checked and disabled, flipping it
and pressing Enter saves settings before /api/chat with useTools true,
still on after reload, off brings back the old tick, rows clickable.
Chromium on mote, 18 of 18; WebKit on Linux (WSL magpie-desktop), 18 of
18, since WebKit on mote didn't launch within 180s (other sessions'
WebKit processes were running there).

Not tried: a real magpie window with real MCP servers and a real model
call (the gateway in the browser run was absent; tool lists came from
fakes); stdio servers under the switch (same pick, only http was run);
macOS WebKit; languages other than Chinese (the page has no i18n).
2026-10-31 12:25:16 +08:00
yetone 3d56e7e4d6 kiro 0.1.23: an effort without thinking asked for is sent no thinking (#538)
thinking() turned thinking on for any output_config.effort above low,
even when the request had no thinking object or had thinking disabled.
Claude Code's title and side requests carry an effort and no thinking,
and a turn with thinking turned off says disabled, so Kiro was sent a
<max_thinking_length> budget for them, or, for a model whose catalog lists
effort fields, adaptive thinking at that level. Low alone was spared.
Now only thinking.type enabled or adaptive asks for thinking, as
Anthropic's API and magpie's gateway (anthropic.go) read a request.

With thinking on, nothing changes: each of low, medium, high, xhigh and
max goes as additionalModelRequestFields {thinking: adaptive,
output_config: {effort}} when the model's schema lists it, else as the
10k/20k/30k/50k/50k budget.

Run: HOME=$(mktemp -d) bun test in packages/kiro on mote: 118 pass.
bun scripts/check.mjs: ok. Broken by hand: with index.mjs at HEAD~,
the new "an effort without thinking asked for" test fails, the
per-level test passes. A probe built the body for every level x
{adaptive, enabled, none, disabled} x {schema, no schema}.
Not tried: a live Kiro account whose catalog lists effort levels.
2026-10-31 10:32:35 +08:00
MagiczerowxyandMagiczerowxy 0b463793be page-chat 0.1.5: README names the settings.json gateway port (#542)
page-chat 0.1.5 documents the gateway port it now reads from magpie's settings.json (#534's follow-up).

The README order now matches chat's code at 20a3898: MAGPIE_CHAT_GATEWAY, then MAGPIE_ADDR, then settings.json's port, then 127.0.0.1:3425. settings.json is listed as read for fonts and the port.

Run: read the diff against packages/chat's gateway lookup at 20a3898. It is docs plus the version bump; no code changed, so no tests were run.

Co-authored-by: Magiczerowxy <Magiczerowxy@users.noreply.github.com>
2026-10-31 10:28:19 +08:00
Magiczerowxy 20a3898bf5 page-chat 0.1.4: model brand icons, data-URI images only (a remote image is a link), gateway port from magpie's settings.json, by Magic_zero (#534)
page-chat 0.1.4, by Magic_zero (Magiczerowxy). This adds:
- model brand icons in the picker and the transcript, from @lobehub/icons (MIT, chat/icons/models/NOTICE);
- inline images, base64 data URIs only. A remote ![](https://…) image is shown as a link the user can click and is never fetched, so a reply can't send data off the machine through an image URL;
- the gateway port read from magpie's settings.json, read-only and 127.0.0.1 only, after an explicit gateway or MAGPIE_ADDR;
- a switch for the system prompt;
- stdio MCP servers run in a workspace folder of their own;
- code fences kept whole while a reply streams.

The suggestion buttons and the 「模型」 label are gone from the empty state. finish() still renders a reply that arrives in one chunk (the fix from #498).

Run at the reviewed head 8ded766, on the Mac mini (Bun 1.4.2, sandbox HOME):
- bun test: 3871 pass, 0 fail, 9 skip. bun scripts/check.mjs: exit 0.
- A Playwright probe ran the real service against a fake gateway that sends the reply in one SSE chunk, and recorded every request leaving 127.0.0.1. The reply carried md, http, protocol-relative and blob images, HTML img, srcset, picture, inline style url(), a <style> block, a link around an image, a reference-style image, a bare URL, KaTeX \includegraphics and \href, and a data:image/svg+xml with script, onload, <image href> and CSS url(); the probe also opened that SVG in the lightbox. No request left the machine and the reply rendered. Run in Chromium on the Mac mini, and in Chromium and WebKit on Linux (magpie-desktop). WebKit didn't launch on the loaded Mac mini.
- Broken by hand: letting https images through safeImgSrc turns "the chat UI never auto-loads a remote image" red, and the probe records the request to attacker.example. finish() back to checking only .md-stable turns "finish() renders a reply that arrived in one chunk" red, and the probe shows an empty body.

Not tried: the real magpie window, and a portable install's data/settings.json.
2026-10-31 10:10:30 +08:00
yetone 659967c9bc agent-office 0.1.1: an agent another agent killed is stopped, and any agent not at work can be cleared
flying_crp (X, 2026-10-31): when one agent hands work to another and then
interrupts it from the command line, the delegated session hangs in the
Agent Office as abnormal and can't be cleaned up; it only goes once the
session is deleted in magpie.

The cause: a killed agent writes no end of turn. Reproduced in a sandbox
HOME with the real CLIs:
- Codex 0.165 under SIGTERM or SIGKILL: the rollout ends at the
  function_call (on SIGINT it writes turn_aborted, which was fine).
- Claude Code 2.1.314 `claude -p` under SIGTERM: a tool_result
  ("Exit code 137") and no end_turn, and it removes its
  sessions/<pid>.json. Under SIGKILL: the file ends at tool_use, and the
  pid file stays with a dead pid.
The office read each file as at work, then "error · stuck" once quiet for
ten minutes, until hideAfter (6h, or never; a waiting session never
leaves). The page had no way to take one out.

The fix:
- lib/scan.mjs: for a source with a process folder (Claude Code's
  <config>/sessions, also Qoder, WorkBuddy and CodeBuddy), a session
  quiet mid-turn for 10s with no live process named in that folder is
  read as aborted ("stopped"). A folder that can't be read, a
  half-written file, or one that has never held a pid file means
  unknown, and nothing changes. A pid file from another pidDomain (WSL)
  counts as alive.
- page: Clear (清除) in the panel of any agent not at work (stuck,
  error, stopped, done, waiting) hides it until its session moves again.
  It is kept in the page's options as {key: at}, pruned to sessions
  live.js still has. This covers Codex and every agent with no process
  registry.

Run:
- On mote (mote-run): bun test in packages/agent-office gives 54 pass,
  0 fail. bun scripts/check.mjs exits 0.
- killed.test.mjs uses the real killed files (test/killed, trimmed and
  with paths replaced). With the old scan.mjs, 3 tests fail. With the old
  model.js, 2 fail.
- End to end: the real office.hooks.mjs over a sandbox HOME holding the
  killed Claude and Codex files and a live lead pid file. live.js had
  claude "aborted" and codex "tool". Then the real page in list mode, zh,
  at widths 1100 and 420: the Codex row shows 已 N 分 没有动静, its
  panel shows 清除, clicking it removes the row, and options.set gets
  cleared. Chromium ran on mote. WebKit ran on the Linux box (wsl-run),
  because WebKit on mote didn't launch within 180s while ~108 WebKit
  processes from other sessions were running. Screenshots were checked
  at both widths.

Not tried:
- A Codex liveness signal: its thread-writer-locks are flock-only files,
  which Node can't check. Codex relies on Clear.
- Windows: the pidDomain value and process.kill(pid, 0) there.
- Whether Qoder, WorkBuddy or CodeBuddy write pid files at all. Without
  them, nothing changes for those agents.
- Gemini, Qwen, dsh and pi killed mid-turn: they have no registry and
  rely on Clear.
- The page inside the real magpie window, and WebKitGTK.
2026-10-31 09:52:19 +08:00
yetone d0d07168ef workbuddy 0.2.6: an empty tool_calls list is no call, so the filter's refusal is still caught (#540)
itspig (#540, 2026-10-31) ran magpie v0.1.2283 with workbuddy 0.2.5 on
the live account, through a [workbuddy, volcengine] group: the refusal
still reached the client and routing.jsonl had the workbuddy try
done/200 with firstText 3208, no try of volcengine.

The cause: copilot.tencent.com puts "tool_calls": [] on every delta, text
too (magpie f2c7536d7 recorded it for Qoder). unsaid let the reply
through at the first delta whose tool_calls was truthy, and [] is truthy
in JS, so the gate opened at the reasoning chunk and nothing was held or
taken out. itspig's paste had no tool_calls because it was read off
magpie after chatTidy dropped the empty list and Go re-wrote the chunk
with its keys sorted; 0.2.5's fixture was built from that paste.

unsaid now counts a tool_calls list only when it holds a call.

Run (on mote, mote-run):
- HOME=$(mktemp -d) bun test packages/workbuddy: 291 pass, 0 fail.
- bun scripts/check.mjs: exit 0.
- filtered.test.mjs: the paste's chunks with WorkBuddy's own framing
  ("tool_calls": [], "finish_reason": "" until the last, an empty
  reasoning_content beside the line) cut every 1, 7 and 1MiB bytes; the
  line split over deltas that each carry the empty list; a real call
  still lets the reply through as it came.
- End to end, in magpie's plugin host (a magpie worktree's gateway test,
  not committed there): this file loaded by the host behind a fetch
  shim pointing copilot.tencent.com at a fake vendor, signed in with an
  API key, in a group [workbuddy-plugin/deepseek-v4.1-flash, b/m], asked
  as a streamed chat, a one-body chat, Messages (Claude Code's ask) and
  Responses (Codex's ask). With 0.2.6, 8 of 8 hand on to b and say no
  "Sorry", for the paste and for the wire framing.

Broken by hand:
- 0.2.5 (b5cc782): the 4 new wire-framing tests go red; end to end the
  wire framing goes red on chat, Messages and Responses (b never asked,
  "Sorry" in the reply), the paste stays green, as itspig saw.

Not tried: a live WorkBuddy account; the trigger prompt was not run.
2026-10-31 08:36:42 +08:00
yetone b5cc78266f workbuddy 0.2.5: the filter's line is taken out with the newlines around it (#540)
itspig (#540, 2026-10-30) ran 0.2.4 against copilot.tencent.com and the
refusal still reached the agent. The real chunk's content is
"\nSorry, I can't respond to this question.\n" with finish_reason
content_filter. filterSaid trimmed only the start, so the trailing "\n"
made the text longer than FILTER_SAYS, the prefix test failed, and the
chunk went out as an ordinary answer.

filterSaid now trims both sides, and text that is only white space so
far may still be the line (so a "\n" sent in a chunk of its own is held,
not passed on). The reporter's suggested `t.startsWith(s)` is not taken:
it would treat the line followed by real words as the filter's and drop
those words at content_filter. `without` already removes the whole
content field, so the newlines go with it.

Run (on mote, mote-run):
- HOME=$(mktemp -d) bun test packages/workbuddy: 286 pass, 0 fail.
- bun scripts/check.mjs: ok.
- filtered.test.mjs has itspig's literal last three SSE events (the
  " node" reasoning chunk, the refusal chunk, [DONE]), cut every 1, 7
  and 1MiB bytes, plus newline-in-its-own-chunk, line-then-more-words
  and newline-then-answer cases.

Broken by hand:
- 0.2.4's trimStart filterSaid: the 3 literal-bytes tests and the
  own-chunk newline test go red (4 of 15).
- The reporter's trim() + t.startsWith(s) with t !== "": the own-chunk
  newline and line-then-more-words tests go red (2 of 15).

Not tried: a live WorkBuddy account; the trigger prompt was not run.
2026-10-31 07:11:51 +08:00
yetone 4883f9437f workbuddy 0.2.4: the filter's canned line is taken out of a reply it ends content_filter (#540)
itspig (#540): deepseek-v4.1-flash on copilot.tencent.com, through a
group, reasoned, said "Sorry, I can't respond to this question.", and
ended finish_reason content_filter with 0 output tokens, all under a
200. magpie recorded the try done/200, never asked the group's next
member, and DeepSeek Harness failed "The model refused to complete the
request".

unsaid() now reads a streamed chat's events: text that is still the
filter's line (FILTER_SAYS, the issue's literal words) is held; when the
reply ends content_filter with nothing else said, that text is taken out,
so magpie sees reasoning then content_filter with nothing said, which it
hands on (magpie holds DeepSeek's reasoning for that from its next
release). Any other text goes as it comes, released at its first word that
isn't the filter's; the same words ending stop, and a reply the filter
cuts off after other words, go through byte for byte. Native (Messages)
requests are not touched.

Run on mote at this tree: HOME=$(mktemp -d) bun test: 3970 pass, 9 skip,
0 fail; bun scripts/check.mjs: every package ok. Broken by hand: without
unsaid() in the chat path, the 5 refusal cases of filtered.test.mjs go red
and the 4 pass-through cases stay green.

Not tried: a real WorkBuddy refusal (I have no prompt that reproduces
it); the stream's literal chunking is not in the issue, so the tests cut
the line into one delta, three deltas, the finish chunk itself, and 7-byte
writes. Only the English line from the issue is known; a Chinese variant
would pass through as before.
2026-10-31 05:56:05 +08:00
yetone 00de68a0f8 cursor 0.2.33: free credit (the plan's bonus and credit grants) on the card, with its limits
CryptoSarom on X (2116260605053321489): "magpie 似乎没法支持 cursor 的赠金读取,
以及赠金使用限制". The card read only the included pools and on-demand.

What Cursor exposes, as Cursor 3.x's IDE (workbench.desktop.main.js) and
cursor-agent 2026.10.01's schemas have it:
- GetCurrentPeriodUsage planUsage.bonusSpend (cents), remainingBonus (bool,
  no amount) and bonusTooltip: the IDE's "+$X free usage on us" line.
- DashboardService/GetUsageLimitStatusAndActiveGrants activeGrants
  (aiserver.v1.ActiveCreditGrant): totalCents, remainingCents, expiresAtMs,
  allowedModelIds / allowedModelTags / allowedModelSelections (models it
  may be spent on), allowedClientTypes ("glass" without "ide" is the IDE's
  Cloud Agent credits), campaignName. The IDE's "Use your $X free credits"
  banner reads it; it matches tags lower case with "-" as ".".

The card now shows Free usage (bonus spent, "more left" when
remainingBonus) and a window per grant (spent / total USD, runsOutAt and
runsOut at its expiry, models when limited, "(Cloud Agents only)" when
cursor-agent can't spend it). All are aside. Routing: a bonus with some
left, or a grant magpie can spend on every model, sets the spent pools
aside as on-demand does; a model-limited grant leaves its models out of
a spent pool (Cursor Models keeps a non-empty list, or goes aside). With
Included usage only on, none of this keeps an account served. A grants
read that fails leaves the card as before.

Run on mote at this tree: HOME=$(mktemp -d) bun test: 3960 pass, 9 skip,
1 fail (a test of my own, since fixed); then credit/usage/included-only
79 pass 0 fail; bun scripts/check.mjs cursor ok. Broken by hand: the new
credit.test.mjs against the old index.mjs, 9 of 9 red.
Real account (Premium, merged weekly, cursor-agent's sign-in, read only):
GetCurrentPeriodUsage, GetUsageLimitStatusAndActiveGrants,
GetCreditGrantsBalance, GetClientVisibleCreditGrants read; it has no bonus
and no grant, and the new plugin's card for it is unchanged (Weekly, Grok
Bot, On-demand). Those replies are credit.test.mjs's REAL_ fixtures; the
#1868 team account's real bonusSpend 14151 now shows "+$141.51 on us".
Not tried: a real account with a grant or remainingBonus true (none at
hand), so the grant fixtures follow the schema, and whether Cursor
really serves a spent pool on bonus is Cursor's word ("free usage beyond
what you've purchased"), not a request made past a spent pool.
2026-10-31 04:46:49 +08:00
MYCF711 f42a59adf5 codearts: an OfficeAce card for the same Huawei Cloud account (#522)
codearts: an OfficeAce card for the same Huawei Cloud account (#522, MYCF711)

Adds the OfficeAce (AgentArts) provider to the codearts package, replacing
officeace-auth; accounts signed in there keep working. Each card signs in on
its own and holds its own record and refresh token, because a Huawei Cloud
STS refresh token is spent once. A renewal writes only the record being
renewed, so a removed account never comes back.

Reviewed over eight rounds; reviewed head f7c2526. r8 is words only plus the
writeSharedRecord -> writeProviderRecord rename (every caller and the test
updated).

Run at f7c2526 on mote: node --test packages/codearts/index.test.mjs
164/164 pass; bun scripts/check.mjs exit 0, codearts ok.
Not tried: a real Huawei Cloud sign-in on either card.
2026-10-31 02:29:36 +08:00
KaranocaVe 00f4d84b8f fingerprint 0.1.0: a page that checks whether a model answers like the one it claims to be (#516)
Adds the Fingerprint page plugin (packages/fingerprint): it checks whether a model behind the local magpie gateway answers like the model it claims to be.

Reviewed at 531ca11f4 (KaranocaVe). Run at that head merged with main 848497c, through mote-run on the Mac mini with Bun 1.4.2:
- bun run rebuild from the committed bun.lock (frozen, --ignore-scripts): typecheck, 30/30 tests, build; diff -r against the committed dist/ is empty.
- HOME=$(mktemp -d) bun test: 3838 pass, 0 fail. bun scripts/check.mjs: exit 0.
- Offline preload refusing every non-loopback fetch/socket: 30/30, nothing refused.
- Broken by hand, each red: ensureDetector() in bootstrap, dropping ttl: Infinity, validating the job after the download.

Maintainer decision: the reference data comes from two third-party hosts (lm.ikale.io, cdn.jsdmirror.com), only on an explicit Download or a valid job, and both are named on the page, in registry.json and the READMEs. It is data used locally to rank candidates and is sent nowhere; the @latest fallback has no pinned hash, so a bad snapshot would rank wrongly, which the page states.

Not on npm yet (E404): magpie installs it from the dist branch until an owner publishes the first version.
2026-10-31 02:00:33 +08:00
yetone 9d4c7ce558 kiro: xhigh and max go as Kiro's own effort levels; trailing system context goes before the question (#538)
Two problems from #538 (zengxiaosong):

1. xhigh and max both became a 50000 <max_thinking_length> budget. The
   plugin now reads each model's additionalModelRequestFieldsSchema from
   ListAvailableModels, as Kiro IDE 1.4.62 does: when the schema offers
   thinking.type "adaptive" and an effort enum under output_config (or
   reasoning), a level in that enum is sent as
   additionalModelRequestFields {thinking:{type:"adaptive"},
   output_config:{effort}} and the XML budget is left out. A model with
   no such schema (every model on a Free account today: the schema is
   null), a level not in the enum, or thinking off, is sent as before.

2. System messages ending the conversation (Claude Code's environment
   context) were joined into the question. They now go as a user turn
   before the question, answered by "Understood." (Kiro IDE's placeholder
   for a missing assistant turn), and the question is the current
   message. Not moved when the question holds tool results or follows
   tool calls, so call/result pairs are unchanged. systemPrompt is not
   used: the reporter's account refuses it.

Run (on mote, bun 1.4.2):
- bun test packages/kiro: 115 pass.
- Full suite as CI, HOME=$(mktemp -d) bun test: 3885 pass, 0 fail;
  bun scripts/check.mjs: ok.
Broken by hand:
- nativeFields never finding a model: the two schema tests go red.
- contextFirst returning messages as given: the reporter's [user,
  system] test and the later-question test go red.
- The new tests on origin/main's index.mjs: 6 fail (in part only because
  the new exports are missing there).
Not tried: a real Kiro account whose catalog has a non-null schema. The
only account here is Free, whose ListAvailableModels gives null for every
model, so the schema shape is from Kiro IDE 1.4.62's source, and the
fixture follows it.
2026-10-31 01:13:32 +08:00
IceCodeNew c38a364e6a nowledge-mem 0.1.1: return from the connection test page, by IceCodeNew (#537)
The connection test page no longer depends on window.name, which the app's frame navigation drops. The language travels as `/test?lang=xx` and the page always shows Back to settings, which calls history.back() in the frame. The page takes no return address. Host (loopback:<port>), the per-process token and Origin null/self are unchanged in handle(). 0.1.1: package.json and mem.mjs's User-Agent version were bumped together.

Reviewed at 390130262eaaff2bf4bfd16b3483626c0c730d7c (every changed line in packages/nowledge-mem).

Run at that head:
- mote: `HOME=$(mktemp -d) bun test packages/nowledge-mem`: 53 pass, 1 skip (live), 0 fail. `bun scripts/check.mjs`: exit 0.
- Broken by hand: dropping `history.back()` from the test page turned "the running service answers 403 ..." red. Dropping the `lang` query from settings.js turned "configuration page saves the Mem connection ..." red. Both passed again once restored.
- Browser harness: a window frames the real page/settings.html under magpie's plugin-page CSP in an `<iframe sandbox="allow-scripts">` and runs the package's real service. Chromium ran on mote and WebKit on the Linux VM, because WebKit launches time out on mote right now. In both engines: Test connection opened /test?lang=zh, Back read 返回设置, and Back returned the frame to settings.html while the top window stayed at its own URL (it had a pushState entry before). The settings page was usable again afterwards. `lang` set to `"><img onerror>`, `__proto__` and `constructor` injected nothing. `lang` is only used as a key into a fixed table, and the label is set through textContent.

Not tried: the real magpie app (its bridge.js was stubbed) and a real Nowledge Mem server. Nit, not blocking: `?lang=__proto__` or `?lang=constructor` gives empty button labels, because the lookup isn't Object.hasOwn. Only a hand-typed URL can do this.

npm: @magpie-community/gateway-nowledge-mem has never been on npm. Its first version needs an owner (trusted publishing can't create a package), so magpie installs it from dist.
2026-10-31 01:08:33 +08:00
yetone 28881086c5 zcode: the daily claim is tested on #503's real marketing/touch reply
kongbai01203 posted the real GET /api/v1/marketing/touch?seq=0 reply
(10-30 22:11 +08:00, comment 6526694290) for the account that claimed
ZCODE WEEKEND BUILD. It is in packages/zcode/testdata/touch-1030-wk.json
as their bytes. Their paste was cut inside
success_popup.description.content's HTML (2510 of 2628 characters), so
only the closing `"}}}}]}}` is added and their trailing "…" taken off.

0.1.39's parser handles it as it is; no change to index.mjs, no version
bump (the package's published files are unchanged):
- checkin: the one claim_zcode_plan button is claimed once with
  {"plan_id":"zcode-v3-start-plan-1030-wk"}, named ZCODE WEEKEND BUILD;
  the close button ("args": null) and the success popup's navigate and
  copy_text buttons claim nothing, and nothing goes to touch/action.
- the same delivery with its claim button taken out is inactive, though
  its background and success popup still carry the zcode_plan.
- after the claim, deliveries is empty (their second finding, count
  theirs, bytes the real reply's top level): inactive, not failed.
- the card's claim line from the real feed: "1 · ZCODE WEEKEND BUILD".

What the real reply has that the 0.1.39 hand-made fixture didn't:
button text as {format, content}, a close button's args null, a bundle
background, resource_position and priority, and a success_popup inside
the banner repeating the zcode_plan.

Run on mote: HOME=$(mktemp -d) bun test (3880 pass, 0 fail) and bun
scripts/check.mjs (exit 0). Broken by hand: claiming a zcode_plan's
plan_id with no claim button turns "the real delivery without its claim
button" red (the hand-made closeOnly case stayed green); naming a plan
from a later zcode_plan when the first is the same turned the two
real-feed tests red. Not tried: a complete, uncut touch reply (the
reporter will post one at the next window), and a real claim through
the plugin.
2026-10-31 00:05:27 +08:00
yetone 2e580cfead zcode 0.1.39: gift plans are also claimed from the ZCode app's banner feed (#503)
kongbai01203 found on 10-30 that a ZCode claim banner's plan (ZCODE
WEEKEND BUILD, 500M GLM-5.3-Flash tokens) is in neither
/billing/preview nor /billing/current while the app shows the banner,
so 0.1.35's daily claim said "no ZCode gift plan to claim". The app
reads the banner from GET /api/v1/marketing/touch?seq=<n>: each
delivery's banner button with action type claim_zcode_plan carries the
plan_id, and the claim is the same POST /billing/claim. Their capture
has a real code 0 claim reply ("Plan claimed successfully.").

- toClaim reads both lists (the feed first, then the preview) and keeps
  each plan_id once; claimDaily and the card's claim line use it.
- The feed goes out with what the capture shows the app sends: the
  session, X-Device-Mid, X-ZCode-App-Version and X-Client-Language
  (the system locale), seq counting up from 0 per process.
- A list that doesn't read is failed (asked again later), never
  "nothing to claim"; a plan claimed beside it is still named.
- claimOne is unchanged; README says the two lists and that a plan just
  claimed may show in neither billing list until its effective_at.

Run on mote (macOS, Bun 1.4.2, temp HOME), on eee889a:
- packages/zcode `bun test`: 178 pass 0 fail.
- Red on the old index.mjs (origin/main's, with the new tests): 3 fail
  (the banner claimed from the feed, an unreadable feed is failed, the
  banner named on the card).
- Broken by hand: claiming each plan per list (no dedupe) and dropping
  the "list unread with nothing listed" return: 3 fail (plan both lists
  name claimed once, unreadable feed, unreadable preview).
- Full `HOME=$(mktemp -d) bun test` from the root: first run 3870 pass
  1 fail, its name lost (the log was cut by tail); two reruns with the
  whole log kept: 3871 pass 0 fail. `bun scripts/check.mjs`: ok.

Not tried: a real claim through the plugin. The feed fixture is built
from the capture's description of its fields, not its literal bytes
(only the claim reply was posted whole); the touch/action call the app
makes for a banner's confirm/close is not sent.
2026-10-30 23:08:10 +08:00
MYCF711 b177d69b83 loomy: a too-long refusal is reworded so magpie tries a longer window (#529)
When Loomy answers 400, 413 or 422 with a body that says the content is too long (内容太长了 / 内容过长), the plugin now rewords that body to 上下文超出长度限制, the phrase magpie's too-long matcher recognises. The status code is kept. magpie then treats the reply as a context-length refusal and tries a model with a longer window, where before it gave up on the request. The rewrite is in retryableRefusal() and runs on the loader's !res.ok path. fake.mjs gains chatRefusal. Version 0.1.0 -> 0.1.1.

Reviewed at 2bb41e0 (Mac mini, Bun 1.4.2, through mote-run, sandbox HOME):
- Repo suite (`HOME=$(mktemp -d) bun test`): 3813 pass, 8 skip, 0 fail.
- `bun scripts/check.mjs`: exit 0.
- Broken by hand: with retryableRefusal returning null, 3 loomy tests go red (the over-length Kimi-k2.6 chat test, the 400 rewrite, and the 413/422 cases). They pass again once it is restored.
2026-10-30 23:06:49 +08:00
yetone eee889afab devin 0.1.27: SWE-2 never goes as a paid -lightning variant or a bare family id, and an unreadable model list is said, not swallowed
zws13579 (magpie Discord #general, devin 0.1.26): a Devin Free plan
account ($0) can't use SWE-2 through the plugin, while Devin CLI/Desktop
can. They listed five places SWE-2 could be lost silently; checked each
against the code:

1. configsFor swallowed every error (real). Its reason is now kept
   (c.error), logged once to stderr when the asks start failing (the host
   routes it to magpie's log), and usage adds an aside row "Free models:
   unknown: Devin's model list couldn't be read (<reason>)" when a quota
   window exists and Devin has never answered for the account. The windows
   still count every model then (a failed read means unknown).
2. notModels only rides on a window (as designed: with no window nothing
   counts SWE-2). A plan with no quota window gives none and no error;
   a test holds that. The real gap behind it was 1, now visible.
3. A family the account's list leaves out (picked from SNAPSHOT's list,
   which the OpenCode config offers) went to Devin as the bare family id
   ("swe-2"). variantFor now falls back to SNAPSHOT's family, so it goes
   as swe-2-high (swe-2-max at max). The listing is unchanged: no model
   is added that the account's list doesn't have.
4. variantFor's effort-less default and listed()'s free check took
   f.models[0]. Devin's captures (10-14, 10-15) list swe-2-high first, so
   it isn't hit today, but a first -lightning variant (High cost tier)
   would have sent effort-less SWE-2 to a paid variant and unmarked it
   free. defaultModel skips such suffixed variants.
5. v2Models/v2Setup: not a magpie path. magpie's host loads server()
   (DevinAuthPlugin), whose usage hook carries notModels; OpenCode 2 has
   no usage hook, and a free model's cost there is already 0.

usage.test.mjs's stub answered GetCliModelConfigs with a JSON parse
error, so those tests ran with the model list unreadable; it now serves
a one-model list, so they test what they name.

Run (mote, from the repo root, as CI): HOME=$(mktemp -d) bun test:
3866 pass, 9 skip, 0 fail; bun scripts/check.mjs: every package ok.
Broken by hand: the new free.test.mjs against origin/main's index.mjs:
3 red (lightning default "swe-2-medium-lightning", bare "swe-2", no
"Free models" row), 6 green.

Not tried: a real Devin Free plan account. No Free plan GetUserStatus or
GetCliModelConfigs has been captured, so whether Devin gives a Free
account SWE-2 at the Free cost tier (its pricing lists free SWE-2 for
Pro) is unknown; nothing here assumes a shape for it.
2026-10-30 22:08:48 +08:00
Gyl1219 1acaf4964c registry: add magpie-providers-hub (community, 5 providers) (#502)
Adds magpie-providers-hub (Gyl1219, third-party adapter of dsh-providers-hub) to registry.json as a community entry: hub-astudio, hub-accio, hub-lobsterai, hub-magicrew, hub-magicrew-intl. All five are the vendors' own products (iFlytek, Alibaba, Youdao, MagiCrew); no relays.

Checked at reviewed head f7685c8:
- npm 0.5.1 (latest dist-tag) tarball fetched into an empty dir, nothing run from it: shasum baafab667248930ef67e19dadd289414728965d5, 16 files. page/snapshot.js is the empty template; no AK-like strings, balances or channel data. Hosts are only the vendors' own domains and 127.0.0.1.
- gitHead 8fe0abc exists in Gyl1219/magpie-providers-hub. Diff 0.5.0 -> 0.5.1: explicit files list, empty snapshot, buildSnapshot reuses a snapshot only when its runId is this process's.
- On mote: HOME=$(mktemp -d) bun test: 3808 pass, 8 skip, 0 fail. bun scripts/check.mjs: passed.

Not done: 0.5.0 and 0.4.7 are not deprecated yet (author's npm account blocked until 11-02).
2026-10-30 22:03:36 +08:00
IceCodeNew c5dc2e691c nowledge-mem 0.1.0: recall and opt-in capture from your Nowledge Mem, by IceCodeNew (#526)
Adds @magpie-community/gateway-nowledge-mem, an asynchronous gateway hook by
IceCodeNew (#526): before each request it recalls from the user's Nowledge
Mem (and the Context Bundle / Working Memory on a session's first turn), and,
only when `capture` is turned on, imports completed conversations as Mem
Threads. It applies to direct local requests and the `magpie-key` sharing
key this computer writes into the user's own agents; other gateway keys,
remote and unknown origins are never included. A page sets the connection
and runs a real connection test through a loopback service guarded by Host,
Origin and a per-start token. The package writes nothing into magpie's
Library. registry.json gains one compact entry.

Reviewed head 3f4ba91 (f9eb686 plus a maintainer commit adding a test that
starts the service and expects 403 for a foreign Host, Origin and token).
Run at 3f4ba91's tree on mote (macOS, Bun 1.4.2, HOME=$(mktemp -d)):
repo `bun test` 3861 pass, 9 skip, 0 fail; `bun scripts/check.mjs` exit 0;
packages/nowledge-mem 53 pass, 1 skip.
Broken by hand: each of the service's four guards in handle() turns the new
test red; earlier rounds broke the origin gate, the block escaping, the
secret check and the cleartext-HTTP guard, each red.
Not tried: a real Mem server, a real magpie with the plugin installed,
Windows.

Co-authored-by: IceCodeNew <32576256+IceCodeNew@users.noreply.github.com>
2026-10-30 21:37:55 +08:00
Yuchen 5b4ef414e2 registry: PinK agent plugin (magpie-plugin-pink) (#514)
Lists PinK (magpie-plugin-pink, YuchenWell, MIT) as an Agent plugin. Only registry.json changes: one entry, unpinned, so magpie installs npm's newest version (0.1.1).

Reviewed at 78185d2 (the reviewed head):
- magpie-plugin-pink@0.1.1 from registry.npmjs.org: its sha512 matches dist.integrity. The dist diff against 0.1.0 is only the worker lifecycle fix (worker.mjs exits when its host's pid is gone; index.mjs refreshes launch.json before it spawns). There is no network call, no install script and no encoded code.
- Harness on macOS (sandbox HOME, mock PinK folder, network refused). Connect, switch and disconnect restore the files byte for byte. The worker exits within 1 s of its host, plugin on. On 0.1.0 it was still alive after 5 s. A second host spawns a new worker. A worker stays alive under host A after a short-lived host B leaves. No stray worker is left.
- The repo suite on a local merge with main 848497c: HOME=$(mktemp -d) bun test 3808 pass, 8 skip, 0 fail. check.mjs: only cloudflare-workers-ai is red, the known #519 offline.
- Not tried: real PinK chat, and a run inside a real magpie app.
2026-10-30 19:45:52 +08:00
狂気のMad Scientist鳳凰院胸針 848497c40b orcaterm 0.1.1: QR sign-in null fields, OAuth quota, stable account identity (#510)
orcaterm 0.1.1 (hg1048596-pixel):
- WeChat QR sign-in accepts the official bridge's null fields.
- QR accounts read their AI quota through orcaterm.com's product API, with the token sent as the ot_session cookie only to https://orcaterm.com/cgi/api and redirects refused.
- A QR re-sign-in reuses the same account, keyed by the stable OrcaTerm user id.
- The README (en and zh) lists every host and what each one receives.

Run at the reviewed head a9ab6853b (Mac mini, Bun 1.4.2): `bun test` in packages/orcaterm passed 101 of 101 with every non-loopback fetch and socket refused (none was attempted), and `bun scripts/check.mjs orcaterm` passed.

Broken by hand at fa028746c, the last code change, each going red: the /cb null check, accountId on the QR result, and redirect: "error".
2026-10-30 19:39:18 +08:00
unisong c590a74057 codex-history 0.1.2: a group or fallback try is filtered with the tried provider's rule (#525)
A request through a Magpie group or fallback names the group, so 0.1.1's
onRequest found no provider rule and sent old reasoning, ciphertext and item
IDs to members whose filter was on. onProvider now filters each provider try
with the tried provider's rule (`magpie:<ctx.provider.id>`, through aliases).
A direct provider/model request filtered in onRequest is marked in
ctx.state.historyFiltered and its tries pass it on. A try with no rule, a rule
off, another protocol, the compact path or history that can't move is
returned unchanged (onProvider can't reject). cases.json gains 10 synthetic
provider-try cases in the shared scripts/middleware.mjs format (no real data).

Run at the reviewed head c50f542 (on mote):
- `HOME=$(mktemp -d) bun test`: 3776 pass, 8 skip, 0 fail.
- `bun scripts/check.mjs`: exit 0.
- PR's tests against the 0.1.1 middleware: 8 fail (the group/fallback cases
  and the export check), 34 pass.
- Probes in magpie's own engine (moejs, origin/main 3bce283df,
  internal/middleware Run.Request + Run.Tried, not committed): a group with a
  filtered, an unfiltered, a rule-off member, a retry on the filtered one and
  a member with another include rule: each try filtered by its own rule, the
  retry byte-identical to the first, unfiltered tries byte-identical to the
  request. A direct request: filtered once in onRequest, its try, a retry and
  a fallback to another provider sent what onRequest left. ctx.state doesn't
  reach the next request. Red on 0.1.1 (group), red with the
  historyFiltered guard removed (fallback re-filtered) and red with
  onProvider setting the flag (retry unfiltered).
- PROVENANCE: the shipped files' sha256 match unisong/magpie-codex-history-filter
  at 43e0b5c, which is on its main.

Not tried: a real Magpie with real providers; a group whose members speak
different protocols.
2026-10-30 18:46:55 +08:00
yetone 254c3e7aef grok 0.2.3: Codex's output.encrypted_content is left out of include (#524)
Codex asks an OpenAI-named provider for output token replay with
include ["reasoning.encrypted_content", "output.encrypted_content"]
(codex-rs/core/src/client.rs). Grok answers 400 'Argument not
supported: "output.encrypted_content" in "include" field'. rewrite()
now drops that one value (and include when nothing is left), and its
pre-filter also opens a body that names it, so an include-only body is
no longer passed through untouched. reasoning.encrypted_content and the
tool-output values xAI's docs list stay; store is not touched (Grok
takes it).

Tests: packages/grok/include.test.mjs, from the reporter's two bodies
and Codex's include. Red on the old index.mjs (4 of 5; the 5th checks
that accepted values stay). Broken by hand: without the pre-filter
change the include-only case is red.
Run on mote: HOME=$(mktemp -d) bun test (3782 pass, 0 fail) and
bun scripts/check.mjs (exit 0).
Not tried: a real Grok account; no Codex turn sent through Grok.
Sealed copies an OpenAI model wrote earlier in a thread (encrypted_content
on a message) are not stripped here; magpie's forVendor takes those out
before a non-OpenAI provider.
2026-10-30 18:45:39 +08:00
MYCF711andMYCF711 3968cdd75f workbuddy 0.2.3: a refused opening is said with a comma first, and remembered (#513)
A chat WorkBuddy refuses as an unapproved channel (11128) for an opening FLAGGED
doesn't know is sent once more with one more comma in the opening ("You are an
AI agent, powered by X.") before the system prompt is moved into the first user
message. The comma is set in system and assistant messages only; user messages
and tool results go out as written. A system prompt whose comma passed is
remembered (bounded at 256, like refusedSystems) and its next chats go with the
comma before the first send, so a tool loop is not refused on every step. A
refusal that stands names REFUSED.md (new) before the hint; that address is
only in the error returned to the client, nothing sent upstream names magpie.
Version 0.2.3.

Run at the reviewed head cb8a026 on mote (macOS), temp HOME, outbound network
denied by sandbox-exec (localhost allowed):
- packages/workbuddy `bun test`: 271 pass, 0 fail.
- repo root `bun test`: 3774 pass, 1 fail (layerfs import-limit, fixed on main
  by 3dd0f44). cb8a026 merged with origin/main 4d8d031: 3777 pass, 0 fail.
- `bun scripts/check.mjs`: only cloudflare-workers-ai fails, with the network
  refused (#519); workbuddy ✓.
Broken by hand: no commaSystems.add -> remembered-comma test red; no pre-send
commaPausedOn -> same test red; role filter removed -> 5 tests red.
Not covered: dropping the roles.has("system") guard leaves every test green
(an assistant-only comma would be remembered). Not tried against
copilot.tencent.com in this review.

Co-authored-by: MYCF711 <MYCF711@users.noreply.github.com>
2026-10-30 18:15:12 +08:00
MYCF711 4d8d0310f9 codearts 0.2.6: an IAM internal id is never the account's display name (#518)
An account whose IAM phone read yields nothing no longer shows
iam::<domain>:user:<name>, the hw... account name, a urn:, a uuid or a bare
hex id as its card name. accountIdentityOf() walks the same candidates in the
same order and skips any that looks like an id; with none left the name is ""
and the host shows the provider's name. id/uid/accountId are unchanged (still
the URN, as #483 settled), so no account is renamed. The only reader of
.name is usage()'s `user` fallback.

Reviewed at d8583da plus the reviewer's version bump (0.2.5 -> 0.2.6) at
f77e5bb. Run on mote (macOS, Bun 1.4.2) at f77e5bb, from the repo root:
- HOME=$(mktemp -d) bun test: 3763 pass / 0 fail (3771 tests, 298 files)
- bun scripts/check.mjs: exit 0
Red on the old code: the PR's tests against main's index.mjs, 125 pass /
2 fail (both new tests).
Broken by hand: displayNameOf without the looksLikeIdentifier skip ->
"accountIdentityOf never makes an IAM id the account's name" red (126/1).
Not tried: a real CodeArts sign-in whose phone read fails.
2026-10-30 17:26:37 +08:00
yetone 3dd0f44c15 layerfs: the import-limit test uses a small limit, not 20,001 real files
The only red in `HOME=$(mktemp -d) bun test` at the root on mote (57f3f90)
was "item 3: an import over the file limit is refused, not swept in". It
timed out at 30s (34s) under the full suite. Run by itself it passes in
about 10s, which is the time to write 20,001 empty files. CI on ubuntu is
green. scanImportTree now takes { maxFiles } (the default is still
IMPORT_MAX_FILES), so the test checks 51 files against a limit of 50 and 51.
The test also pins the 20000 default.

Run on mote: layerfs.test.mjs 38 pass; scripts/check.mjs ok. The full
root suite at 57f3f90 had 3769 tests, 1 fail (this one). Broken by hand:
checkImportLimits compared against IMPORT_MAX_FILES again, and the test went
red. Not tried: running the old test under load again to watch it time out;
the full-suite log shows that.
No version bump: the default behaviour is unchanged.
2026-10-30 17:02:02 +08:00
liangmouse 57f3f90698 joycode 0.2.2: Responses efforts JoyCode refuses go as low, per measured model (#499)
On JoyCode's Responses models, an explicit reasoning effort that the backend refuses now goes as `low`. Which efforts are refused was measured per model on the live gateway on 2026-10-30. GPT-6 Astra and GPT-6.1 Sol refuse both `none` and `minimal`. GPT-6 Sol and GPT-5.6 Sol refuse `minimal` but accept `none`, which still goes as written. Unknown models, other protocols, and valid or missing efforts are unchanged. This answers the earlier review: every Responses model was probed, `minimal` is covered, and the full upstream errors with their supported values are in the PR.

Run at the reviewed head 3b654be, merged onto main 7673cd0, on mote (macOS, Bun 1.4.2, Node 22) with HOME=$(mktemp -d):
- packages/joycode `bun test`: 64 pass, 0 fail. `node --test`: 64 pass, 0 fail.
- `bun scripts/check.mjs joycode`: ok
- `npm pack --dry-run`: magpie-community-opencode-joycode-auth-0.2.2.tgz, 6 files
- Broken by hand: swapped `none` between GPT-6.1 Sol and GPT-6 Sol in the table, and both of their mapping tests went red (2 fail).
- Version: the dist branch has 0.2.1 and this PR ships 0.2.2. The package isn't on npm yet; magpie installs it from dist.

Not tried: a real JoyCode request, because the review has no JoyCode account. The eight live probes are the author's. Codex's original long-conversation compaction wasn't run again (the author says so too).
2026-10-30 14:30:56 +08:00
MYCF711 79b02cc568 workbuddy 0.2.2: DeepSeek Harness's opener keeps the harness's name (#511)
WorkBuddy refuses DeepSeek Harness's opener "You are an AI agent powered by DeepSeek Harness." as 11128 (#279). The plugin used to reword it into "You are an AI agent that helps the user with programming tasks.", which dropped the harness's name from the line the rest of a DSH prompt refers back to. It now adds one comma ("You are an AI agent, powered by DeepSeek Harness."), which the author measured passing WorkBuddy's whole-line check (400 11128 without the comma, 200 with it, copilot.tencent.com, 2026-10-30).

Run at the reviewed head 4830b16, merged onto main 7673cd0 (a fast-forward), on mote (macOS, Bun 1.4.2) with HOME=$(mktemp -d):
- packages/workbuddy `bun test`: 257 pass, 0 fail
- `bun scripts/check.mjs workbuddy`: ok
- `npm pack --dry-run`: magpie-community-opencode-workbuddy-auth-0.2.2.tgz, 3 files
- Broken by hand: put the old rewording back in index.mjs, and both unflag tests went red (2 fail).
- Real request: the comma line sent to workbuddy-ai/deepseek-v4.1-flash through a live magpie gateway (0.2.1, which leaves the comma line as written) came back 200, and the model answered "I'm running in the DeepSeek Harness."
- Version: npm has 0.2.1 and this PR ships 0.2.2.

Not tried: the China WorkBuddy site, because the review account's desktop sign-in answers 401 there. That 400/200 pair is the author's measurement.
2026-10-30 14:30:38 +08:00
Jinpyandjinpy666 5a9c776832 zcode 0.1.38: freeFirst, the plain model spends the account's gift first (#505)
freeFirst (a boolean plugin or provider option): a plain model request
spends the dual account's own live gift first, under the name the gift
lists, and falls back to the coding plan when the gift can't serve it.
Any gift failure (spent 1113/1005, block page, 4xx/5xx, its own
waited-out busy cap, a network throw) is replayed on the plan in the same
request with the plan's own busy patience; a caller's abort stays an
abort. -Trial entries keep their strict meaning. Off by default.
zcode 0.1.38.

Run at the reviewed head 7ae2ea15d (on main 7673cd0), on mote (macOS,
Bun 1.4.2, temp HOME): `bun test` in packages/zcode 173 pass 0 fail;
`bun scripts/check.mjs zcode` ok; `npm pack --dry-run` 4 files
(README.md, index.mjs, package.json, prompt.mjs) at 0.1.38.

Broken by hand: the gift's catch reduced to `throw e` turns "a gift that
cannot be asked at all is answered from the plan" red; the abort guard
reduced to `if (!freeGift) throw e` turns both abort tests red (2 fail);
the signal check alone removed turns the in-flight abort test red.
Reviewer probes (abort before/in flight, gift 3008 then throw, gift and
plan both throwing, freeFirst off) behave as intended.

Not tried: a real dual account against zcode.z.ai; every case here runs
against a fetch fake.

Co-authored-by: jinpy666 <5868671+jinpy666@users.noreply.github.com>
2026-10-30 14:27:16 +08:00
yetone 7673cd06de zcode 0.1.37: an account with no gift plan to claim is no check-in event, not a failed check-in
hykql (Discord, magpie v0.1.2143, zcode 0.1.36) saw every ZCode account's
daily check-in fail with "gift plans to claim: no plan list in the reply",
a Start Plan account and one with no GLM Coding Plan alike. ZCode's
GET /billing/preview answers an account with nothing to claim with no
data at all, not data.plans []:

  {"code":0,"msg":"","logid":"202610300535585c4e3de75769b684da87"}

(the owner's account, read 10-30 with GETs only, with and without the
X-ZCode-App-Version / X-Platform headers; both the same). #503's capture
of 10-29 had "plans": [], so 0.1.35 took a missing list as unreadable.

previewPlans now reads the list for both the claim and the card's claim
line: no data, data null, or data without plans (or plans null) is a
list of none, so the check-in is "inactive" (magpie shows "No check-in
event now"). call has already judged the code, so only a code 0 reply
gets here. Data that isn't an object, or plans that aren't a list, still
don't read and stay failed, never claimed.

Run (wsl-run on magpie-desktop, HOME=$(mktemp -d); mote was at load
220-250): `bun test` in packages/zcode, 152 pass 0 fail; the whole
repo's `bun test`, 3720 pass 0 fail of 3727 across 298 files;
`bun scripts/check.mjs zcode` ok. The new checkin test (the real
no-data reply, data null, data without plans, plans null) is red on
0.1.36's index.mjs (1 fail). Broken by hand: plans that aren't a list
read as none turns "a preview that doesn't read is failed" red; put
back, green.

Not tried: a real claim (no account has a plan to claim now), and the
official ZCode client's own parse of this reply (no ZCode app on hand);
the fixture is the vendor's real bytes. Not changed: #505 (freeFirst)
touches other parts of index.mjs.
2026-10-30 13:45:42 +08:00
HaroldLeo 219a8aa0a7 registry: add AWS Bedrock SSO (#508)
Lists the third-party npm package magpie-aws-bedrock-sso (provider id
bedrock-sso): Amazon Bedrock's Claude and GPT models through an AWS CLI
profile (SSO / IAM Identity Center), SigV4-signed, no Bedrock API key.

Reviewed at 5a66cee: registry.json only (+3 -1), based on current main.
The entry has package, name, providers and en/zh summary, no "community"
flag, as the other third-party listings (officeace-auth, @hoptoper/*).
bedrock-sso doesn't collide with magpie's bedrock / bedrock-mantle presets.

Package read in full from npm pack magpie-aws-bedrock-sso@0.3.3 (sha512
matches npm's dist.integrity; 9 files: index.mjs, lib/{credentials,
sigv4,models,converse,eventstream}.mjs, README, LICENSE, package.json).
No dependencies, no install/postinstall scripts, no telemetry. Requests
go only to bedrock-runtime.<region>.amazonaws.com (fetch refuses any
other host, port, query or redirect; region is regex-checked) and
bedrock.<region>.amazonaws.com/inference-profiles for the model list.
Credentials come from `aws configure export-credentials`, `aws sts
get-caller-identity` and `aws sso login`, run through execFile/spawn with
argument arrays; they are kept in memory only. Files read: section names
of ~/.aws/config and ~/.aws/credentials, and magpie's ~/.cache/magpie/
models.json. Nothing is written. Not a relay: Bedrock is the vendor's
own platform.

Run on mote at 5a66cee: a registry check (JSON parses, 61 entries,
unique packages and provider ids, en/zh summaries), HOME=$(mktemp -d)
bun test (3718 pass, 8 skip, 0 fail) and bun scripts/check.mjs (all ok).

Not tried: the package itself with real AWS credentials.
2026-10-30 13:05:37 +08:00
SemonCat 498358c04e kiro 0.1.21: choose direct AWS sign-in for a remote magpie (#507)
The Kiro browser sign-in asks first which way to sign in:

- AWS Builder ID registers a client with AWS OIDC (us-east-1) and opens
  AWS's authorize page directly.
- IAM Identity Center asks for the organization's HTTPS Start URL and AWS
  region (blank is us-east-1), then opens that region's AWS authorize page.
- Kiro sign-in page keeps the portal (Google, GitHub, other ways); a caller
  without inputs (OpenCode's CLI) keeps it too.

The direct ways skip the portal's first loopback callback, so a magpie on a
server or in Docker needs one pasted callback address instead of two. Still
authorization code + PKCE, same scopes, same hosts (oidc.<region>.amazonaws.com,
Kiro's own API). The callback handler now takes each stage's own state and
path once, answers a stale or foreign address with 404 without ending the
sign-in, says 409 to a second paste while a code is traded, sends a repeated
portal address to the same AWS page, and a new sign-in ends the one left
behind and frees its port at once. Kiro's page's region and AWS issuer are
checked for shape (a region can no longer put another host into the OIDC
address). Version 0.1.20 -> 0.1.21.

Reviewed head: 236db712518305415f15651178696a59a72c4a8b (base f6412ab).

Run at that head, on mote, HOME=$(mktemp -d):
- bun test packages/kiro: 110 pass, 0 fail (17 files).
- bun scripts/check.mjs kiro: ok; node --check packages/kiro/index.mjs: ok.
- Review probes (not committed), 9 pass: method list and labels the same as
  main; the portal URL (no inputs, {}, portal) has main's shape; direct
  Builder ID through magpie's loopbackPorts/openPastedCallback emulation
  signs in with the PKCE verifier, reaches only oidc.us-east-1.amazonaws.com
  and management.us-east-1.kiro.dev, and the account it saves refreshes
  through the IdC refresh_token grant; a host-injecting region
  ("us-east-1.evil.com", "us-east-1/x") and a credentialed or http Start URL
  are refused before any request; cancelled at AWS (access_denied) fails
  with AWS's reason; an expired code at the token exchange fails plainly;
  AWS register failing throws and frees the port; a superseded sign-in
  fails "another sign-in to Kiro was started" and its port is reused; a
  portal-state address on a direct sign-in is 404 and ends nothing.
- PR CI (test, on-npm): green.

Not tried: a real AWS account sign-in (the author reports reaching the
Builder ID and organization login pages on a remote magpie, and one
organization sign-in completed); the 10-minute timeout path.
2026-10-30 12:34:29 +08:00
Fantasy f6412abc6f GoAnyAPI: the Discover card shows its own logo, a homepage link and new summaries (0.1.1) (#506)
GoAnyAPI: the Discover card shows its own logo, a homepage link and new summaries (0.1.1) (#506)

registry.json's icon was an https URL. magpie's icon() reads any name as
a bundled icon file, so the mask failed and the card fell back to the
generic cube. Without the registry icon, the card uses the package's
magpie.icon, which magpie fetches and stores. Also adds the package's
homepage and rewrites the en/zh summaries.

Reviewed at 33624fbc: metadata only (+4 -3). Checked icon() in
internal/gui/assets/app.js on magpie origin/main: an http(s) name goes to
maskSpan("icons/<url>.svg") and falls back to generic, as the PR says.
CI test and on-npm green. Kilo, Search1API and PowerContext's registry
icons hit the same fallback; that is fixed on the magpie side.
2026-10-30 11:24:13 +08:00
yetone b9cbb9dd01 workbuddy 0.2.1: an enterprise (教育公益版, team) sign-in is named with its enterprise, kept beside the personal one
A person's personal account and their enterprise account (a team, or
「WorkBuddy 教育公益版」, picked on WorkBuddy's sign-in page after the
phone sign-in) share the uid and the nickname. magpie's plugin host keeps
one account per name and uid (settle in host.js), so signing in to the
education account replaced the same person's personal account, and the
two could never sit in one pool.

A browser sign-in that WorkBuddy places in an enterprise is now named
"nickname · enterprise name": the name from /login/account, else from
the matching /v2/plugin/accounts entry, else "enterprise <last 6 of id>".
A personal account's name is unchanged. Old data: an enterprise account
signed in before keeps its old name until its Sign in again, which uses
the same key and renames it in place; its free-model window, read from
ledger rows under the old name, starts again (README says so).

Run (mote, HOME=$(mktemp -d)): bun test in packages/workbuddy, 256 pass
0 fail; bun scripts/check.mjs ok. Broken by hand: accountName returning
the nickname alone turns the 4 new enterprise.test.mjs tests red.
Not tried: a real education account (the owner has none; the live
/v2/plugin/accounts shows only a personal entry), so enterpriseName's
presence in WorkBuddy's replies for 教育公益版 is from the web client's
SelectAccount code, not a live reply; the id fallback covers its absence.
2026-10-30 11:01:20 +08:00
yetone 63748b9d67 zcode 0.1.36: a gift bucket beside a Coding Plan is named by its model first (#504)
Danbuth's GLM Coding Max account had claimed ZCode's Start Plan (plan_id
zcode-v3-start-plan-1029, named "ZCODE GLOBAL BUILD") and found no Start
Plan on magpie's card. The plugin did read it: usage asks
/billing/balance beside /quota/limit and adds every live gift plan's
buckets after the Coding windows, whatever the plan type, every plan
and not only the first. The bucket was the panel's third ring, named
"ZCODE GLOBAL BUILD · GLM-5.3-Trial", which magpie's ring and account row
cut to "ZCODE GLOBAL BUI…": neither the model nor the plan's kind.

ZCode 3.16.3's own popover (host getStartPlanSnapshot, renderer
"Today's balance") lists these buckets by show_name, apart from the
Coding Plan's windows. So a gift bucket's name now starts with that
(the picker's -Trial id when it counts a model) and the plan follows:
"GLM-5.3-Trial · ZCODE GLOBAL BUILD". A gift-only account with several
plans names them the same way round.

Run (on mote, HOME=$(mktemp -d)): `bun test packages/zcode`, 151 pass 0
fail; `bun scripts/check.mjs`, every package ok, exit 0. The new test
uses a real /quota/limit reply (owner's account, read in a sandbox HOME
copy with GETs only) and the real ZCODE GLOBAL BUILD plan row from #503,
times moved to now. Broken by hand (old label order): the new test and
five others red; put back, green.

Not tried: a real balance of the ZCODE GLOBAL BUILD plan (the owner's
account has none), so its buckets take the shape of ganlerk's Start Plan
balance. Not changed: magpie's tray panel shows at most three rings and
the account row two windows, so beside a Coding Plan's 5h and weekly
only the first gift bucket is on the panel; the rest are in the tooltip
and on the Usage page.
2026-10-30 10:31:28 +08:00
yetone 8ebbaa5880 zcode 0.1.35: claims each account's ZCode gift plans daily through magpie's check-in (#503)
ZCode hands out gift/resource plans that sit on an account until claimed,
and an account used only through magpie let them lapse. The plugin now has
auth.checkin, so magpie's daily check-in (`magpie accounts checkin`, and
Settings -> Daily check-in, where ZCode is off until the user turns it on)
claims them, the shape the MiniMax, Qoder and Loomy plugins use.

claimDaily reads GET /api/v1/zcode-plan/billing/preview (the list the card
already read) and POSTs {"plan_id"} to /billing/claim for each plan it
lists, with the account's ZCode jwt, X-Device-Mid, X-ZCode-App-Version and
X-Platform, as kongbai01203 captured them. The claim is judged by the body's
code: 0 claimed, 1003 "target already exists" (HTTP 200) done, 3007 or a
captcha message "captcha" (claim it in the ZCode app), anything else, an
HTTP error without a code or a body that isn't JSON failed. A failed read is
never taken as claimed, and no answer carries signIn, so a failed claim
leaves the account as it was. Nothing listed is inactive; a key-only
account is ineligible; an expired ZCode session is failed with no request.
A plan claimed now drops the account's cached route, so the next request
uses it. One failed among several makes the whole answer failed (with the
claimed ones named), so magpie asks again later and the claimed ones then
answer 1003.

Run (on mote, HOME=$(mktemp -d)): `bun test` in packages/zcode, 150 pass;
the whole repo's `bun test`, 3698 pass 0 fail of 3706 across 297 files;
`bun scripts/check.mjs zcode` ok. checkin.test.mjs covers preview empty,
one plan claimed with code 0 (request body and headers checked), 1003,
3007, seven unreadable claim answers, five unreadable previews, one
claimed + one failed then asked again, and key/expired accounts asking
nothing. Broken by hand: 1003 -> claimed and an unreadable reply ->
claimed turned three of these tests red; put back, green.

Not tried: a real claim that answers code 0. No account has a plan to
claim right now (every preview answers plans: []), so the code 0 body is
a fixture carrying only its code, and nothing else of it is read. On
10-06 a claim without the ZCode app's Aliyun captcha was answered 400
code 3007 (#30); if ZCode still asks that for a fresh plan, the check-in
says "captcha" and the plan is claimed in the app, as before. The real
1003 reply is in the tests as captured.
2026-10-30 08:24:30 +08:00
yetone 9608d0311d grok 0.2.2: Responses requests ask for Grok Build's loop checks (yetone/magpie#3594)
Grok Build 1.0.67 sends `x-grok-doom-loop-check: 1024` and
`x-grok-exact-repetition-check: 64` on every /v1/responses request
(seen in a mitm capture of the real CLI; the strings are in its binary
next to "server reported doom-loop triggers for this response"). The
plugin sent neither. Without them cli-chat-proxy lets a reply that
repeats itself run on: it cut "* " repeated after ~4,265 output tokens,
and a looser loop runs to max_output_tokens (128000 from Pi). That is
the "repeats until max output, ends in Internal error during token
generation" of #3594, seen on Pi -> magpie -> Grok but not in Grok
Build. The fetch now sets both on a Responses request unless the
caller set them already.

Ruled out while diffing the CLI's request against magpie's: the system
prompt. `instructions`, a system message and a developer message in
`input` all reach the model (same input_tokens, 1266 vs 1249 without,
same reply), so magpie's `instructions` is not lost.

Run:
- bun test in packages/grok on mote: 85 pass 0 fail.
- bun run check (whole repo) on mote: exit 0.
- Broken by hand: loop-check.test.mjs against index.mjs at HEAD:
  2 of 3 fail (the headers are missing); with the change 3 pass.
- Real account (owner's SuperGrok, sandbox magpie on origin/main with
  this plugin from disk, requests through mitm): the same "* " x3000
  prompt over /v1/responses, /v1/chat/completions and /v1/messages each
  carried both headers upstream and was stopped after ~1,020 deltas
  (~1K tokens) with "Internal error during token generation", against
  ~4,265 tokens without the headers (direct curl, earlier).

Not tried: the CLI's client-side doom-loop recovery (it resamples a
confident tool-call loop with a reminder). The proxy's
response.doom_loop_check event (a soft loop it reports, not stops)
goes through as it came and nothing acts on it yet.
2026-10-30 06:51:57 +08:00