Commit Graph
593 Commits
Author SHA1 Message Date
yetone 060722efcf cursor 0.2.32: a merged (newer) plan's included usage is one Weekly window for every model, no Other Models
majiang_ai on X: Cursor's newer plans have no third-party-model pool,
while magpie's card still showed Cursor Models, Other Models and Total.

What Cursor says: GetPlanInfo answers isMerged true and
planInfo.includedUsagePeriod INCLUDED_USAGE_PERIOD_WEEKLY for such a plan
(enum 1 MONTHLY, 2 WEEKLY, from cursor-agent 2026.10.22's proto), and
GetCurrentPeriodUsage's billing cycle is then the week, with
autoPercentUsed == totalPercentUsed and apiPercentUsed 0. The dashboard's
usage page (cursor.com/v2/usage, chunk read on 10-29) draws one meter,
"Weekly usage limit", from the period's totalPercentUsed.

Now planOf reads isMerged and the period with the plan name (same hourly
cache, last good answer kept). A merged plan's usage is one window,
Weekly (span 7d; Monthly on a monthly merged plan, Included when not
said), with no models list, so it counts every model; On-demand and
Grok Bot as before; no Other Models or Total. A plan GetPlanInfo can't
read, or isMerged false, keeps the two pools.

Run:
- HOME=$(mktemp -d) bun test (whole repo, on mote): 3229 pass, 8 skip, 0 fail
- bun scripts/check.mjs: ok
- Broken by hand: the merged branch turned off, 5 of the 6 new tests red
  (the 6th checks the unmerged case still has the pools).
- Real account (owner's Cursor, a merged Premium plan, keychain token,
  read-only calls): the published 0.2.31 shows Cursor Models 7%, Other
  Models 0%, Total 7%; this change shows Weekly 7% (resets 11-03), Grok
  Bot, On-demand.

Not tried: an old (unmerged) plan's real account; none is at hand, the
unmerged path is unchanged and covered by the existing tests. A merged
monthly plan was not seen for real.
2026-10-29 17:55:11 +08:00
yetone 374b1fe186 factory 0.1.40: a usage policy refusal is a 400 with Factory's code, not a 403 (#494)
sweanng (yetone/magpie, Discord #general, 10-29): ZCode on Factory's GLM
5.3 got Factory's usage policy check refusing the conversation (403,
code content_policy_rejected). The plugin handed it on as a 403
permission_error with code null, so magpie passed the 403 through and
ZCode showed "Provider authentication failed" (reason=auth_failed
status=403), as if the account were broken.

The plugin now answers that refusal (only content_policy_rejected
without an x-factory-upstream-error header, as droid 0.245.0 tells it)
as a 400 invalid_request_error with code content_policy_rejected kept on
the error, on both the Anthropic (/llm/a) and OpenAI (/llm/o) routes,
with Factory's words and the "start a new session" advice as before.
Every other 403 stays a 403 permission_error. magpie reads the code as
a refusal of the request (yetone/magpie, same day).

Run (on mote): HOME=$(mktemp -d) bun test packages/factory: 178 pass,
0 fail. bun scripts/check.mjs: ok.
Broken by hand: with index.mjs back at main, content-policy.test.mjs
fails 3 of 6 (both 403 shapes on /llm/a and the new /llm/o case).
Not tried: a real Factory refusal; the refusal's body comes from
doubl4door's and sweanng's reports, not a live capture.
2026-10-29 17:51:44 +08:00
yetone 77c257c0c6 trae: README says the daily check-in is one per device (#436)
moxuanchen ran TRAE CN 3.4.4 with its own --user-data-dir on 10-29: the
second account's sign-in was kept apart, but its device id matched the
default folder's and the client said 本设备今日已签到. The README no
longer says that case is unknown, and says only the first account on a
machine gets the day's credits. Docs only; no version bump, nothing run.
2026-10-29 17:29:05 +08:00
yetone 9410e2a510 commandcode 0.1.19, devin 0.1.26, kiro 0.1.19: a refused sign-in marks the account signed out
blue12345655 (magpie Discord #help): a Command Code account signed in
through the plugin was signed out, and magpie offered no 重新登录, on
v0.1.1844 and still on v0.1.2021.

Cause: commandcode said X-Magpie-Sign-In "kept" on every answer and
signIn "kept" on every usage read, so a revoked key came back as a card
saying "Unauthorized" while magpie kept the account signed in, routed to
it, and never showed Sign in again on its rows. Devin and Kiro did the
same in their usage reads: their errors already said "sign in again",
but "kept" stops magpie from reading those words.

- commandcode: a usage read whose credits are refused (401/403), or a
  request answered 401, asks /alpha/whoami; when whoami refuses the key
  too, the usage says signIn "expired" with "Command Code's sign-in has
  expired; sign in again", and the answer carries X-Magpie-Sign-In:
  expired, its body unchanged. A 403 for a model the plan lacks, a 401
  whoami still takes, and a whoami 500 keep the account. A clean usage
  read says "renewed", which takes a mark off.
- devin: a usage read Devin answers 401 says "expired"; a clean read
  "renewed"; other failures "kept". Requests unchanged.
- kiro: a usage read whose sign-in Kiro refused (the errors made by
  gone) says "expired"; a clean read "renewed"; other failures "kept".
  auth.refresh and requests unchanged.

The response bytes in commandcode/signed-out.test.mjs are what
api.commandcode.ai answered an unknown key on 2026-10-29 (whoami,
billing/credits, billing/subscriptions, provider/v1/chat/completions).

Run (WSL magpie-desktop, Bun 1.4.2, HOME=$(mktemp -d)):
- bun test in packages/commandcode: 82 pass, 0 fail; packages/devin:
  142 pass; packages/kiro: 67 pass.
- bun scripts/check.mjs: every package ok.

Broken by hand: signed-out.test.mjs against the 0.1.18 index.mjs, 4 of
9 red (usage expired, clean read renewed, Provider API expired, Go
expired). kiro's and devin's changed usage tests against their old
index.mjs: red ("kept" received where "expired" expected).

Not tried: a real revoked Command Code, Devin or Kiro account; the
whoami check is only against an unknown key's real answers.
2026-10-29 17:04:52 +08:00
yetone 6a86762e26 cursor 0.2.31: Included usage only, a plugin option that stops an account once its included pools are used up (#485)
A new magpie plugin option, included_only ("Included usage only", off by
default), read through input.magpie.option at each usage reading, so a
change needs no restart. Modelled on Factory's standard_only (#349).

On: Cursor Models and Other Models drive routing (they lose `aside`), and
On-demand (fixed or unlimited) and Total are shown with `aside`, so a team
member whose on-demand could still pay is no longer kept in routing once
an included pool is used up. The Enterprise path does the same: the
Enterprise allowance stops the account and On-demand is shown only.
Off, or outside magpie, or an option that throws or isn't `true`: the
windows are exactly as 0.2.30 gives them.

Tests (included-only.test.mjs, new): Team accounts with a member's own
fixed limit, an org-wide fixed pool and unlimited on-demand, each with the
pools spent, left, and only Cursor Models spent, read with the switch off
and on; a fixed budget spent stops either way; no on-demand allowed is
unchanged; the switch flipped on one plugin instance between readings;
input missing/throwing/non-true; Enterprise unlimited and fixed-with-room;
the option's declaration fits host.js's limits (label 60, description 300).

Run on mote (mote-run):
- HOME=$(mktemp -d) bun test packages/cursor: 344 pass, 0 fail, 20 files
- bun scripts/check.mjs: ok
Broken by hand (each in mote's copy, included-only + usage tests):
- pools keep `aside` with the switch on: 8 fail
- fixed On-demand not set aside: 2 fail
- Enterprise allowance ignores the switch: 2 fail
- Enterprise fixed On-demand not set aside: 1 fail
- switch always on: 23 fail
- switch read once at plugin start: 1 fail
- a truthy non-true value taken as on: 1 fail
- option declared under another key: 1 fail

Not tried: a real Cursor Team account with the switch on in magpie (none
with on-demand here); the dashboard replies are fixtures shaped as
usage.test.mjs's. The option label is English only, as every plugin's
options are (magpie shows auth.options' label as given).
2026-10-29 16:29:48 +08:00
yetoneandWangzehong111 fada6e0b98 factory 0.1.39: DeepSeek V4.1 Flash 1017 goes to its registry default, Fireworks
Follows Wangzehong111's commit (from #480), with the review's change:
the plugin sends x-provider-routing-source: registry_default on every
request, and droid 0.251.0 sends that only with apiProviders[0]. 1017's
apiProviders is ["fireworks","baseten","databricks"], so Baseten with
registry_default is a header pair droid never sends. 1017 now goes to
Fireworks like every other model's first upstream; the droid test checks
both headers, the README says so, and the fixture header names the binary
the bytes were checked against.

Reported on Discord by sweanng: the model list had DeepSeek V4.1 Flash but
no 1017.

Checked: droid 0.251.0 (LATEST) darwin-arm64 from downloads.factory.ai,
sha256 d3c0b87f..., has the 1017 entry byte for byte as in testdata, with
the c(o,t) helper and I()'s registry_default rule.

Closes #480.

Co-authored-by: Wangzehong111 <112800852+Wangzehong111@users.noreply.github.com>
2026-10-29 16:25:54 +08:00
Wangzehong111 36f2d757c3 factory 0.1.39: add DeepSeek V4.1 Flash 1017
Offer deepseek-v4.1-flash-1017 on chat completions with the limits,
reasoning variants, attachments and 0.12x rate in Factory.app's Droid
0.251.0 registry. Keep the original Flash entry and its Fireworks route.

Use Baseten: authenticated Factory routing checked on 2026-10-29 orders
1017 as [baseten, fireworks]. Live plugin requests succeeded on both
backends with the distinct 1017 response model IDs. Baseten accepted none
and high; the arithmetic high sample reported 104 reasoning tokens.

Keep the raw registry entry and context helper in a versioned fixture,
including the binary SHA-256. Check both OpenCode config and Magpie's
provider.models hook, retain price checks for every model across the
0.241.1 and 0.251.0 fixtures, and include 1017 in Droid Core usage tests.

Validation: 176 Factory tests pass; all 30 plugins pass check.mjs.
Pack dry-run and an unpacked-package smoke test confirm all five runtime
files are present and the model hooks and request loader load correctly.
2026-10-29 16:15:25 +08:00
yetone 1e7122e161 workbuddy 0.1.47: a conversation's ids are one account's own
leaves5760 on Discord: every account of a group of WorkBuddy accounts gets
403 "request illegal", WorkBuddy saying the account is restricted for
abnormal behaviour.

X-Conversation-ID and X-Conversation-Request-ID were derived from the
session (or first user message) and the turn alone, with a salt per
process. One magpie session spread over several accounts therefore sent the
same conversation and turn ids under every account's X-User-Id. WorkBuddy's
own client (5.9.3, @genie/agent-cli 2.165.0) is signed in as one account,
so a conversation never shows up under two. The ids now also hash the
account (uid, enterpriseId, and for a key account the key), and a chat sent
again after a 401 as another account (a sign-in saved since) gets that
account's ids. The same account keeps stable ids as before.

This is a divergence from the official client found by reading its
bundle, not a verified cause of the restriction. Not changed, reported
only: no X-Private-Data, traceparent/baggage, reasoning_summary "auto",
or the client's /v2/report telemetry.

Run on mote at this tree: HOME=$(mktemp -d) bun test in packages/workbuddy,
209 pass 0 fail; bun scripts/check.mjs exit 0.
Broken by hand: with the account left out of the ids, both new tests
(conversation.test.mjs, unauthorized.test.mjs) fail; with reattend a no-op,
the 401 test fails.
Not tried: a real WorkBuddy account (none used, by the task's rule).
2026-10-29 15:37:53 +08:00
yetone dec921767e commandcode 0.1.18: Jev (typesafe/jev), Command Code's decision model, can be picked in magpie
joeliu96872540 on X: magpie couldn't get Command Code's typesafe/jev.
Command Code's /provider/v1/models (94 models) doesn't list it; the CLI
(command-code 1.88.2, read from its bundle, not run) knows it as
SYSTEM_ONE_MODELS ["typesafe/jev"], asked at POST /provider/v1/systemone
with {model, state, questions} and buildCommandAuthHeaders, answered with
{model, answers, usage}. That is magpie's System One shape.

- config sets decide: true on the provider and adds Jev to its models,
  marked decides (magpie's plugin decision API, yetone/magpie#1514).
- provider.models adds Jev, marked, to every plan's list (Go's, the live
  one, the default standing in); Command Code decides which plans may ask.
- fetch sends a /systemone question as the CLI does: its headers
  (User-Agent cli, x-command-code-version 1.88.2, project slug, session,
  Bearer key, x-cmd-zdr when ZDR is on), not the chat's x-api-key, with
  Jev's other names (jev, jev-latest, typesafe-ai/jev) sent as
  typesafe/jev. The answer goes back as it came; a refusal through
  failure(), the account kept; a Go plan's "no API access" keeps the key
  as Go's.
- The plan-list tests that count chat models leave Jev out (talking()).

Run: bun test in packages/commandcode on mote: 72 pass, 1 skip (as
before), 0 fail; bun scripts/check.mjs all green. Broken by hand (the
/systemone branch, decide and withJev turned off): 6 of jev.test.mjs's 8
go red; the ZDR and Go-refusal cases pass either way, as the generic
Provider API path does the same for them.

Not tried: a real Command Code account (none in a sandbox HOME), so no
real /systemone answer has been seen, nor which plans Command Code lets
ask Jev.
2026-10-29 14:52:38 +08:00
yetone 644038d95a trae 0.2.25: a 9074 or 9095 says which device the check-in went on (#436)
moxuanchen (plugins#436, Windows 11, TRAE CN 3.4.4, plugin 0.2.24):
account A checked in (100 credits), account B got 9074. Learning why
took running clientDevice by hand: both of that machine's profiles
(Trae CN, TRAE SOLO CN) were signed in as A with one device, so B's
claim went on magpie's own device for it.

The 9074 and 9095 messages now end with the device the claim went on:
this machine's client's, signed in as the account, or magpie's own,
with how many client profiles were found and that none is the
account's. A client device another account's profile also has is named
as shared. No uid or device id is in the message. clientDevice now reads
through clientProfiles; its answers are unchanged.

Not done: explicit profile dirs or --user-data-dir discovery. Whether
TRAE CN keeps a separate, registered device in such a dir is unverified,
and the issue asks the reporter for that first.

Run at this tree (rebased onto ea9201d; nothing under packages/trae changed):
- mote-run, HOME=$(mktemp -d): packages/trae bun test 227 pass 0 fail;
  whole repo bun test 3184 pass 0 fail at the rebased head; bun scripts/check.mjs ok.
  `node scripts/check.mjs` fails with ERR_INVALID_ARG_TYPE here and on
  main 4a46212 alike (it uses Bun's import.meta.dir; CI runs it with bun).
- win-run (xiaomi-gpu, Windows 11), fresh HOME: packages/trae 227 pass.
- Broken by hand: deviceNote reading no profiles turns the four new
  #436 tests red (4 fail), green again restored.
Not tried: a real Trae CN account or client.
2026-10-29 13:45:18 +08:00
mola ea9201df1f mail-watch 0.1.0: mail session ends, failed turns and refusals through your own SMTP (#457)
mail-watch 0.1.0: a hooks plugin that mails a rendered event (per event or as a digest) when a session ends, a turn fails, or a request is refused, through the user's own SMTP server.

The digest's due time is kept in the state file (digestAt/digestHours), so a restart neither resets nor fires it early; the timer step is capped at 2^31-1 ms and an early wake re-arms for the rest instead of sending.

Run at the reviewed head 8415dd9eb (sandbox HOME):
- mote: packages/mail-watch `bun test` 44 pass, 0 fail, three times; whole repo `bun test` 2982 pass, 8 skip, 0 fail; `bun scripts/check.mjs` exit 0; e2e.smoke.mjs against a local SMTP sink: onRequest returns undefined, onResponse returns without awaiting the mail, the mail arrives with the rendered event and subject.
- Linux (WSL2 Ubuntu 24.04): packages/mail-watch `bun test` 44 pass, 0 fail.
- Broken by hand, each red: no step cap (2 red: monthly digest, early wake), no due-time-ahead check (early wake), no persisted due time (restart test), no prune, raw guard, no shrink (1 red each). Making the persist write unconditional stayed green, as expected (a cost fix only).
- CI at this head: test and on-npm green.

Not tried: a real SMTP provider (Gmail, Fastmail); the smoke test uses a local sink.
2026-10-29 13:40:31 +08:00
yetone b08a6c1bce workbuddy 0.1.46: WorkBuddy AI's chats carry its current 5.9.3 client's headers
Two Discord users report WorkBuddy AI accounts answering 403 11140
("account restricted due to unusual activity"). While looking into it,
the plugin was found sending WorkBuddy AI's chats as a client one release
behind: WorkBuddy/5.8.4 workbuddy-ai/5.8.4 CLI/2.161.0, X-IDE-Version
5.8.4, no X-Agent-Runtime. Not shown to be the cause of the restrictions
(no real account was used); it is a header that no longer matches the
official client.

Read (never run) on 2026-10-29, unauthenticated:
- www.workbuddy.ai/v2/update?platform=workbuddy-darwin-arm64 answers
  5.9.3.42398134 for every version asked from 5.3.0 to 5.8.4.41366630
  (the desktop's resolveUpdateClientTypePrefix maps workbuddy-ai to
  "workbuddy"), download.codebuddy.ai, last-modified 2026-10-27.
- That zip, range-read: "WorkBuddy AI.app" CFBundleShortVersionString
  5.9.3, bundle id com.workbuddy.workbuddy-ai, cli/package.json
  @genie/agent-cli 2.165.0, cli/product.json productName WorkBuddy AI,
  platform workbuddy-ai, Electron Framework 37.10.3.
- Every file under app.asar.unpacked/cli has the China 5.9.3 zip's CRC
  but product.json and sandbox-config.json, so the CLI's headers
  (UserAgentHttpInterceptor, axiosToFetchAdapter, X-Stainless-*, gzip)
  are the China build's.
- Its app.asar puts agentRuntime `local-agent` in the prompt meta, as
  the China build's does, so X-Agent-Runtime: local-agent goes on
  WorkBuddy AI too.

Now WorkBuddy AI sends WorkBuddy/5.9.3 workbuddy-ai/5.9.3 CLI/2.165.0,
X-IDE-Version 5.9.3 and X-Agent-Runtime local-agent; the China build is
unchanged.

Run (on mote, HOME=$(mktemp -d) bun test in packages/workbuddy): 207 pass,
0 fail. bun scripts/check.mjs: exit 0.
Broken by hand: conversation.test.mjs on origin/main's index.mjs (0.1.45):
2 of 13 red (the WorkBuddy AI User-Agent, and the per-build header test).
Not tried: a real WorkBuddy AI chat with the new headers. Still not sent:
X-Device-Token (Tencent's native device SDK). No text added names magpie
or WorkBuddy's limits.
2026-10-29 13:40:02 +08:00
yetone 4a46212f89 page-chat 0.1.2: opened from another machine, the page reaches its service through magpie web
aigcfree (Discord DM) runs `magpie web --addr 0.0.0.0:3430` on an Ubuntu
server behind nginx, and opens it from a Windows PC. The chat tab showed
"127.0.0.1 refused to connect": boot.js sent the frame to 127.0.0.1, the
viewer's own PC. 0.1.1 (8a9680b) explains an SSH tunnel instead. With a
magpie that proxies a page's service, no tunnel is needed:

- package.json declares magpie.page.service {port: 3477, option: "port"},
  the same port index.mjs listens on. magpie web then proxies the service
  under the page's token (/_magpie/plugin/<token>/_magpie/service/) and the
  bridge hands that address to the page as magpie.service.
- boot.js goes to magpie.service when it is an http(s) address. Without
  one (the desktop window, or an older magpie) it behaves as 0.1.1: on
  loopback it goes to 127.0.0.1, from another machine it explains the
  tunnel.
- The chat client asks api/... by relative address (app.js, index.html,
  library.mjs's icon URLs), so it works under the proxied path. Served
  from 127.0.0.1:<port>/ these resolve as before.

The service still listens on 127.0.0.1 only, and still checks Host,
Origin and its token. magpie's proxy sets Host to 127.0.0.1:<port>.

Run: bun test packages/chat (16 pass) and bun scripts/check.mjs on mote.
Real: a sandbox magpie web on mote (0.0.0.0, LAN), this package installed
from a folder, a fake gateway. Playwright on the Windows box opened the
chat tab over the LAN in Chromium and WebKit, sent a message, and got the
streamed answer; the fake gateway logged both requests.
Broken by hand: the service branch in boot.js off, 2 tests red.
Not tried: behind a real nginx; the desktop window with this version (the
fallback is the 0.1.1 path, covered by the launcher tests).
2026-10-29 13:26:58 +08:00
yetone 8a9680b4cb page-chat 0.1.1: opened from another machine (magpie web on a server), the launcher explains the SSH tunnel instead of navigating to a refused 127.0.0.1 2026-10-29 13:14:24 +08:00
yetone 1f56706556 zen-free 0.1.18: the environment block names a real directory, since Zen refuses "Working directory: unknown"
shanmao_10826 on magpie's #help, 10-29: every free model (deepseek-v4.1-
flash-free and others) answers 429 "Free usage limit reached. Free
models work in OpenCode", while OpenCode itself on the same machine works.

Cause, found against opencode.ai from the Linux box (xiaomi-gpu WSL) on
2026-10-29, deepseek-v4.1-flash-free, one request each, minutes apart,
same IP, only the system prompt and stub-tool text changed:
- the plugin's own request through loader.fetch (0.1.17): 429
  FreeUsageLimitError, the reporter's message;
- "You are opencode." + <env> Working directory: /tmp/x: 200;
- the plugin's exact block "<env>\n  Working directory: unknown\n</env>"
  (alone, or after a prompt, either tool description): 429;
- the same block with /tmp/x for "unknown": 200;
- the plugin's stub description "Not available. Never call this tool."
  with a path in the block: 200.
So Zen now refuses the literal placeholder 0.1.15 to 0.1.17 added, the
plugin's fingerprint, as it refused the plugin's old User-Agent on 10-26.
Headers were diffed against OpenCode v2.2.0 (packages/core/src/session/
model-request.ts, app.ts useragent, plugin/provider/opencode.ts): the
same set the plugin sends; nothing new on the request since 2.0.25. Zen's
server code is no longer public (packages/console's handler went on
10-11), so this was found by bisecting real requests.

Fix: the block added is OpenCode 2.2.0's own (instructions/builtins.ts:
the intro line, Working directory, Workspace root folder, Is directory a
git repo, Platform; not its line about OpenCode's temp folder), with the
directory the agent's own prompt or first user message names (Codex's
<cwd>, a "Working directory:" line, Kimi's "The current working directory
is `...`"; absolute paths only), or the user's home folder when none is
named. A prompt that already has a block goes as it is, as before.

Run:
- Real, through the fixed plugin's loader.fetch from the same IP right
  after the 429s: deepseek-v4.1-flash-free with no prompt 200, with an
  agent prompt naming its directory 200, glm-5.3-flash-free 200.
- New test (the block names the stated or home directory, never a
  placeholder; Codex/Kimi/Windows/Anthropic cases): red on origin/main's
  provider.mjs (1 fail of 44 in index.test.mjs), green with it.
- HOME=$(mktemp -d) bun test in packages/zen-free: 201 pass, 0 fail.
- HOME=$(mktemp -d) bun test at the repo root: 3131 pass, 1 fail, the
  fail is layerfs "item 3: an import skips secret-shaped files", red the
  same at origin/main cc3f000, filed as #477.
- bun scripts/check.mjs: ok.
All on the Linux box (wsl-run); mote was unreachable.

Not tried: the reporter's own agent through magpie (they didn't say
which); a Responses or Anthropic free model (Zen lists none free); a
Windows or macOS host (the block's Platform and home path differ there).
2026-10-29 11:38:06 +08:00
yetone cc3f000c6d qoder 0.2.48: a job token Qoder refuses as Login expired is renewed once and asked again (#474)
ahang39 (plugins#474): international Qoder answered dfmodel with 403
"Login expired" in bursts of ~16 requests over 2-5 minutes, about every
24h, shown by magpie as 401 "the sign-in lapsed". The report's times put
the burst's start where magpie's renewal came due (saved end less the
10-minute lead) and its end where the renewed pair was saved: Qoder
refused a job token the plugin still had as minutes from its end, and
nothing asked again with a renewed one. Why Qoder ended it early isn't
proven from the report.

- A chat's 401/403 now marks the failure lapsed. ask re-reads the saved
  sign-in under the refresh lock: a pair renewed meanwhile (another
  request, magpie's auth.refresh, another process) is used with no
  refresh; else the refresh token is spent once, the pair saved, and the
  request sent once more. A burst shares one refresh. A token this
  process renewed under 5 minutes ago that is refused too isn't renewed
  again, so a refusal not about the token's end doesn't churn refresh
  tokens; the 401 is said as before.
- A refreshed job token's end is read as an exchanged PAT's was:
  expire_time / expires_at (a date, or an epoch in s or ms) first, then
  expires_in, then a day. An end already past is ignored.

Run (mote, mote-run, HOME=$(mktemp -d), --timeout 60000; mote at load
20-28):
- packages/qoder: 320 pass, 0 fail.
- whole repo: 3129 pass, 1 fail: commandcode "a plan saved stands in
  for a subscription slow to read" (16.8s against its 3s bar), passes
  alone 13/13, filed as #475.
- bun scripts/check.mjs: ok.
- lapsed.test.mjs on the old index.mjs: 8 of 9 red. The 9th (magpie's
  own renewal begun during the refusal) was rewritten after that run and
  not run against the old code again.

Not tried: a real international Qoder account at the moment its token
is refused; the fake Qoder (refusal body {"message":"Login expired"},
single-use refresh tokens) is built from the report's words only.
2026-10-29 10:59:24 +08:00
yetone 50e99c2524 trae: the token_usage TRAE CN's own client got keeps its cache read (#455)
chansee97's capture of TRAE CN's llm_utils_chat answer, byte for byte:
an id line and no space after any colon (id:30 / event:token_usage /
data:{...cache_read_input_tokens:4096...}). The plugin already reads it:
cache_read_input_tokens 4096 of prompt_tokens 4122 goes on to magpie,
streamed and not. No change to the plugin, so no version bump.

Run (mote, bun 1.4.2, sandbox HOME): bun test cache.test.mjs, 6 pass.
Broken by hand: an "event:" line with no space read as unknown makes both
new cases red (2 fail); the four older cases, built with a space, stay
green, so this is the only test of the no-space form.
Not tried: a real Trae CN account (none here).
2026-10-29 09:33:56 +08:00
yetoneandMagiczerowxy 526c7853c3 page-chat 0.1.0: Magic_zero's chat page, with tests, a registry entry and check.mjs for a page's host part
Lists Magic_zero's (Magiczerowxy) magpie-chat as @magpie-community/page-chat:
a chat page in magpie's window over magpie's own gateway, models, MCP
servers, instructions and skills. Not a provider or a relay: it signs in
to nothing and every request goes through magpie's gateway.

- chat.test.mjs starts the service on a free port against a fake
  gateway in a temp config folder: no token (Origin null and none), a
  wrong token, another Origin and a rebound Host are refused and nothing
  reaches the gateway; with the token a chat streams with the caller key;
  the icon redirect has a Location; boot.js makes no request; app.js
  sends the token.
- scripts/check.mjs takes the OpenCode v1 default export {id, server}
  as magpie's host does, and doesn't start a page's server (it would bind
  a port and write config); layerfs's tools are still checked.
- package.json declares the port option (3477) both parts read; boot.js's
  comment says so instead of a fallback to 3478 that never existed.
- README in the repo's style with credit, what the service reads and
  sends, who can use it, and the changes from the original.
- registry.json entry and a row in the Pages table.

Run on mote (bun 1.4.2) at this tree:
- cd packages/chat && HOME=$(mktemp -d) bun test: 11 pass.
- HOME=$(mktemp -d) bun test (whole repo): 3119 pass, 0 fail, 3127
  tests across 261 files; bun scripts/check.mjs: exit 0, chat and
  layerfs ok.
Broken by hand: with the token check off, "a page without the token
can't chat" went red; with the Host check off, "a DNS-rebound Host is
refused" went red.
Not tried: the page in a real magpie window (sandboxed frame navigation
and the host calling server()).

Co-authored-by: Magiczerowxy <magiczerowxy@users.noreply.github.com>
2026-10-29 09:07:44 +08:00
yetoneandMagiczerowxy bdf3bf8405 page-chat: a token and a Host check guard the local service; port option honoured
The service on 127.0.0.1:3477 answered Origin: null (any site's sandboxed
iframe or a data: page) with ACAO null, and had no Host check, so a
hostile page could POST /api/chat on the user's magpie gateway key, read
and rewrite conversations and settings, and drive MCP tools; a DNS-rebound
page could read conversations with a plain GET.

- Every /api/ route except ping, fonts.css and icon/* now needs a
  per-process token (x-magpie-chat-token, timing-safe compare). The token
  is put in index.html as a meta tag, and index.html goes out without
  CORS, so only a page that navigated to the service can read it. app.js
  sends it on every call and reloads once when the service restarted.
- The Host must be 127.0.0.1:<port> or localhost:<port>, checked first.
- index.mjs starts the service when the host calls server(), not on
  import, and passes the plugin option's port, which page/boot.js already
  read; before, a port set in the options moved the page and not the
  service.
- Port 0 binds a free port (tests); the actual port is used for the Host
  and Origin lists.
- /api/icon's remote icon answered 302 without a Location; it has one.
- /api/bootstrap reports the package version instead of "0.1.0".
- package.json: 0.1.0 in magpie-community/plugins, author credit, start
  runs serve.mjs.

Co-authored-by: Magiczerowxy <magiczerowxy@users.noreply.github.com>
2026-10-29 09:03:53 +08:00
yetoneandMagiczerowxy 4193f7410c chat: Magic_zero's magpie-chat page, as published at Magiczerowxy/magpie-chat 15de02d
The files its package.json ships, unchanged, from
https://github.com/Magiczerowxy/magpie-chat at 15de02d (0.1.18). The
vendored KaTeX is katex@0.16.11's dist, byte for byte (checked against
npm's tarball). Not published from this commit: the next ones close the
local service to other pages and fit it to the repo.

Co-authored-by: Magiczerowxy <magiczerowxy@users.noreply.github.com>
2026-10-29 09:01:47 +08:00
MYCF711 f968917875 qoder 0.2.47: every model a site ships says whether it takes images (#470)
Every model a site ships now sets attachment and modalities.input either way, so a text-only model (QwenWork's three, Qoder CN's Lite) no longer falls back to models.dev's vote by bare model id.

Run at 20043420a48079429896d861b33f2140261cf1df, on mote: HOME=$(mktemp -d) bun test in packages/qoder, 311 pass, 0 fail. Broken by hand (attachment: true for every model): config-capabilities.test.mjs goes 0 pass / 2 fail.
Checked: QWORK_FALLBACK_LISTING marks all three QwenWork models is_vl: false, so text-only matches the vendor's listing. A signed-in account's own listing (is_vl) still takes over from the shipped list.
Not tried: a real Qoder CN account's Lite with an image.
2026-10-29 02:43:18 +08:00
yetone 744e1e26f3 autoclaw 0.2.12: the overseas chat sends the official 2.0.3 fingerprint, and X-Tm "linux" on Linux as the official client does (#367)
menhouran captured the official AutoClaw 2.0.3 Linux chat request and
corrected the report behind 0.2.7: the official client sends X-Tm "linux",
not "linux-x64". The overseas gateway refuses "linux" only beside a
non-official fingerprint (X-Channel AutoClaw4, X-Version 1.18.1, no
X-Auth-*); "linux-x64" got through only because it isn't the one value
checked.

Read from the official client itself: AutoClaw-2.0.3-x64.AppImage from
autoclaw.z.ai's Linux download (sha512 matches latest-linux.yml),
resources/app/dist/main.cjs, extracted with 7zz and never run.
createZworkManagedRequestHeaders and createZworkManagedModelRequestResolvers
build the chat headers:
- X-Tm from managedPlatform(): darwin mac, win32 win, else process.platform
  as is (Linux is "linux" on x64 and arm64);
- X-Auth-Sign = md5("100003&<seconds>&<appKey>"), the same identity and
  signature the plugin already sends on its sign-in/wallet paths;
- X-Channel official, X-Version app.getVersion() (2.0.3), X-Lang the
  product language (en in the reporter's capture), X-Product autoclaw,
  X-Client-Type pc, x_trace_id autoclaw-desktop;
- X-Request-Id = X-Trace-Id = a randomUUID per attempt; X-Session-Id the
  session's UUID; X-Authorization Bearer, no Authorization;
- the request goes through the OpenAI SDK 6.26.0 in Electron 42.6.1
  (Node v24.18.0), which adds User-Agent "OpenAI/JS 6.26.0" and
  X-Stainless-* (OS/Arch through the SDK's own normalizers).

The overseas chat now sends that set. X-Session-Id is a UUID derived from
the conversation's first non-system message, so it stays the same across a
conversation's turns as the official one does. The caller's own
X-Stainless-* headers are dropped. bizHeaders (sign-in, refresh, wallet,
check-in) keep AutoClaw4/1.18.1 and send X-Tm "linux" again, as before
0.2.7, when they worked on Linux. README says what is sent and that
linux-x64 was a bypass.

Not changed: the overseas chat path keeps /v1/chat/completions, which the
reporter verified; the official client posts to .../autoclaw/chat/completions.
X-Stainless-Timeout is 600, the SDK default when no per-request timeout is
passed; whether zwork passes one wasn't traced to the end.

Run: HOME=$(mktemp -d) bun test in packages/autoclaw on mote, 46 pass;
bun scripts/check.mjs autoclaw ok; the same suite on Linux (wsl-run,
magpie-desktop) 46 pass. The new tests on origin/main's index.mjs: 4 fail
(the three #367 tests and the UA check in the 406 test).
Not tried: a real overseas account (none here), on Linux or anywhere; the
reporter is asked to confirm on #367.
2026-10-29 01:46:07 +08:00
yetone dd260b4a3a trae: #434's "max" is the app's 1M-window Max switch, not a level (comments)
hbw169 (#434) on trae 0.2.23, TRAE CN: magpie model efforts prints
"low high xhigh" for deepseek-v4.1-flash and deepseek-v4.1-flash-max.
Their screenshot of the TRAE CN app's DeepSeek V4.1 Flash card shows
思考强度 轻 / 高 / 极高 only (light / high / extra_high, the plugin's
low / high / xhigh), and a separate 更大上下文 (Max) switch: "1M window,
more credits". That switch is the plugin's deepseek-v4.1-flash-max model
(maxModel, the list's __max entry with context_window_tokens.max), which
the reporter already has. So the plugin offers exactly what the app does.

Magpie's side passes a plugin model's variants through unchanged
(internal/provider/plugins.go: c.Efforts = m.Variants; provider.Levels
holds max), so it doesn't narrow anything either.

0.2.23's comments said the app offers DeepSeek V4.1 Flash max as a level.
That was wrong; they now say what the screenshot shows. No code change,
no version bump: LEVELS keeps medium/max for a list that names them.

Run: packages/trae, HOME=$(mktemp -d) bun test on mote: 221 pass, 0 fail.
Broken by hand: nothing; comment-only.
Not tried: a real TRAE CN account's model list; the read rests on the
reporter's screenshot and the client binary's field names
(reasoning_effort_config, reasoning_effort_options,
default_reasoning_effort, context_window_tokens), not a captured list.
2026-10-29 01:13:35 +08:00
liangmouse f653369a77 joycode 0.2.0: route models by adapterType to Chat, Responses and Messages (#464)
joycode 0.2.0 (liangmouse). Each JoyCode model is routed by the `extJson.adapterType` in its catalogue entry:
- missing/other → Chat Completions (`@ai-sdk/openai-compatible`, `chat_completions`)
- `openai-response` → Responses (`@ai-sdk/openai`, `responses_completions`)
- `anthropic` → Anthropic Messages (`@ai-sdk/anthropic`, `anthropic_completions`)

The routing matches JoyCoder.joycoder-fe 3.8.71's `buildApiHandler`. Other changes:
- Anthropic `/messages/count_tokens` gets a local 404 and nothing goes upstream, so magpie's `unsupportedCount` uses its local estimate.
- All three protocols send `language: UNKNOWN`, as JoyCode's own handlers do.
- Non-streaming JSON for Anthropic and Responses counts as success.
- `flatten` applies to chat only.
- JoyCode's extra SSE layer (`data: event:` / `data: data:`) is removed line by line as the stream arrives. Standard SSE passes through unchanged.

Reviewed and run at f1ccb2ab59b0570295264317f270b266c7a585da (on mote, macOS, Bun 1.4.2, HOME a temp dir):
- `bun test packages/joycode`: 42 pass. `node --test packages/joycode/*.test.mjs`: 42 pass. `bun scripts/check.mjs joycode`: ok.
- Broken by hand, one at a time, each went red:
  - count_tokens guard off → the count_tokens test;
  - Anthropic normalizer off → the Anthropic double-wrapped test;
  - Responses normalizer off → the Responses double-wrapped test;
  - `language` dropped → 2 tests.
- Official SDKs (`@anthropic-ai/sdk` 1.3.0, `openai` 7.45.1) read JoyCode-framed streams through the plugin's fetch, served locally and cut into 7-byte chunks:
  - `messages.stream` got the full event sequence, text "OK", `end_turn`;
  - `responses.create({stream})` got 9 events ending in `response.completed`, text "OK".
  - The same bytes without the plugin: "request ended without sending any chunks" from Anthropic and "malformed server-sent event JSON" from OpenAI.
- Upstream functionIds seen were `anthropic_completions` and `responses_completions`.

Real account: the author's run is in the PR thread and the CHANGELOG (`provider test` GPT-6 Astra 200 in 3.0s, Claude-Opus-5-hq 200 in 7.3s). Not tried here: no JoyCode account.
2026-10-29 01:12:42 +08:00
yetone 880cd9319c workbuddy 0.1.45: only a chat completion goes gzipped; magpie's drawings go as plain JSON
iwinux on Discord (2026-10-28 ~22:30 UTC+8, magpie v0.1.1812): the Magpie
Image MCP through WorkBuddy AI failed from the minute 0.1.43 was published
(14:30Z) with
  400 Bad Request: Unmarshal create image params failed with error:
  invalid character '\x1f' looking for beginning of value (11101)
0.1.43 (f4d48ac) gzipped every body the loader's fetch sent that wasn't
Messages. magpie's drawWorkBuddy (internal/gateway/draw_workbuddy.go) sends
its JSON to <site>/v2/images/generations and /v2/images/edits through that
same fetch, and WorkBuddy's images API reads the raw bytes as JSON: '\x1f'
is gzip's first byte. magpie itself passes the JSON string through
unchanged (host.js bodyOf); the plugin set Content-Encoding: gzip and
compressed it.

Now only a chat completion (a path ending /chat/completions, or with no URL
to read, a body holding messages: isCompletion) goes gzipped, and only one
is given the model's default effort, which also ran on a drawing's body and
read /v3/config for it. Messages and everything else go as they came.
Sibling paths checked: /v3/config is a GET with no body; Messages and
count_tokens were already left alone; the plugin serves no embeddings.

Run (on mote, HOME=$(mktemp -d) bun test in packages/workbuddy): 207 pass,
0 fail. bun scripts/check.mjs: exit 0.
Broken by hand: the new images.test.mjs on origin/main's index.mjs (0.1.44):
4 of 6 red, the fake images API answering 400 with the reporter's own
"invalid character '\x1f' ... (11101)"; the 2 that pass guard that a chat
still goes gzipped on both builds.
Not tried: a real WorkBuddy drawing (no live account used here); whether
WorkBuddy's own CLI gzips its image requests (its images API doesn't take
gzip either way).
2026-10-29 00:33:30 +08:00
A. S. 9dbde4573c devin: OpenCode 2 support, a default export with setup (#397)
devin 0.1.25: the plugin loads in OpenCode 2 (a default export with setup), beside OpenCode 1.

Also: v2Usage leaves the uncached count undefined when prompt_tokens is missing, instead of NaN.

Run at the reviewed head 6b151dba3c7cc1056026629bf2e4e4c8e312a6d0, on mote:
- HOME=$(mktemp -d) bun test packages/devin: 125 pass, 0 fail
- bun scripts/check.mjs: ok
- HOME=$(mktemp -d) bun test: 2920 pass, 8 skip, 0 fail
- Broken by hand: with 1ed15ef's noCache line back, "v2Usage takes cached tokens out of the uncached count" goes red (NaN), green once restored.
Not tried: a real Devin chat in OpenCode 2 (no Devin account here).
2026-10-29 00:02:04 +08:00
lexleizou 719de026e7 cursor 0.2.30: an Enterprise account's overall allowance from usage-summary (#391)
Fixes yetone/magpie#3288. An Enterprise account's GetCurrentPeriodUsage has no planUsage, so its card was empty. usage() now reads the website's /api/usage-summary with the same dashboard session the Grok Bot read builds, and shows an Enterprise window (amount/limit in USD, reset at the cycle's end) when the summary is Enterprise with overall enabled and used/limit real numbers. It is aside while team on-demand is unlimited or a measured budget has room, and a measured on-demand budget gets its own window. Anything else leaves the card empty, as before. Version 0.2.30.

The reviewer pushed 9435f59 on top of e2f03a0: main merged in (the only conflict was the version line; main took 0.2.27 to 0.2.29 meanwhile), version 0.2.30.

Run at 9435f59f0f0e4902e37f8634eebe8e41127cc9b1, on mote (mote-run, HOME=$(mktemp -d)):
- bun test packages/cursor: 328 pass, 0 fail (19 files). bun scripts/check.mjs cursor: ok.
- Full bun test: 3063 pass, 8 skip, 0 fail (257 files).
- Broken by hand on usage.test.mjs, each red then restored: the old Number() reads of overall.used/limit (the can't-be-read test; null/""/false/[] read as 0 again), no room check on the on-demand budget (the 50000 and 60000 of 50000 cases), the summary read off (10 tests).
- npm pack 0.2.30 and imported the packed index.mjs (CursorAuthPlugin, _internal). npm has 0.2.29.

Not tried: a real Enterprise account (none here); the summary's shape rests on the author's account. Still unanswered from the review: whether an Enterprise seat's summary carries a personal on-demand cap (individualUsage.onDemand); a ms-string billingCycleEnd gives no resetsAt. #372 touches the same `if (!u)` branch and now has to rebase onto this.
2026-10-28 23:49:08 +08:00
Yandre97 f02894d3a0 autoclaw 0.2.11: the points balance is a prepaid wallet window, and spend rides on local balance deltas (#445)
AutoClaw has no points ledger upstream (wallets.v2 is a balance only), so usage() now reports the balance as a prepaid wallet window, {name: "积分余额", balance, unit: "积分"} (magpie >= v0.1.1790, #3950), which routing reads as what is left; an empty wallet counts as used up. A display-only "本轮消耗" window (aside) is worked out from local balance deltas: any rise, from 0 too, opens a new cycle, and the Beijing day keeps its spent/gained sums. The ledger is keyed by signinAccountKey (#254), lives in $XDG_CONFIG_HOME/magpie/autoclaw-usage.json (temp file + rename, 30-day expiry), and a null/""/non-numeric total_balance is unknown and never recorded. The unsigned fallback reward reads 200 (was 400). Version 0.2.11, on top of main's 0.2.10 (#466, d8cfee3, whose FLAGGED rewrites are kept).

The reviewer pushed 6418906 on top of fb334b8: main merged in (no conflicts), version 0.2.10 -> 0.2.11, the README paragraph rewritten to match the code (it still described state in the package folder and a routing spend window), and an aside assertion on the spend window test.

Run at 6418906cb7387c5e6892f326c9a2d913cc252881, on mote (mote-run, HOME=$(mktemp -d)):
- bun test packages/autoclaw: 44 pass, 0 fail; nothing left in packages/autoclaw or $HOME/.config.
- bun scripts/check.mjs autoclaw: ok. Full bun test: 3050 pass, 8 skip, 0 fail (257 files).
- The merged tree's packages/autoclaw diff against main is exactly the PR's own diff plus the version line; FLAGGED's "CodeBuddy Code" entries are there.
- Broken by hand, one at a time, each red then restored: `last > 0` back in balanceObserve (balanceObserve test), the old key uid ?? accountId (same-name accounts test), the null guard dropped (unreadable balance test), `if (false)` for the spend window (two-reads test), aside removed (two-reads test, with the new assertion; it passed without it), the balance window removed (4 tests).
- npm pack 0.2.11 and imported the packed index.mjs (AutoclawAuthPlugin, AutoclawCnAuthPlugin, _internal).

Not tried: a real AutoClaw account (none here); the balance shapes and the routing order rest on the author's run with magpie v0.1.1876. Not known: whether an account at 0 积分 is still served (e.g. a member's GLM-5.3 allowance); magpie now benches it at 0.
2026-10-28 23:46:06 +08:00
MYCF711 4115073df3 zen-free 0.1.17: deepseek-v4.1-flash-free's context floor is the measured 258,624 (#448)
deepseek-v4.1-flash-free's context is raised to the measured floor 258,624 (a 200 with upstream usage in 576 + cache_read 258,048 on 2026-10-26) whenever Zen's catalog reports less or nothing; a larger catalog value (262,144, 1,000,000) passes through. Output stays 32,000. Upstream data issue: anomalyco/models.dev#11768. Version 0.1.17.

Run at 4ff44683d6e326a2baaafa5fb12216b4298d0858, and merged onto main 95fa761, on mote (mote-run, sandbox HOME):
- bun test packages/zen-free: 200 pass, 0 fail (both trees).
- bun scripts/check.mjs zen-free: ok.
- Broke it by hand on the merged tree: always using the floor (no Math.max) and keying the floor to another id each turn the new test red (4 pass / 1 fail); restored, green.
- npm pack (0.1.17) and imported the packed index.mjs (exports ZenFreePlugin); buildModels over the live models.dev opencode catalog (deepseek-v4.1-flash-free at 200000/32000 today) gives context 258624, output 32000; big-pickle unchanged at 200000.
- npm has 0.1.16; 0.1.17 is free.

Not tried: a real request over 258,624 tokens; the true ceiling is still unknown. The code comment does not carry the models.dev issue link (it is in the PR body).
2026-10-28 23:42:14 +08:00
yetone 95fa76126d workbuddy 0.1.44: a huge chat's ids are hashed in pieces, and it is read once on every path (#461)
0.1.42 brought jihuayu's 45 MiB repro from 7 parses a request to 2, and
0.1.43 keeps that: one full parse and one full stringify a request. What
was left of the peak was attendChat: the conversation and turn ids were
made from template strings holding the whole user message (`first:${sig}`,
`u1:${sig}`, `${conv}|${turn}`, then `${SALT}|kind|${key}`), each a fresh
45 MB string, ~160 MiB of peak a request. The keys are now lists of
pieces fed to one sha256 each, whole (Bun hashes a one-byte string in
place; 1 MiB slices cost a copy and were worse), with a high surrogate
split between pieces held for the next one, so every id is the hash of
the same string as before.

Also read once on paths the repro doesn't take:
- "Free models only" parsed the body again for its model; it reads the
  chat prepared already parsed.
- A model known to want a reply after tools (11153) had the body parsed
  and stringified again on every request; the reply goes into the one
  parsed chat before the one stringify.
- The prepared result no longer holds the parsed tree past the send.

Every byte WorkBuddy sees is unchanged: sent.test.mjs runs 12 chats
(OpenCode tools, default effort, developer turn, after-tools refusal and
known, system refusal and known, both, Messages, bytes, not JSON),
switch off and on, and holds the gunzipped body's sha256, url, encoding
and which requests share an id to testdata/sent-0.1.43.json, made by
running the same harness on npm's 0.1.43 index.mjs (sha 9213db6d...).

Run on mote (Bun 1.4.2), the issue's benchmark.mjs as written but for
the import, 45.3 MiB body, 4 requests, concurrency 1, /usr/bin/time -l,
3 runs each:
  direct (no plugin)   336 MiB
  0.1.41               981-1117 MiB, 28 parses (1087.5 MiB), 24 stringifies
  0.1.43               717-760 MiB, 8 parses (181.3 MiB), 20 stringifies
  0.1.44               583 MiB all 3 runs, same counts, ~370-420 ms wall
                       (0.1.43 ~400-530 ms)
One request: direct 134, 0.1.41 569, 0.1.43 390, 0.1.44 275 MiB (with
id derivation stubbed out entirely: 229).
- HOME=$(mktemp -d) bun test in packages/workbuddy at this head:
  201 pass, 0 fail. bun scripts/check.mjs workbuddy: ok.
- Broken by hand, each red: free-only parsing again -> the free-only
  parse-count test; reply after tools put in by re-parsing -> the
  after-tools parse-count test; no surrogate hold -> the idFor pieces
  test; the reply put in before the system move -> sent.test.mjs.
gzip was measured too: Buffer.from before gzipSync made no difference
to the peak, so it is unchanged.

Not tried: a live WorkBuddy request; the reporter's Linux and Bun
1.4.4 (mote has 1.4.2); concurrency 4; a huge body that isn't ASCII
(Bun keeps it two-byte, so hashing it may copy); a huge Messages body
(its own path, not changed here).
2026-10-28 23:26:45 +08:00
yelo 25488a7c8f opencodereview 0.1.0: Open Code Review (ocr) as an agent plugin (#463)
New agent plugin @magpie-community/agent-opencodereview 0.1.0 (imyelo): Open Code Review (Alibaba's `ocr` CLI) on magpie's Agents page. connect writes `provider: "magpie"` and one `custom_providers.magpie` object (gateway base url, protocol anthropic, magpie's key for ocr) into ~/.opencodereview/config.json; magpie writes `model`. Registered in registry.json and the README's Agents table.

Reviewed at 3ea944df15c566aabf2235a147da868ea1e64f02.

Run at that sha (on mote, macOS arm64, Bun 1.4.2):
- `HOME=$(mktemp -d) bun test packages/opencodereview`: 8 pass. `bun scripts/check.mjs opencodereview`: ok (it skips agent packages). Full `bun test`: 0 fail, both at the sha and merged with main d8cfee3 (3050 tests).
- Broken by hand, each went red: url = gateway.v1 (3 fail), protocol openai (2 fail), provider anthropic (3 fail).
- magpie's real engine (scratch internal/agent test at magpie ff6fdffd6, not committed) loading this agent.js: connect then Unwire on a fresh home (leaves `{"custom_providers":{}}`, as the README says), on a config with a pre-existing custom_providers.magpie holding extra keys plus other providers/mcp_servers (restored exactly), and on another active custom provider (restored exactly).
- End to end: ocr v1.13.3 built from source, `ocr llm test` against magpie's real gateway (in-process, sandbox HOME) with a fake OpenAI-compatible upstream: "Source: provider:magpie", URL <gateway>/v1/messages, "Connection test successful", "Tool-call round trip verified"; upstream got both turns.
- Checked against ocr's source (internal/llm/resolver.go): custom_providers keys, `magpie` is not a preset name, anthropic protocol appends /v1/messages, UA is "open-code-review/<ver>", config path is ~/.opencodereview/config.json. Nothing goes upstream naming magpie; the plugin sends no data and downloads nothing.

Not tried: a real vendor account behind the gateway, Linux and Windows, ocr review/scan on a real repo.
2026-10-28 23:07:35 +08:00
yetone d8cfee3bba autoclaw 0.2.10: WorkBuddy's "powered by GLM-x" opening line and "You are CodeBuddy Code" are rewritten, not a 406 (#466)
larrylinli (plugins#466, Windows, magpie 0.1.1844, autoclaw 0.2.9,
autoclaw-cn/zaicoding_glm-5.3) had every first WorkBuddy 5.9.3 request
fail with 406 in 0 / out 0. WorkBuddy renders a custom GLM model into
the system prompt's opening line, "This conversation is powered by
GLM-5.3 · AutoClaw 国内 (Zhipu)", which is ZCode's opening-line wording.
The reporter bisected the real 163,730-byte request against the CN
gateway: "This conversation is powered by GLM-<version>" is a 406 in any
case and anywhere, while a bare "GLM", "ChatGLM-5.3", "The conversation
..." and "powered by the GLM-5.3 model" are 200; the whole request
replayed with only that line rewritten is a 200. A second string,
"You are CodeBuddy Code" (WorkBuddy's CLI template), is also a 406 in
their probes; "You are CodeBuddy" passes.

So the request content is refused, not the account or the model: a
small request on the same account and channel 0.4s earlier was a 200.
FLAGGED gets both, with the rewrites the reporter found answered:
- "This conversation is powered by GLM-<v>" -> "... by the GLM-<v>
  model" (the version stops before a sentence's closing period);
- "You are CodeBuddy Code" -> "You are the CodeBuddy Code CLI".
Like every FLAGGED entry they apply to system and developer messages on
both channels; a user message is left as written.

This is not the workbuddy plugin: WorkBuddy is the client here, sending
to magpie, and the provider is AutoClaw. workbuddy 0.1.43's effort and
gzip change is unrelated.

Run (mote): HOME=$(mktemp -d) bun test packages/autoclaw (40 pass);
bun scripts/check.mjs autoclaw green.
Broken by hand: HEAD's index.mjs with the new test: red (Received "This
conversation is powered by GLM-5.3 · AutoClaw 国内 (Zhipu)").
Not tried: the real AutoClaw gateway (no AutoClaw account here); the
406/200 table is the reporter's. Not changed: a general shape-based
fallback (#236) instead of one entry per string.
2026-10-28 22:46:17 +08:00
edx 68794bacfc trae 0.2.24: a Kimi model's tool schemas get the types Moonshot requires (code 4027) (#462)
Trae passed a request's tools to the model as they were. Moonshot (Kimi) refuses the whole request when a schema node has no type: Trae answers code 4027, "tools.function.parameters is not a valid moonshot flavored json schema … type is not defined". Claude Code's enum-only properties trigger it. For a model whose config, model_name or request model matches /kimi|moonshot/i, nativeTools now deep-clones each tool's parameters and rewrites them with kimi-work's moonshotSchema (ported). An enum or const with no type gets the type its values have, and a $ref beside a type and a type beside an anyOf are written the way Kimi takes them. Other models' tools, and schemas Kimi already accepts, go byte for byte. README note, new moonshot.test.mjs, and 0.2.23 -> 0.2.24.

By edifierx666 (#462).

Reviewed at 4c8dc7401f74fb44615bcb70ee0178337a017951. The only change since is 31c88fe84 (maintainer): the README's Kimi bullet moved after the native-tools bullet's continuation paragraph. The text is unchanged.

Run at 31c88fe84 (macOS, via mote-run, sandbox HOME): bun test packages/trae, 221 pass, 0 fail; bun scripts/check.mjs trae passes. Run at 4c8dc7401 as well: the same 221/0, plus check.
Broken by hand at 4c8dc7401, running moonshot.test.mjs:
- moonshotModel always false: 4 of 6 red.
- Always true: the non-Kimi test red.
- structuredClone dropped: red.
Edge cases run through chatBody, 18 schemas: null, mixed, object and empty enums; nullable; anyOf/oneOf; nested objects; arrays without items; untyped and self $refs; boolean schemas; properties named enum or const. glm-5's parameters are byte-identical in every case. For Kimi, enums and consts only gain a type.
Not tried: a live Trae CN or Trae Global request (the author ran Trae CN live, per the PR).
2026-10-28 22:30:12 +08:00
yetone f4d48ac3ee workbuddy 0.1.43: a chat names the model's default effort as WorkBuddy's client does, and goes gzipped
troilus1011 on X: WorkBuddy's DeepSeek in OpenCode through magpie thought
at low and high, never at the default. OpenCode's default variant names
no reasoning_effort, and WorkBuddy doesn't think without one: measured on
www.workbuddy.ai with 0.1.42, deepseek-v4.1-flash gave 0 reasoning
tokens with no effort (2 of 2), 0 at none, 16/37 at low, 34/56 at high.
WorkBuddy's own client (CLI 2.165.0 in WorkBuddy 5.9.3,
configureThinkingSettings) sends the session's effort, else the
reasoningEffort setting, else the model's reasoning.defaultEffort from
/v3/config, which is "high" for this model on both builds. A chat that
names no effort now gets the model's own defaultEffort when its listed
levels hold it, read from the same cached /v3/config list (one read per
minute; a failed read leaves the chat as it came and is not retried on
every chat). An effort the client names, none included, is untouched and
the list isn't read for it. Models with no reasoning config get nothing.

runmiNeverstop on X: 2.89 GB up to copilot.tencent.com through magpie.
WorkBuddy's client gzips a model request's body (GzipRequestProcessor,
on with productFeatures.RequestBodyGzip, true in both builds'
product.json and not turned off by the remote config); the plugin sent
it as plain JSON. Agent chat JSON (the whole history each turn, tool
schemas) compresses several-fold, so the upload was several times what
the official client sends for the same turns. A chat-completions body
now goes gzipped with Content-Encoding: gzip on both builds;
unanswered() weighs the gzipped size against the front door's 2 MiB.
Claude's Messages route goes as it came (not tried gzipped live).

Run (on mote, HOME=$(mktemp -d) bun test in packages/workbuddy): 197
pass, 0 fail. bun scripts/check.mjs: exit 0. Fakes that parse the sent
body gunzip it (testdata/unz.mjs); reset.test.mjs's 2 MiB bodies are
random base64 so they stay over 2 MiB on the wire.
Live (www.workbuddy.ai, a real account in a sandbox HOME): with 0.1.43
the default sent reasoning_effort high gzipped and thought (34 and 51
reasoning tokens), none stayed 0, low and high as before, all 200. A
gzipped chat answered 200 the same as a plain one.
Broken by hand: origin/main's index.mjs with the new
default-effort.test.mjs: 5 of 8 red (default effort, failed-read reuse,
both gzip tests, defaultEffortOf); the 3 that pass guard what must not
change (named efforts, models without a default, Messages).
Not tried: a live chat on the China build (copilot.tencent.com answered
401 to every token available here, its /v3/config read fine); Messages
gzipped; the reporters' own OpenCode sessions end to end.
2026-10-28 22:23:20 +08:00
yetone 08e3ba8990 kimi-work 0.1.14: a spent allowance's 403 goes out as a 429 (#465)
Kimi answers an account whose allowance is used up with a 403 ("You've
reached your usage limit for this billing cycle", resource_exhausted
"insufficient balance"). The plugin passed it through, magpie read a
403 as a key fault, never rested the account, and kept routing to it
while another account with quota sat idle (kongbai01203: 6+ requests in
20 minutes to the spent one after the other answered 200).

A 403 whose body says resource_exhausted, usage limit, billing cycle,
insufficient balance or quota now goes to magpie as a 429 with Kimi's
body and headers (content-encoding/length dropped, the text is
decoded), the pattern Devin's, Qoder's, Kiro's and Cline's plugins use
for a spent quota. magpie's quotaStatus counts 429 as spent and moves
on. Any other 403 stays a 403 with its body.

Run (on mote, HOME=$(mktemp -d) bun test in packages/kimi-work): 69
pass, 0 fail. bun scripts/check.mjs: exit 0.
Broken by hand: status:spent?429:403 changed to status:403; the three
new spent-allowance tests went red (66 pass, 3 fail), green again with
the fix back.
Not tried: a real spent Kimi Work account. The issue gives Kimi's words
but not the JSON around them, so the fixtures try them in an
OpenAI-style error, a Connect body and a nested Connect error. Not
checked end to end that magpie then rests the account until the cycle
resets (Kimi sends no reset time; magpie's own rest length applies).
2026-10-28 21:02:21 +08:00
yetone 1f015f1b1e qoder 0.2.46: b7bbc9d's record (it went out under a stale 0.2.43 subject)
b7bbc9d is "qoder 0.2.46: credits used up leave the free models counted
out, so magpie still routes them"; its message was a stale file from an
earlier commit (a noclobber write that failed). No code changes here.

coeo91 on Discord: a Qoder account whose credits are spent still serves
its free models, but magpie treated it as spent for every model. Qoder's
own docs say so: "When Credits run out, you can continue using free basic
models, subject to daily and monthly limits" (docs.qoder.com/Credits; the
zh page: "Credits 用尽后,仍可使用免费基础模型"). The usage hook's credit
windows counted every model, so a plan used up, or a free account's
"0 credits left" (0.2.45), read 100% for Qwen3.8-Flash and DeepSeek-Flash
too, and magpie's routing put the account last or skipped it for them.

Each credit window from the usage hook (Qoder and Qoder CN, device and PAT
paths) now names the account's free models in notModels, as WorkBuddy's
does since 0.1.23 (plugins#138). magpie's plugin_usage.go reads notModels
into the window's model scope, so Allowance.For/Full/Pooled skip it for
those models. Free is the listing's own (freeOf: 0x, not a promotion's 0
for a while); the listing is the cached one the models hook read, asked
once when none is cached. A listing that can't be read, or that lists no
free model, leaves every model counted, as before. QwenWork (its own usage
path) is unchanged: nothing from it says its free models outlast the
credits.

Run: HOME=$(mktemp -d) bun test in packages/qoder on mote (309 pass);
bun scripts/check.mjs qoder (ok).
Broken by hand: spareFree returning at once, spare-free.test.mjs 6 of 10
red (the four left are the as-before cases).
Not tried: a real account with its credits used up (the owner's has
add-on credits left); the fixtures are Qoder's envelope and listing shapes
from the existing tests.
2026-10-28 19:17:18 +08:00
yetone b7bbc9dc06 qoder 0.2.43: the check-in says when to ask again, as the 10:00 (UTC+8) campaign opens
sdytman on Discord: Qoder's daily credits start at 10:00, can the plugin's
check-in follow it? Qoder's /me/campaigns lists each day's CLAIM_BENEFIT
campaign with startAt 10:00 and endAt 09:59 the next day, both UTC+8
("Daily reset: 10:00 (UTC+8)"), read with a real account at 09:27 CST on
10-28. Qoder.app 0.4.3 polls that list every 5 minutes and treats
startAt <= now < endAt as active; there is no next-time field. A check-in
before 10:00 met yesterday's campaign, and magpie settled for the Beijing
day, so today's campaign waited until tomorrow, or was lost.

checkin now returns until: the next campaign's opening (the later of
endAt and startAt + 1 day, or the next startAt in the gap) plus a minute,
on done, claimed and "not offered yet". All in epoch time, so the
machine's zone doesn't matter; qoder and qoder-cn share the code. magpie
asks again at until once it reads it (yetone/magpie, next release).

Run (mote): checkin-window, native-checkin and checkin tests under
TZ=UTC, Etc/GMT+8 and Asia/Shanghai, 66 pass each; HOME=$(mktemp -d)
bun test, 2938 pass 0 fail 8 skip; bun scripts/check.mjs. A real qoder
account at 09:35 CST: claimed 100, until 2026-10-28T02:01:00Z.
Broken by hand: nextOpens returning endAt only, 11 of 13 checkin-window
tests red; askAgain returning {}, 12 of 13 red.
Not tried: a real Qoder CN account (none here); the server's list in the
09:59-10:00 gap.
2026-10-28 19:16:54 +08:00
yetone f2b0dacdb7 workbuddy 0.1.42: a chat is parsed once on its way, and goes as it came when nothing changed (#461)
jihuayu measured a 45 MiB chat going through 0.1.41's fetch: each step
(withSystem, fitted, normalizeToolChoice, attend, the model, systemKey)
parsed the whole body again, 6 parses a request, and normalizeToolChoice
wrote it out whole even for an unchanged "auto". Bun's RSS reached 618-751
MiB for 4 serial requests where passing the body through took 270.

prepared parses a request once. Each step makes its own change to that one
object, in the same order (systemOn, fitTools, toolChoiceOn; unsignedOn
for Messages). attend, the model and the system key read the same object,
and a refused system prompt moves on it (systemAsUserOn). The body is
written out once, only when a step changed it. The parsed chat is let go
before the request is sent. A body a step throws on goes through the steps
one by one, as before. The string-level helpers stay as wrappers.

What was run, on this tree:
- mote, the reporter's benchmark (no network, fetch stubbed, 4 x 45.3 MiB,
  peak RSS sampled every 5ms): 0.1.41 7 parses/request, 1087.5 MiB parsed,
  peak RSS 1096 / 979 MiB. This change: 2 parses/request (the request and
  the stub's SSE reply), 181.3 MiB parsed, peak 682 / 680 MiB. The bodies
  sent have the same SHA-256 in both.
- HOME=$(mktemp -d) bun test packages/workbuddy on mote: 189 pass, 0 fail.
  bun scripts/check.mjs workbuddy: ok.
- oneparse.test.mjs (new): 17 chat shapes, invalid JSON and bytes come out
  the same as the steps one by one made them, with the same tool names; an
  unchanged chat goes byte for byte; the loader parses a 2 MiB chat once.
  Broken by hand: every request sent through the step-by-step fallback,
  the loader test FAILs (5 parses, want 1). An unchanged "auto" counted as
  a change, the byte-for-byte test FAILs.
- Real account (WorkBuddy AI, free-only on, sandbox HOME, this Mac):
  deepseek-v4.1-flash, a 373-byte chat and a 205,595-byte chat with a
  developer message, max_completion_tokens and a dotted tool name, through
  0.1.41 and this change: 200 "OK" on all four; no sign-in refreshed.

npm has 0.1.41, so 0.1.42 is free.

Reported-by: jihuayu
2026-10-28 18:46:03 +08:00
yetone 8f81a8aeb8 cursor 0.2.29: a native Run over HTTP/1.1 sends its history's blobs 16 at a time
ysm119 on Discord: Cursor models 30 s+ to first token, 1-4 min a turn.
0.2.28 (d9c858c) let BidiAppends go 16 at once, but only on runOnce, the
stateless fallback. Every real request goes through runNative, which
still opened HTTP/1.1 with atOnce=1, and nativeTransport.flush waits for
each write's callback, i.e. each append's answer. Cursor asks for every
history message as a KV getBlob, so a Run that fell back to HTTP/1.1
(a proxy or network that blocks h2) paid one ~265 ms round trip per
message before the model started.

Now runNative opens with H1.atOnce and kvReply: KV replies (field 3,
kv_client_message) overlap up to 16 at a time; any other message (a tool
result, the close) waits for every append before it, goes alone, and is
written once Cursor answered it, so it is never uncertain.

Measured with the real Cursor account in a sandbox HOME (bun 1.4.2,
this Mac; FORCE_H1 points h2 at a dead port so the Run falls back):
- HTTP/2, old and new alike: short prompt 5.0 s cold / 1.8 s warm;
  30-step agent request (121 messages, 40 tools, 233 KB) 6.5 / 2.9 s;
  100 steps (590 KB) 6.2-7.3 / 4.0-4.2 s.
- HTTP/1.1, 0.2.28: 30 steps 37-39 s to first token (~135 appends
  one after another); 100 steps 117-130 s.
- HTTP/1.1, 0.2.29: 30 steps 4.4-9.1 s; 100 steps 9.0-13.2 s (8 runs on
  grok-4.7@256k, 3 on composer-2.5), each answer correct about step 17
  and the first message, so the blobs arrive whole. A 6-turn tool loop
  over HTTP/1.1: turn 0 6.3 s, later turns 2.6-3.0 s.
- One early 0.2.29 run (100 steps) ended in a 187-byte error whose
  status wasn't captured; 11 runs after it, with the body printed,
  all passed. Its cause is unknown.

Run: bun test packages/cursor on mote, 316 pass 0 fail;
bun scripts/check.mjs cursor ok.
Broken by hand: runNative passing 1 again turns the two stall tests red;
the alone barrier disabled turns 4 red (the new openH1 test,
result-before-close, both uncertain-append tests).

Not tried: Opus (the account has no weekly quota for it, 429); the
reporter's own network or proxy, so whether he is on HTTP/1.1 is not
known; Cursor's own client as a baseline; a full sandbox magpie with
0.2.29 installed.
2026-10-28 15:59:22 +08:00
wky114 c00f40eb01 raccoon 0.1.4: read the desktop auth.json in the client profile on macOS and Windows (#459, wky114)
Current Raccoon desktop builds keep the session in a client profile, not in
~/.box-agent, so desktop sign-in answered "not detected" while the app was
signed in (wky114). Raccoon desktop 1.1.3's app.asar (clientProfile.ts)
puts it at <profile>/agent/config/auth.json, the profile being
~/Library/Application Support/office-raccoon on macOS and
%USERPROFILE%\.office-raccoon on Windows. The plugin now reads the Windows
profile, the appData profile, then ~/.box-agent, first file found wins; the
RACCOON_BOX_AGENT_CONFIG_DIR / BOX_AGENT_CONFIG_DIR overrides still come
first. Labels and the not-found error no longer name one path.

Review fixup (cb46111): the PR had only ~/.office-raccoon, which is the
Windows layout, and its test was red at f55d949 (Bun reads homedir() once,
so setting HOME did nothing). desktopAuthCandidates takes home/platform/env
and the tests pass them per OS. Version 0.1.4.

Run at cb46111: bun test in packages/raccoon on mote (38 pass) and on
Windows (38 pass); whole repo bun test on mote (2999 pass, 8 skip);
bun scripts/check.mjs ok. Broken by hand: without the appData profile
both desktop tests are red. Not tried: a real signed-in Raccoon desktop.

Co-authored-by: wky114 <38514103+wky114@users.noreply.github.com>
2026-10-28 15:27:33 +08:00
yetone 944610f8c8 cursor: each test file mints sign-in tokens of its own
The publish run for d9c858c (cursor 0.2.28) went red in
conversation.test.mjs: its first Run went to 127.0.0.1:42583, a closed
agent server of listwait.test.mjs, got ECONNRESET and fell back to
HTTP/1.1, which its fake API doesn't answer. listwait's tokens were
{exp: now+7200+n} with a counter from 0, byte for byte the tokens
conversation.test.mjs mints, so within one second the plugin's agent
endpoint and model list kept for listwait's token were found by
conversation's. conversation, maxmode and usage had the same latent
collision with each other. Each of those files, and context's tokens,
now carry a sub of their own (as http1, latency and the native tests
already did).

Run: on Linux (wsl-run), listwait then conversation was red 6 of 6
before and 0 of 6 after; listwait, conversation, maxmode and usage in
one run 0 of 4 red; bun test packages/cursor 314 pass. On mote, the
whole repo's bun test (2997 pass, 0 fail) and bun scripts/check.mjs (ok).
Broken by hand: the failing order was found by replaying CI's file order
and logging open()'s HTTP/2 failure (ECONNRESET to listwait's port).
Not tried: CI's exact random order beyond the replay.
2026-10-28 14:49:59 +08:00
yetone d9c858c3c0 cursor 0.2.28: a Run over HTTP/1.1 sends its BidiAppends 16 at a time, as cursor-agent does
Over HTTP/1.1 (where HTTP/2 can't open a Run) each client message goes up
as a BidiAppend. openH1 sent them strictly one at a time, so a new Run's
history (one blob a message, which Cursor asks for all at once) cost a
round trip to api2.cursor.sh per message before the model could start:
hundreds of round trips for a long conversation. cursor-agent 2026.10.01
(startAppendingInputs) keeps up to 16 appends in flight, numbered by
seqno (`m.length>=16&&await Promise.race(m)`).

openH1 now keeps up to atOnce (H1.atOnce, 16) appends on their way, in
seqno order; past that a write waits for one to finish. A native
session's Run passes 1: it counts a write as done only when Cursor
answered that append, so a tool result is never uncertain (the native
HTTP/1 tests hold that, maxInFlight 1). Seen from ysm119's report
(33-36 s to first token on claude-opus-5-5); whether he is on HTTP/1.1 is
not known.

Run: bun test packages/cursor (314 pass, 0 fail) and
bun scripts/check.mjs cursor (ok), on mote.
Broken by hand: with openH1 back to one at a time, the new http1 test is
red (most in flight 1, expected > 1). With runNative not passing 1, five
native-http1 tests are red (maxInFlight 3, uncertain-append and writeWait
cases), so the serial contract is held there; open.test.mjs's serial
openH1 tests now ask for atOnce 1 by name.
Not tried: a real Cursor account over HTTP/1.1; the serial cost was not
measured against Cursor itself, only counted against a fake.
2026-10-28 14:38:50 +08:00
yetone fc1457162c cursor 0.2.27: a chat request no longer waits for a model list Cursor can't give
ysm119 on Discord: claude-opus-5-5 through the plugin takes 33-36 s to its
first token on every request. A chat request picks its variant from the
account's model list (AvailableModels, up to 30 s) before it opens its
Run. A list Cursor couldn't give was never kept, so every request asked
for it again and waited for the ask to fail before its Run; a list past
its 10 minutes was waited for again too, and requests at once each asked.

listFor now gives the chat path the list without waiting when it needn't:
a list past its keep is used while a new one is asked for in the
background, requests at once share one ask (listing), and after a failed
ask requests go without the list for 5 minutes (LIST_RETRY), as the first
one did. Only a token with no list and no recent failure waits.
provider.models still fails when Cursor can't list, so magpie keeps its
list.

Measured against a fake Cursor (bun 1.4.2, on mote): with AvailableModels
failing after 3 s, every request's setup was 3003 ms before, re-asked each
time; the plugin's own setup is ~20 ms cold, ~4 ms warm, and stream
chunks reach the client 0-7 ms after the server writes them.

Run: bun test packages/cursor (314 pass, 0 fail) and
bun scripts/check.mjs cursor (ok), on mote.
Broken by hand: on the old index.mjs all three listwait.test.mjs tests
are red; with only answerOf back on usable(), the failed-list and stale-
list tests are red.
Not tried: a real Cursor account (its token is in the Keychain); whether
ysm119's AvailableModels fails or is slow is not confirmed.
2026-10-28 14:38:01 +08:00
yetone 2c30818458 devin 0.1.25: an anyOf beside a type, below a tool's root, goes to Gemini models as a merged branch or a oneOf (#458)
songyq26's Kimi Code Read tool (line_offset: anyOf of two integers) and
any Optional field made every devin/gemini-4-argon request 400 "There is
an issue with this request". The cause is a type beside the anyOf:
magpie's gateway (geminiToolTypes) writes the type the branches agree on
beside an untyped anyOf for a Gemini-named model, and Devin's Gemini
models refuse {type: T, anyOf: [...]} anywhere below the root. An untyped
anyOf, a root anyOf and a oneOf beside a type are taken, which is why the
reporter's matrix showed oneOf as OK.

geminiSchema now changes only an anyOf beside a type, at depth > 0: null
branches become nullable, one branch left of the same type (or none) is
merged into the schema, two or more go as a oneOf (into allOf if a oneOf
is already there). The recursion already reaches properties, items,
additionalProperties and anyOf/oneOf/allOf members, so each gets it.

Run:
- HOME=$(mktemp -d) bun test in packages/devin (on mote): 119 pass, 0 fail.
  bun scripts/check.mjs devin passes.
- Broken by hand: with index.mjs at origin/main, 9 new tests fail
  (8 fixtures incl. kimiRead from the reporter's literal line_offset, and
  the unit test); the 30 others pass.
- Real account, plugin fetch to gemini-4-argon: on 0.1.24, typed anyOf in
  properties / items / of objects and Kimi's line_offset with the
  gateway's type 400; untyped anyOf, root anyOf and typed oneOf 200. With
  this change all 17 probe shapes 200. A first try that turned every
  nested anyOf into a oneOf made {nullable, oneOf} with no type, which
  Devin refused, so untyped anyOf is left as it came.
Not tried: Claude / swe-2 models live (their path is unchanged);
other plugins (grok, qoder, workbuddy, kimi-work) have their own
cleaners for other vendors' rules and don't share geminiSchema.
2026-10-28 13:21:49 +08:00
yetone c2eb8de4f7 codearts 0.2.4: every model is text only, and an image it refuses is a 400
star21321321124 (Discord, magpie 0.1.1818, codearts 0.2.3): DeepSeek V4.1
Flash through a Codex-like agent failed often with "CodeArts: The request
model is not multimodal (InferHub.001001020.406) (502: you can retry your
request)", while CodeArts' own client served it.

Cause: the plugin listed its models with capabilities.input { text: true }
and no image key, and the config hook gave no modalities. magpie's host
reads image as said only when it is a boolean (imageSaid), so every
CodeArts model was "unknown" to magpie: an agent's screenshot or a tool
result's image went upstream as sent, instead of being described by the
Vision model or left out (textOnlyBody). CodeArts then answered
InferHub.001001020.406 inside a 200, which embeddedErrorStatus counted 502,
and magpie told the agent to retry, so it asked again with the same image.

- The config hook declares attachment false and modalities text in, text
  out; provider.models says input.image false (and audio, video, pdf) for
  every listed model. A kind the user's own config says stands. The -vl
  models were already left out of the list.
- InferHub.001001020.406 / "not multimodal" is a 400: inside a 200 (stream
  and folded JSON), and with any HTTP status. foldAnswer's own error now
  goes through embeddedErrorStatus too, instead of a flat 502.

Run (on mote): packages/codearts HOME=$(mktemp -d) bun test, 117 pass;
the whole repo's bun test, 2985 tests 0 fail; bun scripts/check.mjs ok.
Broken by hand: the new tests against origin/main's index.mjs go red, 3
of 3 (the 400 on every path, the text-only declaration, the status map).
Not tried: a real CodeArts account with an image (none here); the exact
body CodeArts sends is taken from the reporter's message (error_code /
error_msg shape as its other embedded errors).
2026-10-28 13:08:49 +08:00
xiaomu 0f0e966402 river 0.1.0: River with your API key, per-account models, efforts and live prices (#390)
packages/river (@magpie-community/opencode-river-auth 0.1.0, provider `river`):
River's OpenAI-compatible inference API with the user's API key. Models come
from GET /v1/models, limits, image input and reasoning efforts come from
docs.river.ai, and live prices come from River's public pricing endpoint
(BOOT_PRICES as the fallback). Unknown ids are text-only. A 401 or 403 marks
the sign-in expired. The usage card says "Pay as you go". It adds River's
rows to registry.json and the README.

River runs open-weight models on its own GPU fleet (river.ai). It is not a
relay of other vendors' APIs.

Run at the reviewed head 751e502, merged onto main c0a0fd1, on mote (Bun 1.4.2):
- HOME=$(mktemp -d) bun test: 2975 pass, 8 skip, 0 fail across 250 files.
- bun test packages/river: 25 pass. bun scripts/check.mjs: ok.
- A probe with a fake fetch built from River's documented shapes and today's
  real /api/public/pricing body (ids GLM-5.3, Kimi-K3, DeepSeek-V4.1-Flash):
  - The rows have the documented limits. GLM-5.3 is text-only, the others take images.
  - Each variant carries { reasoningEffort } with the documented levels.
  - The costs come from the live prices.
  - 401 throws signIn "expired" from models and from usage.
  - A 503 or a network failure keeps the previous list.
  - An empty list replaces the bootstrap rows.
  - A provider the user configured is kept.
  - RiverPlugin is the only exported function.
- Today's docs.river.ai/guides/inference-models and inference-controls
  match LIMITS, IMAGES and VARIANTS.
- An earlier review round (at 233919f) broke the code by hand and saw the
  river tests go red.

Not tried: a live River key (I don't have one; the author ran one).
Known gap: GLM-5.3 (pricing id "GLM-5.3") has no LIMITS or VARIANTS row, so
it lists with unknown limits and no efforts. It is text-only, so this is
safe.
2026-10-28 12:55:32 +08:00
yetone c0a0fd1955 qoder 0.2.45: a free account with no credits shows none left, not nothing
Ariel on Discord: an international free Qoder account signed in fine but
showed no credits. A free account (userType personal_standard, Qoder's
"Experience" plan) has a plan pool of 0 and, until it gets add-on credits,
nothing else. parseUsage drops every pool whose total is 0, so such an
account came out with no window at all and magpie had nothing to show.
Qoder's own client (Qoder.app's buildUsageItemGroups) shows every pool
present, 0/0 included, and counts the account out of credits when what the
pools have left adds up to 0. Now, when no pool gives a window and the plan,
add-on or shared pool reads a total of 0, the account has one "Credits"
window, "0 credits left", used up. A pool that can't be read (a string
total) or no pools at all still say nothing. An account with credits in any
pool is shown as before (the owner's free account: plan 0, add-on 7 / 600,
one Add-on window, unchanged). Same parser for qoder-cn.

Run: HOME=$(mktemp -d) bun test in packages/qoder on mote (299 pass) and
bun scripts/check.mjs qoder (ok).
Broken by hand: the new test against origin/main's index.mjs, red (it reads
no windows).
Read-only real read of the owner's intl account's /sash/api/v2/me/usage
for the envelope's shape (personal_standard, usageType credits, plan 0/0).
Not tried: Ariel's own account; the fixture is the owner's free envelope
with the add-on pool at 0 or absent, since the owner's has add-on credits.
2026-10-28 12:34:33 +08:00
yetone 1fb8d68c99 registry: add Bub (agent-bub)
The plugins page lists Bub, merged in #81. Run on mote: bun scripts/check.mjs all ok, whole bun test (temp HOME) 2949 pass, 0 fail.
2026-10-28 12:32:23 +08:00
GabiandGabyran 51f179057b agent-bub 0.1.0: Bub as a magpie agent plugin (#81)
Adds packages/bub: Bub (bub.build) as a magpie agent plugin. It writes
~/.bub/config.yml with the model as magpie:<provider>/<model> and a
providers.magpie entry (type openai, magpie's /v1, Bub's own key), and
puts the file back when one of Bub's own models is picked or it is turned
off. Needs Bub 0.5.1 or later (bubbuild/bub#343). Plus its row in the
README's Agents table, which is now in alphabetical order.

Reviewed at 4b879fb (2026-10-11), with a real Bub 0.5.1 run against a
sandbox magpie. Since then only merges of main; the PR's own diff from the
merge base is the five files above, packages/bub unchanged since 4b879fb.
It waited only for a first npm publish, which the repo no longer requires
(README: a new plugin merges once its review is done; served from dist).

Run on mote at the merged tree (origin/main 202ec68 + head 13058fe92),
Bun 1.4.2: bun test packages/bub 7 pass; bun scripts/check.mjs all ok;
whole bun test with a temp HOME and TMPDIR 2949 pass, 8 skip, 0 fail.

Co-authored-by: Gabyran <Gabyran@users.noreply.github.com>
2026-10-28 12:31:02 +08:00
yetone 202ec68ffd qoder 0.2.44: a spent plan beside add-on credits left is no account used up (#454)
chansee97's Qoder CN trial had its plan's 300 credits spent and 245 of
1,100 add-on credits used, and Routing read the account as 0% left: each
pool was a window of its own, and routing counts the tightest. Qoder spends
the pools one after another before an account stops (docs.qoder.com/Credits:
soonest to expire first, the plan's before add-on on the same day; teams:
then the organisation's shared add-on credits), and its own envelope's
totalUsagePercentage counts them as one. So when more than one of the plan,
add-on and shared pools holds credits in the same unit, "Total credits" is
what they hold together (545 / 1400 here, 61% left) and the one routing
counts, and each pool is shown beside it set aside, as CodeArts' buckets
are under its total. One pool alone is shown as before. Dedicated packages
are left as they were (no word from Qoder on their order).

Run: bun test in packages/qoder (298 pass) and scripts/check.mjs, on mote.
Broken by hand: the new tests against origin/main's index.mjs, red (#454's
reads 0% left; the rotated-token test's windows differ).
Read-only real read of the owner's Qoder account's /sash/api/v2/me/usage:
plan total 0, add-on 7 / 600, which stays one window, unchanged.
Not tried: a real account with both a plan and add-on credits (the owner's
has no plan credits); the fields are the ones that read returns.
2026-10-28 10:29:31 +08:00