Commit Graph
539 Commits
Author SHA1 Message Date
yetone b2fe48ea2e workbuddy 0.1.40: chats carry the current desktop client's headers
WorkBuddy accounts are being restricted, and a report says WorkBuddy now
checks request-header fingerprints. Diffed the plugin's chat request
against each build's current desktop app, read (never run) from the
update feeds on 2026-10-28:
- China: WorkBuddy 5.9.3.42398134 (copilot.tencent.com/v2/update),
  bundled @genie/agent-cli 2.165.0.
- WorkBuddy AI: 5.8.4.41366630 (www.workbuddy.ai/v2/update), CLI 2.161.0.
The chat is the CLI's OpenAI client (openai 6.25.0) through
axiosToFetchAdapter, with UserAgentHttpInterceptor and the desktop's
CLIENT_INFO_* env (sidecar-manager getCachedBaseEnv).

What differed, and now matches:
- User-Agent: was WorkBuddy/5.5.6; the client sends
  "WorkBuddy/<app> <applicationName>/<app> CLI/<cli>":
  WorkBuddy/5.9.3 WorkBuddy/5.9.3 CLI/2.165.0 (China),
  WorkBuddy/5.8.4 workbuddy-ai/5.8.4 CLI/2.161.0 (AI). The /v3/config
  models call (was CLI/2.0.0 WorkBuddy/5.5.6) takes the same one, as the
  CLI's CloudProductProvider sends it through the same interceptor.
- X-IDE-Version: was 5.5.6; now the app's version.
- X-Agent-Type: main was sent on WorkBuddy AI only; the adapter sets it on
  every model call on both builds.
- X-Agent-Runtime: local-agent, new in 5.9 (the desktop's local transport
  puts agentRuntime local-agent in the prompt meta); China build only,
  5.8.4 has no such header.
- Accept: application/json and the OpenAI SDK's X-Stainless-* (Lang js,
  Package-Version 6.25.0, OS/Arch of this machine, Runtime node,
  Runtime-Version v22.21.1 = Electron 37.10.3's Node, Retry-Count 0,
  Timeout 1200); the adapter strips them only in its skip-auth mode.
- The desktop's own calls (billing, plugin API) send WorkBuddy/<app>;
  they now send the current app version instead of 5.5.6.

Not matched: X-Device-Token (TuringShield native SDK, sent since at
least 5.6.2), traceparent (only while server-side tracing is enabled),
and transport-level differences (Bun's fetch vs axios on Node: header
order, Accept-Encoding).

Run: HOME=$(mktemp -d) bun test packages/workbuddy: 184 pass, 0 fail.
With the old index.mjs the 4 changed tests fail (UA, IDE version,
config UA, the new per-build header test).
Not tried: a real account's chat or /v3/config with the new
User-Agent (unauthenticated /v3/config answers the same for old and new).
No text added names magpie or WorkBuddy's limits.
2026-10-28 03:20:46 +08:00
MYCF711 47cda88fbe registry: add OfficeAce (officeace-auth) (#399)
Adds the OfficeAce entry (officeace-auth, provider officeace, community: true)
to registry.json. Reviewed at 5c61f65965d15f6abf09e2f8bcc91b7d07df670e.

The 10-27 review blocked it on src/self-register.mjs in officeace-auth 0.1.8,
which rewrote magpie's ~/.cache/magpie/plugin-market.json on every load.
officeace-auth 0.1.9 (npm, 2026-10-27T16:24Z) removes it.

What was run:
- npm pack officeace-auth@0.1.9 and @0.1.8, diffed the trees: 0.1.9 drops
  src/self-register.mjs and its call, the `directory` argument and
  REGISTRY_ENTRY; adds CHANGELOG.md and publish-npm.mjs (an author-side
  publish helper, imported by nothing, no install scripts, no dependencies).
- grep over index.mjs and src/: no fs writes, child_process, eval or
  HOME/cache paths. Hosts: auth.huaweicloud.com, sts.cn-north-4.myhuaweicloud.com,
  agentarts.cn-southwest-2.myhuaweicloud.com,
  officeace.cn-southwest-2.huaweicloud-agentarts.com, api.modelarts-maas.com.
- Load probe in a sandbox HOME with a seeded plugin-market.json in
  ~/.cache/magpie and ~/Library/Caches/magpie, fetch stubbed to fail: 0.1.9
  leaves every file's mtime unchanged and makes no request at load; the same
  probe on 0.1.8 changes the cache file (the probe sees the write).
- Merged with origin/main c20fa33: bun scripts/check.mjs exit 0; full
  bun test (HOME under TMPDIR) 2902 pass, 3 skip, 0 fail.

magpie does not auto-update a package outside @magpie-community
(plugin.Official), so an install takes the npm latest at that time.
Not tried: a real Huawei Cloud sign-in.
2026-10-28 00:59:44 +08:00
yetone c20fa331a0 trae 0.2.23: a model whose entry names max (or medium) offers it and sends it (#434)
huajii (#434): Trae's app offers DeepSeek V4.1 Flash at max, the plugin
does not.

Cause: LEVELS knew only light/high/extra_high, so levelsOf dropped any
other option an entry's reasoning_effort_config names, and effortOf never
sent it. Trae's client names five levels (its bundle's
reasoning_effort.{low,medium,high,extra_high,max}, handed out per model by
remote config, per dsh-connect-trae #60's read of the client bundle). An
entry naming max beside the three lost it.

Fix: LEVELS spells medium and max as themselves. They are offered only
for a model whose entry names them, and a model that names none still
sends nothing for them.

Run:
- packages/trae: bun test 215 pass, 0 fail. The two new tests in
  reasoning.test.mjs (levels/variants/chatBody with max and medium; max
  reaching llm_utils_chat through the loader's fetch) were red on the old
  LEVELS line (2 fail, max undefined), green with it.
- HOME=$(mktemp -d) bun test at the repo root: 2902 pass, 3 skip, 0 fail;
  bun scripts/check.mjs: ok.

Not tried: a real Trae account. The wire name "max" in options comes from
the client's i18n keys, not a captured list; on 10-25 a live CN list named
only light/high/extra_high (dsh-connect-trae #60, plugins #300). If Trae's
"max" in the app is the Max mode instead, the plugin's
deepseek-v4.1-flash-max model is that and is unchanged here.
2026-10-28 00:46:08 +08:00
skygunner 214530edad cloudflare-workers-ai: read actual Neurons and keep the quota card toggles
Workers AI usage now reads the day's actual Neurons from Cloudflare's GraphQL analytics, keeps the Used/Left toggle on the quota card, and stops the included free allowance from benching a Paid or unknown plan (`aside`). A 429 with code 3036 gets a Retry-After that runs to the next UTC midnight. Version 0.0.4; dist has 0.0.3, and npm has never had the package.

What was run, at reviewed head 38ddeb132ee6c00698952303fbc4949a84287779:
- `bun test packages/cloudflare-workers-ai` with a sandbox HOME/TMPDIR: 23/23 pass.
- `bun scripts/check.mjs`: ok.
- Merged with origin/main, the whole repo `bun test` with a sandbox HOME: 2900 pass, 3 skip, 0 fail across 245 files.
- Broke code and timing by hand:
  - Removing the `!info.errors?.length` guard turns only the new partial-reply assertion red.
  - A preload that moves Date.now() 700ms forward on every call fails the old (bdc302a) Retry-After test ("26820 vs ~26819"). The new bracketed test passes 3 of 3 under that preload.
- The earlier review at bdc302a covered the rest of the change. That includes nine mutations, each of which turns a test red.

Not tried:
- A real Paid account's billing and inference, as the author says too.
- A fetch call that straddles exactly 00:00:00 UTC. The Retry-After bracket would fail there, but only inside a window a few milliseconds long.
2026-10-28 00:34:58 +08:00
yetone 26502bf93e autoclaw 0.2.9: a history the chat gateway can't read goes put right, not as a bare 500 (#437)
tmuer (plugins#437, Windows 11, autoclaw-cn, zaicoding_glm-5.3, plugin
0.2.8) had one dsh request in 48,799 fail after 65s with AutoClaw's 500
{"message":"parse response failed"}, in 0 / out 0. Sent straight to the
CN gateway with the plugin's headers, each of six body fragments got
that same 500, while a bad model name got 400 "非法模型".

Of the six, those an agent's history can hold are now put right before
the body goes, on both channels (tidyBody):
- a message's null or missing content goes as "";
- an earlier turn's reasoning_content is left off (AutoClaw's own client
  sends none back);
- a tool call's arguments that aren't a string go as their JSON, "{}"
  for none (the call is kept, so its tool result still pairs);
- tools that aren't a non-empty list are left off with tool_choice.
Not changed: an empty messages list (the plugin always puts the system
prompt first, so none reaches the gateway) and a tool schema's
parameters.type (no agent sends "nonsense"; the reporter found every
real schema shape answered 200). $schema and strict stay, as the
reporter's own tests had them answered. max_tokens is still left off:
the gateway turns it away.

Retry on a 500 is magpie's: a plugin's 500 is retryable there
(gateway/fallback.go retryable, status >= 500) and the next member of
the group is asked when there is one. The plugin doesn't retry it.

Run: packages/autoclaw `bun test` (39 pass); `bun scripts/check.mjs`
all green.
Broken by hand: index.mjs at HEAD with the new test: red.
Not tried: the real AutoClaw gateway (no AutoClaw account here); which
of the shapes the reporter's one 65s failure had is not in its record.
2026-10-28 00:04:17 +08:00
yetone 1a560ba618 qoder 0.2.41: a chat carries the headers Qoder's client puts on a chat, not the machine id three times (#443)
unifilitence (plugins#443, Windows 11 x64, qoder.com) captured a chat
going out with the account's machine UUID as Cosy-ClientIp,
Cosy-MachineId and Cosy-MachineToken alike, Cosy-MachineType 5 and
Cosy-MachineOS x86_64_win32, and asked for each to be what Qoder's own
client sends.

Checked against Qoder.app 0.4.3: its worker runtime
(qoder-agent-sdk/dist/_worker) and the auth wasm it embeds, run here
with its own inputs:

- Cosy-MachineOS is `${x64->x86_64, arm64->aarch64, else arch}_${platform}`,
  so x86_64_win32 is Qoder's own value. Only ia32 differed: the plugin
  sent x86_win32, Qoder sends ia32_win32. Fixed.
- Its non-chat calls (prepareRequest) do send ClientIp, MachineId and
  MachineToken all as the machine id, MachineType 5. The listing, usage
  and queue status keep that set.
- A chat (prepareInferRequest, then its header pass) differs: no
  Cosy-ClientIp; MachineToken and MachineType are the native device
  identity's (umid runtime-info) or absent when there is none; and a
  Cosy-MachineHostname, os.hostname() made safe as its zei does
  (punycode, else "-" runs plus a sha256 mark, 96 chars at most). A chat
  now goes so. The identity is one the check-in already read in this
  process (renewed behind the chat after an hour); a chat never runs the
  helper itself, so with no check-in yet it goes without, as Qoder does
  when it has no identity.
- The signed payload's requestId is a dashed UUID in Qoder's signer; the
  plugin sent it undashed. ideVersion "" is Qoder's own.

Left as it was: Accept-Encoding identity on a chat (Qoder sets none;
its fetch's default differs from Bun's anyway).

Run: packages/qoder `bun test` (276 pass, new headers.test.mjs and one
check-in test); `bun scripts/check.mjs` all green. Real qoder.com
account from bun in a sandbox HOME (token not renewed, no auth.set):
qfmodel answered "pong" with the new chat headers, dfmodel queued
(10605, as before), the model list 200.
Broken by hand: index.mjs at HEAD with the new tests: 6 of 7 in
headers.test.mjs and the check-in chat test red.
Not tried: Windows (the hostname and OS values are unit-tested for
it); a chat carrying a real device identity against the live service.
2026-10-28 00:01:31 +08:00
yetone eb54fad5b3 kimi-work 0.1.13: a gone share folder is named, and several Kimi users are served (#444, #440)
#444 (kongbai01203): when the folder daimon-storage.json points to was
moved or deleted, 0.1.12 threw its "sign in again" error with
signIn "expired", so magpie showed "登录已失效" and marked the account,
and signing in again in a running Kimi didn't help. Kimi 3.2.21 makes
<shareDir>/daimon only when it provisions at start, and never falls back
to the default folder while a pointer stands (read from its main
process), so the plugin doesn't fall back either. A missing share folder
is now its own error, kimi_work_share_missing, with signIn "kept": it
names the folder and says to put it back (no new sign-in) or to quit and
reopen Kimi, then sign in to Work. The sign-in callback shows the same
text. A share folder that exists but has no config.json is still the
old missing-sign-in error. The plugin's fetch already fails before any
network call; the ~30s 502 the reporter saw is outside the plugin and
was not looked into here.

#440 (kongbai01203): magpie already keeps a second Kimi user beside the
first (settle tells them apart by uid), but the plugin served only the
user Kimi is signed in to, so the first account failed once Kimi
switched. Kimi 3.2.21 keeps one minted Work key per user in
<daimon>/kimi-code-key.json ({"v":2,"keys":[{userId,apiKey,keyId?}]},
the current user first), keeps an entry when it switches users, reuses
it when it switches back, and drops one only on a 401 (DaimonProvision's
#readKeyStore/#upsertKeyStoreEntry/#resolvePersistedKimiCodeApiKey). An
account Kimi has switched away from now uses its key from that file,
read as Kimi reads it (v 2 only, first entry per user). Its allowance
can't be read (Kimi keeps only the current user's web sign-in), so its
usage card says to switch to it, signIn "kept". No key, or a key the
gateway refuses, is kimi_work_account_not_here, marked signed out. Each
account is named "Kimi Work · <first 6 of its hashed uid>" instead of
the shared "Kimi Work (local)". Not done: rotating between accounts or
falling back on quota, which is magpie's routing, not the plugin's.

Run: bun test in packages/kimi-work (65 pass) and the whole repo with
HOME and TMPDIR in a sandbox under magpie-wt (2879 pass, 3 skip, 3 fail:
cursor upstream-words, commandcode no-magpie and layerfs no-magpie,
which fail because the sandbox path itself contains "magpie"; none of
those packages is touched). bun scripts/check.mjs ok.
Broken by hand: index.mjs at origin/main fails the new share-folder,
reporter's D:\KimiData\daimon-share and two-users tests. In the new
code, dropping the share check reds the two #444 tests; ignoring the
key store reds both #440 tests; taking the last entry per user reds the
key-store test; reading usage for an away account reds the two-users
test.
Not tried: a real Kimi with two users (no Kimi install or Kimi account
on this machine); that a minted key still works server-side after Kimi
switches users is read from Kimi's code (it reuses it after a probe),
not seen. Not tried on Windows.
2026-10-27 23:57:54 +08:00
yetone 2ef8b8b5ef zcode 0.1.33: a ZCode 3.16 sign-in lists its coding plan's models, GLM-5.3 among them (#439)
provider.models read the "as ZCode" sign-in without located(). ZCode
3.16 keeps only where the coding plan key is (project-key-location:v1,
#410), so the state had no key, plansOf took it for a Start Plan
sign-in, and the list was account:zai-start-plan's: GLM-5.3 left out
and delisted, while requests and usage (which call located) worked.
models() now reads the key first, as the request path does. A key that
can't be read throws, so magpie keeps the list it had instead of being
told the Start Plan's.

Reported, with the cause and this fix, by dinghao-8.

Run (TMPDIR/HOME sandboxed, Bun 1.4.2):
- bun test in packages/zcode: 135 pass, 0 fail; bun scripts/check.mjs
  exit 0.
- Broken by hand: the new own.test.mjs case against main's index.mjs
  fails with exactly the reporter's list, [GLM-5.3-Flash, GLM-5.2,
  GLM-5-Turbo].
- npm had 0.1.32; this is 0.1.33.

Not tried: a real ZCode 3.16 account (reading ZCode's credentials needs
the Keychain secret); the reporter ran the same one-line patch end to
end against BigModel.
2026-10-27 23:41:59 +08:00
yetone 7f99447ed2 workbuddy 0.1.39: an earlier turn's reasoning_content goes as reasoning, as WorkBuddy's own client sends it
uk.jent on Discord: Grok Build's chat.completions history lost its
thinking on WorkBuddy. Grok Build 1.0.67 sends an earlier assistant
turn's thinking as reasoning_content; magpie and this plugin pass it
on byte for byte, and WorkBuddy drops it. WorkBuddy's own client
(CodeBuddy's agents converter, applyPendingReasoning) sets `reasoning`
on the assistant message and skips its reasoning_content backfill for
WorkBuddy's own hosts. The chat path now does the same: reasoning_content,
or reasoning_details' text, becomes `reasoning` (one the client set is
kept) and the original fields are left out. Nothing is folded into
content as <think>, since WorkBuddy's client doesn't send it that way.
The Messages route (Claude on the China build) is unchanged.

Run: packages/workbuddy `bun test` with a temp HOME (183 pass);
`bun scripts/check.mjs` all green. Live on www.workbuddy.ai (a real
WorkBuddy AI account, access token only, refresh left out), a codeword
in the earlier turn's thinking, asked for after the tool result:
before, reasoning_content reached no model (0 of ~15 across kimi-k2.6,
kimi-k3, glm-5.3, deepseek-v4.1-flash, minimax-m3) while `reasoning`
did on kimi-k2.6 and minimax-m3; through 0.1.39 a reasoning_content
history reached kimi-k2.6 2 of 8 and minimax-m3 4 of 9, with the
no-thinking control 0 every time. glm-5.3, kimi-k3 and
deepseek-v4.1-flash never quoted it in either spelling.
Broken by hand: index.mjs from origin/main: reasoning.test.mjs 4 of 4
red; with the asReasoning call commented out, its two end-to-end
tests red.
Not tried: the China build (copilot.tencent.com; its desktop sign-in
answered 401), and Grok Build end to end through WorkBuddy (its
request was captured against a fake server). The "thinking loop" the
report names wasn't reproduced; the plugin doesn't touch the reply
stream.
2026-10-27 23:36:41 +08:00
yetone bace91473b codearts 0.2.3: a queued request leaves the queue at once when magpie has another candidate
As Qoder's 0.2.40 (axuhere on X: a free model held in a queue while
another provider could answer). When magpie says another account,
provider or routing group member follows this request
(x-magpie-fallback: 1), a 429 with queue-status: queued isn't polled
for up to 5 minutes: the trace leaves the queue (DELETE, as giving up
does) and the plugin answers 503 with the queue's retry-after,
"CodeArts queued the request; try again in 20s", so magpie asks the
next. The header is read and dropped before anything is signed or sent.
Without it, the wait is as before.

Run: packages/codearts `bun test` (115 pass) and `node --test
index.test.mjs` (115 pass); `bun scripts/check.mjs` all green.
Broken by hand: index.mjs as before: the new test red (it waits in
the queue instead).
Not tried: a real CodeArts account queued live; the 429 headers are
the shape the existing queue tests use.
2026-10-27 18:53:25 +08:00
yetone bc25bc5077 qoder 0.2.40: a queued request gives way at once when magpie has another candidate
axuhere on X sat at "模型请求正在排队 · 预计等待超过 10 分钟" on a free
model while another provider could have answered. Through magpie, a
Qoder free model queued with 10605 was waited out for up to 4 minutes
even when the request had another account, provider or routing group
member after it.

magpie now sends x-magpie-fallback: 1 on a plugin request that isn't
the last candidate (the host keeps it from the vendor). Told so, a
queued request isn't waited out: the 503 with Qoder's Retry-After comes
at once, and magpie asks the next. The message now also says how many
are ahead when Qoder says it ("Qoder queued the request for dfmodel
(this plan's queue: p3, 3 ahead); try again in 30s"). Without the
header, the wait is as before.

Run: packages/qoder `bun test` (268 pass, 22 files); `bun
scripts/check.mjs` all green.
Broken by hand: index.mjs as before with the new tests: the fallback
test and the budget test's message red (2 of 12 in queue.test.mjs).
Not tried: a real Qoder account queued live; the 10605 shape is
testdata/queued-10605.json's, captured before.
2026-10-27 18:53:25 +08:00
yetone b1bc778edf codearts 0.2.2: tool names over 64 characters go cut and unique, and come back as the agent's own (#432)
CodeArts turned away ZCode's android emulator MCP tool,
mcp__plugin_android-emulator_android-emulator__android_discover_project
(71 characters), with "Function name [...] length over limit, maximum
is 64 (InferHub.001001017.413)", so every ZCode chat with that MCP on
failed.

A name over 64 now goes as magpie's FlatName cuts one: its first 55
characters, "_" and 8 hex of its SHA-256 (64 in all). It is cut in
every place the body names a tool: tools, functions, tool_choice,
function_call, the history's tool_calls and a tool message's name, so
the history keeps matching its tool on every turn. A cut that equals
another tool's own name, or another cut, is cut again with a salt. The
answer gets the agent's names back: in a folded (non-streaming) reply
and in the stream, where a name the gateway sends whole, repeated in a
later delta, or in pieces (the part past 55 held until the name is
whole) is put back. Events that name no cut tool pass byte for byte,
and a body whose names all fit is not touched at all.

Run: packages/codearts `bun test` (114 pass) and `node --test
index.test.mjs` (114 pass); `bun scripts/check.mjs` all green. New tests
use the reporter's literal tool name, two names alike for 55
characters, a short tool named exactly like a long one's cut, a stream
round trip through the loader's fetch (whole name, name in three pieces
across the 55th character, a name that fits), a gateway repeating the
name, and a folded reply.
Broken by hand: restoreToolNamesInStream returning the stream as it
came (stream and repeat tests red); no salt on a collision (collision
test red); no shortening in prepareChatBody (4 tests red).
Not tried: a real CodeArts account (its refresh token is single-use, so
no live sign-in was copied into a sandbox); whether CodeArts ever sends
a tool name in pieces (handled, not seen).
2026-10-27 17:38:33 +08:00
yetone ceda580080 kiro 0.1.18: an image over Kiro's 5 MiB Base64 limit is shrunk on the request, or replaced by a note (#428)
imwaco (#428): in Codex -> magpie -> Kiro, view_image returned a PNG of
4,171,428 bytes, 5,561,904 as Base64, and Kiro answered
  messages.130.content.2.image.source.base64: image exceeds 5 MB maximum:
  5561904 bytes > 5242880 bytes (IMAGE_SIZE_EXCEEDED)
on that turn and on every later one, text-only ones too, as the image
stays in history. The limit is on the Base64 string: 5561904 is that
image's Base64 length, not its file size, so the largest file that fits is
3,932,160 bytes. kiro-cli's own gate is 10 MB of raw file
(MAX_IMAGE_SIZE, aws/amazon-q-developer-cli chat/consts.rs), the gap
kirodotdev/Kiro#11497 describes.

buildKiro's conversation is now built as an object (kiroRequest) and,
after the latest-image selection, kiroBody fits every image left in it,
user images and tool images in history alike, on the plugin's own copy:
- an image at or under 5,242,880 Base64 characters is sent byte for byte;
- one over it is decoded with Bun.Image (Bun 1.4's built-in libspng /
  libjpeg-turbo / libwebp, no new dependency; magpie's host and OpenCode
  2.0.25 both run Bun 1.4.2) and tried, in order: its own kind with the
  long edge at most 2000 px, then WebP (keeps alpha) or JPEG for a JPEG,
  q80, then 0.7x smaller at q75 down to 256 px, until it fits;
- bounds: 50M pixels (a header claiming more is refused before decoding),
  64 MB of Base64 looked at, 30 s per image; one image is worked once per
  sha256 (in-flight shared, 4 kept);
- one that can't be read, has too many pixels, can't be brought under, or
  a host without Bun.Image: the image is left out and a one-line note
  takes its place in that message's text, so the turn still goes.
History, entry count, tool pairing and image order are unchanged.

Run:
- HOME=$(mktemp -d) bun test packages/kiro: 67 pass (image-size.test.mjs
  new, 10 tests); the same under OpenCode 2.0.25's Bun (BUN_BE_BUN=1
  opencode test packages/kiro): 67 pass. bun scripts/check.mjs kiro: ok.
- Fixtures are built in the test: a 1389x1000 noise PNG padded to exactly
  4,171,428 bytes (5,561,904 Base64), PNGs at 3,932,159 / 3,932,160 /
  3,932,161 bytes (Base64 5,242,880 with "=", 5,242,880, 5,242,884), a
  20000x20000 header bomb and 4 MB of junk.
- Full HOME=$(mktemp -d) bun test at 18268848: 2851 pass, 1 fail:
  layerfs "item 3: an import over the file limit" timed out at its 30 s
  bar (46 s) writing 20,001 files at load ~40; it fails alone too at this
  load, and the kiro change doesn't reach layerfs.
Broken by hand: kiroBody without fitImages: 7 of 10 fail; no cache: the
once-per-image test fails; `<` for `<=` at the limit: the boundary test
fails.
Not tried: a real Kiro account (none in a sandbox; no live sign-in read);
an animated GIF over the limit (Bun decodes its first frame only).
2026-10-27 17:27:57 +08:00
yetone 18268848d3 workbuddy 0.1.38: a "Free models only" switch that never spends credits (#430)
kongbai01203 asked for a hard stop on WorkBuddy credits: use only the free
models, and never let a paid one through by mistake.

Each site (workbuddy, workbuddy-ai) now declares a magpie plugin option,
free_only, "Free models only", off by default. With it on:
- models() lists only the models priced free now (priceOf: a model free only
  at night, or one with no price, is paid). A list that can't be read, or an
  API key WorkBuddy lists no prices for, is a failure, not the built-in list.
- fetch reads the model from the body and, unless /v3/config lists it as
  free, answers 404 model_not_found itself and sends nothing. The message
  has no quota words, so magpie's gateway rests that model only and falls
  through, not the account. A price list that can't be read answers 503 and
  sends nothing. The list is kept a minute per account for requests.
Off, nothing changes: the config isn't read on a request.

Run:
- HOME=$(mktemp -d) bun test packages/workbuddy: 179 pass (freeonly.test.mjs
  new, both sites); bun scripts/check.mjs: ok.
- Real accounts, sandbox magpie (HOME under the scratchpad, magpie
  wb-free-only branch, this package added by path): with the switch on for
  workbuddy-ai the list went 26 -> 2 (hy3, deepseek-v4.1-flash) within 2s,
  workbuddy (own switch) stayed at 19; gpt-5.4 got the 404 with nothing
  sent, hy3 and deepseek-v4.1-flash answered. Off: 26 again, gpt-6-luna and
  gpt-5.4 answered (no rest left on gpt-5.4).
Broken by hand: without the fetch check 4 tests fail; with onlyFree
returning every model 2 fail.
Not tried: the GUI switch itself (set through /api/settings/plugin-option);
the workbuddy (China) site's switch with a real request; Responses or
Anthropic bodies against the real API (the model is read the same way).
2026-10-27 17:26:51 +08:00
yetone a379c54b17 qoder 0.2.39: a queued call's stream is closed, and its resend is a new request in the same set (#427)
Peterpig (#427, qoder.com, personal_standard, magpie 0.1.1709, plugin
0.2.38): both free models, qfmodel and dfmodel, fail every test with
"context deadline exceeded". Reproduced with the owner's real qoder.com
account and the plugin driven straight from bun (sandbox HOME, its live
token unrenewed): the free models are queued intermittently with
10605 {"isQueued":true,"queueType":"p3","subCode":"RESOURCE_LIMIT",
"serviceAvailable":false,"retryAfterSeconds":30,"waitTime":30}. A
status ask 30s later says isQueued false, the resend is sometimes queued
again, and the answer comes 38s to 71s after the request. magpie's test
waits 20s, so a queued free model is "context deadline exceeded" there
whatever the plugin does; that is Qoder's queue, not the network.

Two things the plugin did differently from Qoder's client
(qoder-agent-sdk worker in Qoder.app 0.4.3, the [ModelQueue] path):

- Qoder keeps a 10605 stream open after its one event. The plugin read
  that event and left the stream open through the wait and the resend
  (seen held to the 170s abort on the real account). The refused call's
  fetch now has its own AbortController, aborted once the call is read
  as refused.
- The client gives every resend a new request_id and chat_record_id
  (o4i) under the same request_set_id, and asks the queue with the
  latest request_id. The plugin sent the same request_id again. It now
  does as the client does. Not shown to matter: with the old code a
  resend was answered once and queued again in other runs, as with the
  new code, so the queue looks load-driven either way.

Run at this tree (base c25201d):
- bun test in packages/qoder: 267 pass, 0 fail.
- queue.test.mjs against the old index.mjs: the two changed/new tests
  fail (resend's request_id, refused stream not aborted); 9 others pass.
- HOME=$(mktemp -d) bun test at the repo root: 2841 pass, 3 skip,
  1 fail: layerfs "item 3: an import over the file limit is refused"
  timed out (73s against its 30s bar, also alone, load 15-45 on this
  box); this change touches no layerfs file. Not filed.
- bun scripts/check.mjs: ok.
- Real qoder.com account, qfmodel, stream: new code queued twice, then
  answered at 71s, both refused streams aborted at once. Old code:
  queued, answered on the first resend at 38s, its refused stream held
  open until the 170s abort; in two other old runs the resend was
  queued again until the 60s abort.

Not tried: #389's Windows Clash Verge system proxy (ECONNRESET); this
does not touch it. Qoder CN, QwenWork: same code path, not run live.
2026-10-27 17:25:28 +08:00
yetone df4dfcd8f7 cursor 0.2.26: a picker model whose usable id is its other family goes as that id
ysm119 on Discord, after 0.2.25: claude-haiku-5-5-thinking still failed
its Test with no answer. A Team account's picker can have Claude Haiku 5.5
with thinking as its default, while cursor-agent models lists Haiku only
as claude-haiku-5-5 (no thinking). modelsOf looked up the usable ids of
the default's family alone, found none, and every Haiku id went out as a
picker variant (claude-haiku-5-5-thinking-high, -low, ...) the account
doesn't have. modelsOf now falls back to the same model's family with
thinking or without it, so each variant id goes as the id the account
lists.

Run: bun test packages/cursor (311 pass, 0 fail) and
bun scripts/check.mjs cursor (ok), in a sandbox HOME.
Broken by hand: with the fam lookup back to the default's family only,
the new context.test.mjs test is red (17 pass, 1 fail).
Not tried: a real Team account whose list has Haiku without thinking;
the owner's Cursor account doesn't show this shape. The fixture is
built from the report's ids, not captured bytes.
2026-10-27 17:06:02 +08:00
yetone cb776e2ebb cursor 0.2.25: a tiered family is named without its tier; a thinking id runs on the model without it
Reported by ysm119 (magpie Discord, 10-27, after 0.2.24): on the Team
account the Cursor list showed "Claude Opus 5 1M Medium Thinking",
"Claude Opus 4.7 1M Medium Thinking", "Claude Sonnet 4.6 1M Thinking",
"Claude Haiku 5.5" and so on, read as one fixed tier each ("没法设置模型
档位"), and the picked claude-haiku-5-5-thinking failed its test.

Cause:
- usableTitle (0.2.24) dropped effort words only at the end of Cursor's
  name, so a name with "Thinking" or "(NO ZDR)" after the tier kept
  "1M Medium". The entry already had the family's efforts as variants
  (magpie's reasoning levels); only its name said Medium.
- claude-haiku-5-5-thinking is an id 0.1.x listed and is still in the
  reporter's picks. When the account's list has no Haiku 5.5 with
  thinking, named() found no family and the id went to Cursor as it was:
  "AI Model Not Found".

Now:
- A usable-only family's name drops its default id's effort phrase, Fast
  and 1M wherever Cursor puts them, and keeps words of the model's name
  (GPT-5.1 Codex Max stays Max).
- An id with no family of its own runs on the same model with thinking
  toggled (usable-only family or picker variants), at the id's effort,
  before it would be sent as named.

Run:
- bun test packages/cursor: 310 pass, 0 fail; bun scripts/check.mjs
  cursor ok.
- Three new tests in context.test.mjs, built on the reporter's literal
  names; all three fail on 0.2.24's index.mjs (names kept "1M Medium",
  claude-haiku-5-5-thinking sent as is, a picker thinking-only Haiku
  asked as claude-haiku-5-5-low).

Not tried: the reporter's real Team list (their ids weren't sent; the
tests use Cursor's id pattern, claude-opus-5-thinking-high, for their
names), any real Cursor request, magpie end to end. A family whose ids
carry a suffix after the effort (the "(NO ZDR)" Fable, id unknown) may
still list one entry per tier.
2026-10-27 16:29:39 +08:00
Kurt Lee 67407cf00f copilot 0.1.0: GitHub Copilot with premium request and credit quota (#411)
New package @magpie-community/opencode-copilot-auth 0.1.0 (provider id
github-copilot), from kurtleee. It adapts opencode-copilot-auth 0.0.12 (MIT):
GitHub.com and GHE.com device sign-in, Copilot token renewal, request
signing with initiator and vision headers. Client versions match magpie's
native Copilot (vscode/1.140.0, copilot-chat/0.68.0). Host headers are
read as a Headers object, which is how magpie's host.js passes them. When the
sign-in isn't OAuth, the request goes on to plain fetch.

It adds magpie's auth.usage hook. The hook reads GET
api.<host>/copilot_internal/user with the GitHub OAuth token
(redirect: "error", 15s timeout) and turns the reply into windows the way
magpie's built-in Copilot reader does. It reads only the chat, completions
and premium_interactions snapshots. Credits are fractional, and string
counters are accepted. An exhausted unlimited pool counts as 100% used.
Managed seats block when spent, and personal seats with overage are aside.
credits_used is never divided by the entitlement. An unlimited pool's
credits_used goes in the display, aside and with no limit. Data that can't
be read is unknown, and only HTTP 401 expires the sign-in.

Run at head c7fb3abd, merged onto main 6a2ade35 (Bun 1.4.2, sandbox HOME
and TMPDIR, HTTP(S)_PROXY pointed at a closed port):
- packages/copilot bun test: 40 pass, 0 fail. Full repo bun test: 2838
  pass, 3 skip, 0 fail. bun scripts/check.mjs: all ok.
- A probe sent fetch to a local Bun server, using magpie's real Copilot
  quota bytes (internal/provider/copilot_usage_test.go). Max token billing:
  "0.1 / 20,000 credits used". Enterprise pool spent: 100%, blocking. Pro in
  overage: 300/300, aside. 401: signIn expired. A GHE sign-in reads
  api.<host>. The loader with a host-style Headers object renewed through
  v2/token with Bearer <oauth>. The chat request went out with content-type,
  accept and the extra header kept. Incoming authorization and x-api-key
  were replaced. Vision and X-Initiator were set, and the renewed token was
  saved under github-copilot.
- PR CI (approved at c7fb3abd): test and on-npm pass.

Not tried: a real GitHub or Enterprise account. Not changed: the device
flow treats slow_down as a failure. This comes from upstream.
2026-10-27 16:04:15 +08:00
wang2 6a2ade35ef search1api 0.1.1: Magpie attribution, reused OAuth client, send_feedback through Search1API (#424)
search1api 0.1.1 (fatwang2):
- Sign-ins carry utm_source=magpie and API requests send User-Agent search1api-magpie/0.1.1.
- The registered public OAuth client and its loopback port are saved in search1api-oauth-client.json (mode 600) and reused. A busy port, another issuer, or a sign-in that doesn't finish leads to a new registration.
- A send_feedback tool posts to Search1API's own POST /feedback with the caller's credential, on the same request path as the other tools, including the OAuth refresh on 401. Its description lists what is sent (message, intent, category, request_id, model) and says Search1API stores it on agentback.app, linked to the signed-in account. The plugin contacts no other host. A report that can't be sent returns a note and doesn't fail the task.

Run at the reviewed head d48c8c8 (sandbox HOME/TMPDIR, Bun 1.4.2):
- bun test packages/search1api/tests: 23 pass, 0 fail
- bun scripts/check.mjs search1api: ok
- PR CI (test, on-npm): pass
- grep of the package: the only host is api.search1api.com (plus 127.0.0.1 for the callback). No hard-coded keys. agentback.app appears only in the description, the README and a test.
- Drove the built plugin against my own loopback fake API:
  - OAuth access revoked (401): POST /feedback with the old bearer, then /token refresh_token, then POST /feedback with the new bearer. Got "Feedback recorded (fb_1)" and auth.set with the new token.
  - Bad API key: a 401 gives "not recorded ... (401)" with no refresh, and the error body is not echoed.
  - Body is exactly {message, intent, category, request_id, agent:{name:"Magpie", model}}, with UA search1api-magpie/0.1.1.
  - Unknown args and a non-string model are refused before any request.
- An unauthenticated probe of the real api.search1api.com: POST /feedback gives 401, and an unknown path gives 404. So the endpoint exists.
- The OAuth client reuse (unchanged since 95f236f) was run by hand in the previous review.

Not tried: a real Search1API account (none available).
2026-10-27 15:44:05 +08:00
yetone a9779ef864 kimi-work 0.1.12, kimi-desktop 0.1.4: Kimi's sign-in is read where daimon-storage.json points (#425)
Kimi 3.2.21 on Windows, installed on another drive than %APPDATA%'s,
keeps daimon-share at <install drive>\KimiData\daimon-share and writes
%APPDATA%\kimi-desktop\daimon-storage.json ({"version":1,"shareDir":...})
to point there. It writes the same pointer on any system when the user
moves its storage. Both packages read only
%APPDATA%\kimi-desktop\daimon-share, so the sign-in was "not found".

Read from Kimi's own code: Kimi-Setup-3.2.21.exe's app.asar,
out/main/index.js (string table decoded): the shareDir getter is
readPointer(userData) ?? join(userData, "daimon-share"); the pointer
reader takes an absolute shareDir and otherwise the default; the
"install-drive seed" writes the pointer on win32 when installRoot's drive
differs from userData's; driveDataDirName is "KimiData".

Both packages now follow the pointer the same way (unreadable, non-JSON
or non-absolute -> default, as Kimi does). kimi-work's sign-in failure
names the file it looked for, and a failed Work check (network, HTTP)
no longer says no sign-in was found.

Run at this tree (base fc2866f):
- Windows 11 box: installed Kimi 3.2.21 silently to D:\Kimi425, launched
  it once (no sign-in): it wrote daimon-storage.json with shareDir
  D:\KimiData\daimon-share and no daimon-share under %APPDATA%. Under
  bun 1.4.2 there the new desktopFile() is
  D:\KimiData\daimon-share\daimon\config.json; 0.1.11's path does not
  exist. Kimi uninstalled and its folders removed afterwards.
- New tests force win32, darwin and linux paths (tests/desktop-path.test.mjs,
  kimi-desktop/kimi-dir.test.mjs). Broken by hand (pointer ignored):
  3 of 6 kimi-work tests red.
- TMPDIR/HOME sandbox `bun test`: 2791 pass, 3 skip, 0 fail;
  `bun scripts/check.mjs`: ok.

Not tried: a signed-in Kimi on the other drive (no credentials were
entered), so a real Work request from D:\KimiData is untested. The
kimi-desktop adapter reads the folder once when it starts; storage moved
while it runs is seen on the next start.
2026-10-27 15:14:11 +08:00
yetone fc2866fc9e cursor 0.2.24: a family only cursor-agent lists runs as its usable ids
Reported by ysm119 (magpie Discord): on a Cursor Team account,
`magpie claude cursor/claude-opus-5-5@1m` waited and then failed with
"AI Model Not Found", and `cursor/claude-opus-5-5` the same, while
`cursor-agent models` lists claude-opus-5-5-low, -medium, -high, -xhigh,
-max (and -fast of each), and `cursor/claude-opus-5-5-low` works.

Cause: when the account's AvailableModels picker lacks a model (or a
picker model has no variant the account can use), the plugin sent the
family id or the literal `@<size>` id upstream, which Cursor doesn't know.

Now:
- A family GetUsableModels lists and the picker doesn't is listed once
  under its family id with its efforts, and a request goes as the usable
  id the effort and fast pick (claude-opus-5-5 + low -> claude-opus-5-5-low).
- A picker model whose chosen variant isn't usable goes as its family's
  nearest usable id.
- An `@<size>` id the list no longer has runs at the model's nearest
  size, in Max Mode past the model's window.
An account whose picker covers every usable id lists and sends as before.

Run:
- bun test packages/cursor: 307 pass, 0 fail; bun scripts/check.mjs cursor ok.
- Four new tests in context.test.mjs built on the reporter's literal ids
  (claude-opus-5-5-low ... -max-fast, "Claude Opus 5.5 1M Low").
- Broken by hand: the three tests for the new behaviour fail on 0.2.23's
  index.mjs; the "covered picker lists as before" test passes on both.
- Real account (owner's, read-only token): with claude-opus-5-5 dropped
  from the real AvailableModels reply, 0.2.23 sends "claude-opus-5-5@1m"
  and "claude-opus-5-5" and gets Cursor's 502 "AI Model Not Found: Model
  name is not valid", the reporter's error. 0.2.24 sends a usable id and
  Cursor takes the model (429 weekly limit on this account for Opus 5.5).
  Dropping grok-4.7 the same way: grok-4.7@500k, grok-4.7 and grok-4.7-low
  answer 200 on 0.2.24; grok-4.7@500k is 502 Not Found on 0.2.23. With
  the real, unmodified picker: grok-4.7@256k and composer-2.5 answer 200.

Not tried: a Team account (the reporter's), an Opus 5.5 reply that
succeeds (this account's weekly quota is spent), magpie end to end.
2026-10-27 14:37:11 +08:00
yetone 9c886c12f9 zcode: a cap that outlasts the waits still rests the account, the README says
#395's README said busyAnswer lets magpie "move that request along
instead of resting the account". It doesn't: on magpie origin/main
e7173958e, failure(429, body) reads both ZCode's bare
{"code":3008,"msg":"user concurrency limit exceeded"} and busyAnswer's
rewording of it as "rate", so the account rests and the request falls
to the next group member, as before #395. The retry and the declared
maxConcurrency are what keep the cap from reaching magpie; the README
now says so. README only, no version change.

Run: the probe above (a throwaway test in magpie's internal/gateway,
removed); bun scripts/check.mjs zcode ok.
2026-10-27 11:21:35 +08:00
ANDY-JK 8b21033daa zcode 0.1.32: a plan's cap refusal is asked again, with no gate of the plugin's own (#395)
ZCode answers 429 with code 3008 "user concurrency limit exceeded" or
3009 "model concurrency limit exceeded" when one account has more in
flight than its plan serves. Such a refusal is now asked again, the same
bytes, after 250ms, 500, 900, 1600, 2800 and 4000 (jittered); one that
outlasts the waits goes on as a 429 with ZCode's words and what they
mean (busyAnswer). spentUp no longer counts 3008/3009 as a spent gift.
maxConcurrency: 3 is declared on the auth hook and as
magpie.maxConcurrency, as a default magpie's per-account queue applies
and a user can raise; the plugin keeps no gate of its own.

By ANDY-JK. Reviewed at 8dc0b8dade49001b3a0e89b5e26fd674e8657694, applied
onto main bf8faa2 (no zcode change on main since the branch's base):
- TMPDIR/HOME sandboxed, Bun 1.4.2: bun test in packages/zcode, 134 pass,
  0 fail; bun scripts/check.mjs exit 0.
- PR CI (pull_request run 40323330525, merge ref): test and on-npm green.
- Broken by hand: busy() out of spentUp fails "the cap's own codes are
  not a gift spent"; cap forced false fails the retry and outlasts-the-
  waits tests; busyAnswer replaced by the plain body fails the latter;
  concurrency.test.mjs against main's index.mjs fails at import.
- magpie origin/main e7173958e: host.js concurrencyOf reads both
  declared sites. failure() reads the cap refusal as "rate" both before
  and after busyAnswer, so a cap that outlasts the waits still rests the
  account a minute as before; the README's "instead of resting the
  account" is corrected in a follow-up.
- npm had 0.1.31; this is 0.1.32.

Not tried: a real ZCode account (the author measured one Z.ai gift-plan
account through magpie's gateway, numbers on the PR).
2026-10-27 11:20:36 +08:00
zhigangYIandzhigangYI bf8faa2f17 kilo 0.1.0: Kilo Code on magpie's Agents page (#90)
New package @magpie-community/agent-kilo 0.1.0 (gangoogle, #90): Kilo Code on magpie's Agents page. connect writes one key, provider.magpie, into ~/.config/kilo/kilo.jsonc: @ai-sdk/openai-compatible at the gateway's /v1, every model magpie offers Kilo with tool_call, the model's own reasoning levels as variants (weakest first, {} when it has none), image input only for a model magpie says takes images, and limit only when the window is known. Library: AGENTS.md, kilo.jsonc mcp (opencode format), skills under ~/.config/kilo. The branch had main merged in (README agent table and registry.json conflicts, both sides kept).

What was run, at 601d2de56c38fe3cc430919d73502dfd96b3b8d8 (b67360c merged with main 10ebbb3):
- HOME=$(mktemp -d) bun test: 2770 pass, 0 fail (packages/kilo 10 pass). bun scripts/check.mjs: clean. PR workflow (test, check, on-npm) green on run 40432034838.
- magpie built from main 65ee8c65c, sandbox HOME, gateway on 3481, one custom provider fakeup whose upstream is a local fake logging every request: fake-chat (context 128000, output 16000, levels stored max,high), fake-vision (64000, vision on), fake-plain (nothing known).
- magpie plugin add packages/kilo, magpie kilo magpie/fakeup/fake-chat on a kilo.jsonc with a comment, $schema, theme, model and a provider of its own: all kept. fake-plain has no limit; fake-chat's variants are high, max.
- @kilocode/cli 7.8.18: kilo models magpie --verbose lists fake-chat with variants [high, max], the other two {}. kilo run --variant=max with a read tool call: the request reached the upstream at /v1/chat/completions with reasoning_effort max and 23 tools, the read went round trip (the file's text came back in the tool message) and the final reply printed. On fake-plain no reasoning_effort was sent. magpie usage counts the calls under agent Kilo Code (ua).
- magpie kilo default after on, a model switch and a turn: kilo.jsonc byte for byte as before (taken after Kilo's own one-time permission migration, which Kilo writes into the file on its first run).

Not tried: a real vision model (every model got image input here because magpie on main describes images for models that don't take them), the VS Code extension at 7.8.18 (the 7.8.8 extension was checked in review), the Library paths with a real Kilo. Found on the way, not this package's: turning an agent plugin off or removing it leaves the agent on magpie with no way back from magpie, for every agent plugin (yetone/magpie#3810).

Co-authored-by: zhigangYI <19320303+gangoogle@users.noreply.github.com>
2026-10-27 09:27:33 +08:00
yetone 10ebbb3fc3 magpie-setup: subagents get their own model through magpie's settings
Myi3i4 on X asked whether the setup skill covers this: asking Codex to put a
subagent on a model works only sometimes. magpie already pins every Codex
subagent to one model or group whatever the lead names (subagent_model), and
Claude Code's subagents too; the skill now says so.

Run: each command in the new block ran against magpie built from magpie
origin/main 4ad… in a sandbox HOME (ollama provider with two models typed in):
codex subagent_model <model>, group/<id>, default, subagent_effort low and
claude subagent <model> each printed ✓ and wrote the setting.
Not tried: a real Codex subagent request through the gateway.
2026-10-27 04:43:48 +08:00
yetone 4bde462e21 workbuddy 0.1.37: sign in with an API key (#407)
Both builds offer "<build> API key" beside the browser and desktop
sign-ins, for a key made on the build's keys page
(www.workbuddy.cn/profile/keys, www.workbuddy.ai/profile/keys).

A key is sent as WorkBuddy's own CLI sends CODEBUDDY_API_KEY
(@tencent-ai/codebuddy-code 2.177.0, read as data): its API-key
session has the key as the access token, uid "anonymous_" + the key's
last 8 characters, personal, no domain, no enterprise; model requests
carry X-API-Key: <key> and Authorization: Bearer <key>
(getCustomHeaders). So a key's chat has those, X-User-Id
anonymous_<last8>, no X-Domain, and the client headers the other
sign-ins send, to the same host: copilot.tencent.com/v2 for workbuddy
(the CLI's endpoint for CODEBUDDY_INTERNET_ENVIRONMENT=internal; it
treats www.workbuddy.cn and copilot.tencent.com as front doors of one
API) and www.workbuddy.ai/v2 for workbuddy-ai.

The loader's apiKey "" and x-api-key delete stay: they keep the SDK's
own (empty) key headers off; sign() now sets X-API-Key itself for a
key account and never for an OAuth one.

- Models: /v3/config is asked with a key only for ck_/pt_ keys, as the
  CLI's shouldLoadRemoteConfig does; any other key keeps the built-in
  list.
- Usage: a key's card says the credits are unknown and asks nothing
  (the CLI reads no credits with a key; no endpoint guessed).
- A 401 on a key is never renewed or resent: it says the key was
  refused and where to check it, marked expired only on
  invalid_token. The >2 MiB reset probe doesn't ask the billing API
  with a key.

Run at this tree (base ac11dcb):
- apikey.test.mjs: 12 pass; against the old index.mjs 10 fail, the 2
  OAuth-unchanged tests pass.
- packages/workbuddy: HOME=<tmp> bun test, 167 pass 0 fail.
- repo: HOME=$(mktemp -d) bun test, 2760 pass 3 skip 0 fail;
  bun scripts/check.mjs exit 0.

Not tried: a real WorkBuddy API key.
2026-10-27 04:41:57 +08:00
yetone ac11dcbb92 antigravity-cloak 0.1.2: Hermes Agent's earlier persona is broken too
Antigravity answers "Hermes Agent, an intelligent AI assistant created by
Nous Research" (Hermes' earlier default SOUL.md, which a SOUL.md the user
edited keeps) with the same fake 429 "Resource has been exhausted" (zgoodz
on X, 10-27: "antigravity在Hermes里一样429"). Hermes' current default
persona goes through. The line joins the words broken with a zero-width
space, after its H: "Y​ou are Hermes Agent, an intelligent ..." still
fails on a real account, while "H​ermes Agent, an intelligent ..."
goes through.

magpie v0.1.1641 breaks the same lines on an Antigravity account by
itself (`magpie provider set antigravity prompt=as-written` turns it off);
the README says so, and that this middleware then adds only extraWords.

Run:
- bun test packages/antigravity-cloak: 15 pass, 0 fail (new case: Hermes'
  old persona in a chat system message, broken after its H; the current
  "You are Hermes Agent, built by Nous Research." stays). With the word
  taken out: 14 pass, 1 fail.
- bun test scripts/check.test.mjs: 3 pass.
- Real Antigravity account through a sandbox magpie: the line whole is
  refused; broken after its H, 200; real Hermes Agent with the old persona
  answered through magpie's own break (magpie-side, same rule).
Not tried: this plugin installed in a running magpie on a real account.
2026-10-27 04:17:17 +08:00
yetone a52d1b370b antigravity-cloak 0.1.1: Codex's GPT-5 prompt is broken too
Antigravity answers "You are Codex, an agent based on GPT-5" and "You are
Codex, a coding agent based on GPT-5" in the system instruction with the
same fake 429 "Resource has been exhausted" it gives Claude Code's prompt.
A Codex thread begun on a GPT model keeps that prompt after /model,
resume -m or a fork onto an Antigravity model, so such a thread never got
an answer (Jodiezzzzzz on X, 10-27; magpie now tells it as a 400 with a
hint). The two lines join the words broken with a zero-width space.

Run:
- bun test packages/antigravity-cloak: 14 pass, 0 fail (two new cases:
  a switched thread's developer message, the coding-agent wording in
  lower case; magpie's own "You are Codex, based on GPT-5." stays).
- bun test scripts/check.test.mjs: 3 pass.
- On a real Antigravity account through a sandbox magpie: both lines
  whole get 429 (magpie's 400); "Y​ou are Codex, an agent based on
  GPT-5" and "Y​ou are Codex, a coding agent based on GPT-5" get 200.
- npm had 0.1.0; this is 0.1.1.
Not tried: the plugin installed in a running magpie on a real account.
2026-10-27 00:41:44 +08:00
MYCF711 213ef506c5 workbuddy 0.1.36: a free account's credits say when the plan refills (#415)
A free account's card says when the plan refills: with no subscription named, cycleOf reads the plan_base slice's cycle end (UTC+8). A summary that names a subscription still goes by it alone, and named-but-not-listed stays unknown.

By MYCF711. Reviewed at b8d600c9:
- `HOME=$(mktemp -d) bun test` in packages/workbuddy: 155 pass, 0 fail.
- The named-not-listed assertion fails on the PR's first head (b1ce408), which returned the slice's month end for a paid account; passes now.
- npm had 0.1.35; this is 0.1.36.
Not tried: a real WorkBuddy account (the fixture is the author's live CN reply).
2026-10-26 23:56:46 +08:00
刘巍峰 c25201d259 qoder 0.2.38: a reply names the model-list entry it was sent with (#413)
Qoder and Qoder CN chat replies name the model-list entry the request was
built from (m.name), in JSON and every SSE chunk, usage included. A blank
name, or one equal to the slot key, keeps the requested id. No extra
model-list fetch per request; keys, X-Model-Key and model_config unchanged.

Run at the reviewed head 6f9813f7bb44ea243007c1da2495d69de6be2de9:
- bun test in packages/qoder: 266 pass, 0 fail.
- model-identity.test.mjs against main's index.mjs: 28 of 28 fail; at the
  head they pass.
- Merges cleanly onto main; npm has 0.2.37, this is 0.2.38.

Not tried: a real Qoder account.

Closes #412 once the reporter confirms.
2026-10-26 22:45:27 +08:00
mola 03f5952a8b layerfs 0.9.0: commits name their calling agent, trajectory reads each record once (#365)
layerfs 0.9.0 (sim-only): each provision, checkpoint, fork, publish and exec records the calling agent from the tool host's ctx.agent, and the page names it, ahead of the branch-name guess. trajectory() reads each commit record once per backend lifetime (summaries cached, manifest left out) and yields between branches, so a rebuild reads only new commits. Native backend requests are still refused loudly.

Run at e3c7ee94 (macOS): bun test packages/layerfs 57 pass (2 of 3 runs; the third hit ENOSPC on a full disk in 4 #360/accounting tests that pass in the others); origin/main 53 pass. bun scripts/check.mjs layerfs ok. Checked that magpie's host.js runTool passes ctx.agent as execute's second argument.
Not tried: the page in the real magpie app with a live agent.
2026-10-26 18:11:30 +08:00
tianyuanwang989-prog 60a2d6e2e2 gcp-ai 0.1.1: a Windows sign-in reaches gcloud by its own path, and an expiring credit is spendable (#409)
gcp-ai 0.1.1: on Windows, gcloud.cmd is started by its own path (CLOUDSDK_ROOT_DIR, then PATH, quoted entries included), so the batch file's %~dp0 is its own directory and gcloud finds its library. A credit whose status reads "Expiring in N days" counts as spendable until its end date.

Run at 66279e97 (macOS): node --test packages/gcp-ai/test: 44 pass, 3 skipped (Windows-only); origin/main 40 pass. bun scripts/check.mjs gcp-ai ok. The earlier review reproduced the %~dp0 cause and fix on Windows 11 with a fake gcloud.cmd.
Not tried: the new Windows-only tests on Windows at this head (the box was unreachable); the author ran them on Windows 11 with real gcloud 589.0.0.
2026-10-26 18:05:06 +08:00
yetone 0ea458b4a5 minimax 0.1.7: device sign-in polling asks again after a transient failure (#382)
Releases #382 (e228f29). 0.1.6 was already published from #393, so the
bump that #382 carried was a no-op.

Run at this tree: bun test in packages/minimax gives 81 pass, 0 fail.
bun scripts/check.mjs minimax passes.
2026-10-26 16:14:01 +08:00
congee949 e228f291bc minimax: device sign-in polling asks again after a transient failure (#382)
MiniMax's device sign-in no longer ends on a connection reset, a non-JSON HTTP 400, a 408/429/5xx, or a body read that fails while polling. It asks again with the same device code and verifier, up to three times in a row and within the code's deadline. A pending answer resets the count. Denied, expired and bad-client answers still stop at once, and refresh stays single-attempt.

Run at 4b17063, merged onto main d2ada16:
- bun test in packages/minimax: 81 pass, 0 fail. bun scripts/check.mjs minimax passes.
- poll-retry.test.mjs on main's index.mjs: 12 of 19 fail.
- Probe with Bun's real fetch against a local socket server: a reset, then an HTML 400, then pending, then a reset mid-body, then a token. The PR signs in after 8s, and every poll carried the same device_code and verifier. Main fails on the first reset (ECONNRESET).
- Bun reports a reset as code ECONNRESET, which is in the retried list. It reports a refused connection as ConnectionRefused, which isn't, so that is not retried.

Not tried: a real MiniMax account (none used in review). The version goes to 0.1.7 in a following commit, since 0.1.6 is already published from #393.
2026-10-26 16:13:48 +08:00
yetone d2ada161cc zcode 0.1.31: ZCode 3.16's key location gives the coding plan its key (#410)
ZCode 3.16.3 on a Mac keeps no coding plan key in credentials.json or
config.json, only a project-key-location:v1 record
({organizationId, projectId, apiKeyId}, encrypted like the rest). With no
key, plansOf sent the account to the gift and the BigModel GLM Coding Plan
never showed (meraki7304).

ownSignIn now reads that record (the account's own: team null, coding
plan, the profile's user id, the family ZCode is on first), and located()
reads the named key's secret from api_keys/copy/{apiKeyId} with the OAuth
token, as ZCode lists keys (BigModel bare, Z.ai as a Bearer). Only GET:
nothing is created. The record's origin is used only when it is an https
z.ai / bigmodel.cn host, else the site's own API. A 404 leaves the sign-in
as before; another failure says sign in again. Request fetch and usage
resolve it before plansOf.

Record format and auth forms read from ZCode 3.16.3's own app.asar
(ProjectAccessTokenClient / project-key-location:v1).

Run: HOME=$(mktemp -d) bun test in packages/zcode, 119 pass;
bun scripts/check.mjs ok.
Red on old code: the new own.test.mjs case fails with the old index.mjs
(key "" and start true).
Not tried: a real ZCode 3.16 account (no vendor credentials used); the
reporter's read-only check of the same endpoints is the evidence.
2026-10-26 16:03:20 +08:00
wendyeq 2b56b3bc4f zcode: name the conversation in x-session-id as a bare UUID, so BigModel's prompt cache hits (#388)
ZCode's client names every request's conversation in x-session-id: a bare
UUID, the same on each turn (3.14.3 xst/Tst). BigModel keeps a prompt's
cache for the requests that name the same session. The plugin sent none,
so a long conversation seldom hit the cache (#387). Every zcode request,
on the Start Plan and on Coding Plan or team seats alike, now carries it:
- the agent's session (chat.headers' sessionID, which magpie fills) goes
  as it is when it is a UUID, lower-cased;
- any other id (magpie-<hex>, ses_..., sess_...) goes as a stable UUID
  made from its sha256;
- with no session, a UUID made from the device.
metadata.user_id's session_id is the same UUID, in dress() and marked().

Reviewed at 48013c0, which addresses all four points of the earlier
review (UUID shape, session_id in user_id, rebase onto 0.1.30, no
"Closes #387"):
- TMPDIR=<scratch> HOME=$(mktemp -d) bun test in packages/zcode: 125
  pass, 0 fail. bun scripts/check.mjs zcode passes. Merges cleanly onto
  main.
- With main's index.mjs and the PR's tests: 17 fail (all 7 new session
  tests, plus the start, userid and dual assertions on the header).
- Probe through the plugin's chat.headers and loader fetch, as magpie's
  host calls them (host.js passes sessionID and sets out.headers before
  the fetch): magpie-<hex> twice gives the same UUID in the header and
  in user_id.session_id, and ses_other gives a different UUID. None
  contains magpie, ses_ or sess_.

Not tried: a real BigModel request (the author's hit-rate numbers are the
evidence: 3/12 before, 24/24 after through magpie).
2026-10-26 16:02:38 +08:00
yetone 6bd998a3f8 devin 0.1.24: the CLI sign-in's metadata is all strings (#396)
Releases #396 (metadata.cli saved as "true", so OpenCode 1 keeps the
account). Adds the test #396 lacked: the "Devin CLI's sign-in" method,
with a sandbox credentials.toml and a stubbed GetUserStatus, must save
cli as "true" and every metadata value as a string.

Run: bun test in packages/devin (sandbox HOME): 102 pass, 0 fail.
bun scripts/check.mjs devin passes. With index.mjs put back to
`cli = true`, the new test fails and the other cli-key test passes.
2026-10-26 15:57:33 +08:00
A. S. 5068cc3219 devin: the CLI sign-in saves metadata.cli as a string, so OpenCode 1 keeps the account (#396)
Devin CLI's sign-in saved metadata.cli as the boolean true. OpenCode 1's auth
schema (src/auth Api: metadata Record<String, String>, v1.19.4) drops an
auth.json entry with a non-string metadata value. The account then
disappeared and requests went past the plugin's fetch to the placeholder
URL, which returned 404. The flag is now the string "true". live() only
checks that it is truthy, so entries saved with the boolean (magpie's
mover writes one) keep working in magpie. An OpenCode 1 entry already
saved with the boolean stays dropped until the account signs in again.

Reviewed at 151c72f:
- TMPDIR=<scratch> HOME=$(mktemp -d) bun test in packages/devin: 101 pass,
  0 fail. bun scripts/check.mjs devin passes.
- Probe: a sandbox XDG_DATA_HOME with a credentials.toml and a stubbed
  GetUserStatus fetch, then the "Devin CLI's sign-in" method's callback.
  On main, metadata is {email, plan, cli: true}, and cli is the one
  non-string value. With the PR, cli is "true" and every value is a
  string. live() returns the CLI's key in both cases.
- Checked that whoOfStatus gives plan, orgId and teamId as strings too.

Not tried: a real OpenCode 1 run (the schema was read from the v1.19.4
source).
2026-10-26 15:56:45 +08:00
yetone 07e643018e minimax 0.1.6: the credits show how much of them is used, from MiniMax's credit details (#393)
moxuanchen's card showed MiniMax's credits as a bare balance ("1200
credits"), with no share or bar. The membership answer has only what is
left. MiniMax's own web client (agent.minimaxi.com, prod-web-sh-0.1.230)
lists every batch in Settings → Usage → Credit details (积分明细): GET
/minimax-cloud/api/v1/credit/details with page_number, page_size 20 and
include_expired, answering { details, total_count }; each batch has
credit_type 1 purchased / 2 check-in, granted/consumed/remaining_amount as
decimal strings (commas allowed, a remaining below 0 read as 0) and
expire_at_ms. That is the reporter's endpoint, checked in the client's
own bundle (the npm CLI @minimax-ai/code 0.6.12 doesn't have it).

usage now reads every page of it (signed, to the account host, as the
check-in's minimax-cloud calls go) and adds a Credits window of the
batches not yet expired: used = granted - remaining, amount/limit/unit
"credits", and runsOutAt/runsOut for the soonest batch with credits left.
Beside an M Plan it is aside. A ledger that can't be read whole (an error,
a list shorter than total_count, an amount that isn't one) adds no window
and leaves the balance as before: a part of it would tell a wrong share.

Run: bun test in packages/minimax (nonet, fake hosts): 62 pass 0 fail. On
the old index.mjs the three new tests fail. bun scripts/check.mjs:
minimax ok.
Not tried: a real MiniMax account (no vendor credentials used), so
whether the account host answers this path signed as the check-in is
signed is not seen; if it refuses, the card is as it was.
2026-10-26 15:54:06 +08:00
yetone 634a865346 kiro 0.1.17: credits tell their count, so magpie's "Left" shows what is left (#408)
Fidelxyz switched magpie's usage to "Left" and Kiro's credits still read
as used ("12.5 / 50"). magpie turns a window round only from its count
(amount, limit, unit; quotaCount in app.js): display alone is the
vendor's text, shown as it is. usageOf now gives each Credits and Free
trial window amount = currentUsageWithPrecision, limit =
usageLimitWithPrecision and unit "credits"; display is unchanged.

Run: HOME=$(mktemp -d) bun test in packages/kiro: 57 pass 0 fail. On the
old index.mjs the two usage tests fail (amount/limit/unit missing).
bun scripts/check.mjs: kiro ok.
Not tried: a real Kiro account (no vendor credentials used); the window
shape is the one workbuddy's Credits already shows "left" with.
2026-10-26 15:50:26 +08:00
yetone f32736f015 zen-free 0.1.16: requests go with OpenCode 2.0.25's User-Agent, since Zen refuses the 1.19.0 one 0.1.15 sent
杨梅 (yangmei_61422) on magpie's Discord, 10-26: Zen Free from Kimi
Code/Work fails again ("反代失败") a day after 0.1.15.

Cause, found against opencode.ai from this machine on 2026-10-26: Zen's
free tier now answers 429 FreeUsageLimitError ("Free usage limit
reached. Free models work in OpenCode") to the exact User-Agent 0.1.6 to
0.1.15 sent, OpenCode 1.19.0's
`opencode/1.19.0 ai-sdk/provider-utils/4.0.23 runtime/bun/1.3.14`,
whatever the body says. One request (short system prompt + the <env>
block + the five core tools, our other headers), only the UA changed:
that exact string 429; with provider-utils 4.0.24, bun 1.3.15, opencode
1.19.1, the ai-sdk or runtime part dropped, or an "x " prefix: 200;
"opencode/latest/2.0.25/cli" (what OpenCode 2.0.25 sends,
`opencode/${channel}/${version}/${name}` in its binary): 200. So it is
that one string, the plugin's fingerprint, not a version floor. The env
block is still needed: 2.0.25's UA without it is 429. Path
(/inference/v1), project "global", x-opencode-request and the
x-session-* pair made no difference either way.

Fix: userAgent() is OpenCode 2.0.25's on every protocol, and the header
set is the one captured from 2.0.25 on 10-25: its session id also under
x-session-affinity and x-session-id, no x-opencode-request. A caller's
own session headers still never go on.

Run:
- Real, through the plugin's loader.fetch: a Kimi Code request (its
  system.md rendered, Shell/ReadFile/Glob/Grep/WriteFile/StrReplaceFile/
  SetTodoList with Kimi's own descriptions, UA KimiCLI/1.0) and a plain
  one. At origin/main (0.1.15): deepseek-v4.1-flash-free 429
  FreeUsageLimitError for both. With this change: deepseek-v4.1-flash-
  free, glm-5.3-flash-free and big-pickle 200 for both.
- tools-smoke.mjs, real: big-pickle and mimo-v2.6-flash-free, stream and
  not, 200 with a Bash call.
- Header tests (project identity x4, per-protocol header set x3, the
  streaming one): red on origin/main's provider.mjs (8 of 199 fail),
  green with it.
- HOME=$(mktemp -d) bun test at the repo root: 2675 pass, 0 fail;
  bun scripts/check.mjs: ok.

Not tried: Kimi Code or Kimi Work themselves through magpie (the request
was built from Kimi CLI's installed prompt and tool files); a Responses
or Anthropic free model (Zen lists none free now).
2026-10-26 15:07:51 +08:00
yetone 9da5cd3426 workbuddy 0.1.35: used credits say when the plan's cycle starts again (windy on Discord)
windy's WorkBuddy card in magpie showed 46% of the credits used and,
beside it, "Not used yet". The Credits window had no resetsAt, and
magpie's card says "Not used yet" when no used window has a reset.
WorkBuddy's own client (5.5.6, getCurrentPlan) says the plan refreshes at
the cycle end of the package the summary names as the subscription
(SubscriptionPackageCode). cycleOf now gives the Credits window that
reset (CycleEndTime, UTC+8) and the cycle's span, from the paid and free
lists usage already reads for runsOutOf; none named, not listed or a
cycle already over leaves it unknown, as before.

Run: bun test in packages/workbuddy, sandbox HOME, fetch stubbed: 154
pass 0 fail. On the old index.mjs the two new tests fail (resetsAt
undefined; cycleOf's cases). bun scripts/check.mjs: workbuddy ok.
Real: the summary and paid list of a real WorkBuddy AI Pro account
(2026-10-26, read-only, no renewal) through the new code give Credits
89.2 / 2000, resetsAt 2026-10-28T16:40:52Z, span 30d-1s.
Not tried: a China-site (copilot.tencent.com) account: the desktop
sign-in on this machine is refused (401), so a CN free plan's
SubscriptionPackageCode wasn't seen; without one the card stays as it
was. magpie's card saying "Not used yet" beside a used window without a
reset is fixed in magpie itself.
2026-10-26 15:00:30 +08:00
yetone e5136447b7 skills: magpie-setup, an agent sets magpie up as the user asks
Asked for by Leyuu_5 on X ("功能越来越多,感觉可以来个skill让AI来帮设置需求了").
The skill teaches an agent to read magpie's state, then turn a request
into magpie's own commands: keys and subscriptions, an agent's model,
routing groups with fallbacks and rules (time of day with a zone,
tokens, images, folders, compaction, intent), gateway keys with budgets
and model lists, model names/prices/visibility, and the library's MCP
servers, instructions and web search. It says what to ask before
(replacing, removing, sign-in) and what never to run unasked, and that
a subscription is never set up for another person's use.

What was run: every command in SKILL.md was read from magpie's
internal/cli source at origin/main d2e0ea393 and run against a magpie
built from it, in a sandbox HOME (provider add preset/url/anthropic/
ollama, provider test/models/fallback/off/on/rpm, account-cap,
group add/set models+=/template, every rule form incl.
time=09:00-18:00@Asia/Shanghai and tz=, rule mv/rm, gateway-key
add/list/limit month --cost 20/limit add day --tokens/models, model
name/disable/price/context, visible, library mcp add/instructions,
search add, save/use, claude/codex set and default, healthcheck,
usage, quota). Two magpie bugs found doing so are fixed there
(gateway-key limit <id> month refused; library mcp add with no agents
said every agent had it) and ship with the next tag.
Not tried: accounts add / plugin login (a real browser sign-in),
daemon install, webdav, backup/restore.
2026-10-25 19:12:17 +08:00
yetone 8531ccc532 commandcode 0.1.17: the Credits window comes second, so magpie's account line and menu bar show the plan's dollars (01huadalang on Discord)
01huadalang: "command 的订阅插件没有显示总额度剩余的条子". A Pro, GOAT,
Max or Ultra account reports 5 hours, Weekly and then Credits. magpie's
Providers account line (quotaLine) and the menu bar (trayusage) show an
account's first two windows only, so the Credits bar, the plan's whole
allowance, was never drawn there; it sat in the tooltip. allowanceOf now
puts Credits right after the first window: 5 hours, Credits, Weekly. The
5-hour window stays first, so the Usage card's spark and pace line are
unchanged; Weekly moves to the account line's tooltip. Accounts with one
limit window (Weekly, Credits) or none (Go: Credits alone) are as before.

Not this change: #303 (amount/limit on the Credits window) is held, as
reviewed on it: on every released magpie a window with a limit is
printed as "17.89 / 70" with no "$" in both modes, until magpie formats
a unit "usd" window as money (#301 step 1, not landed).

Run (HOME a temp dir without "magpie" in its path; no-magpie.test.mjs
greps every request for the word and finds the HOME in the Go body
otherwise):
- packages/commandcode bun test: 65 pass, 0 fail.
- bun run check: exit 0, every package.
- Old code: usage.test.mjs's "a Max account: its 5 hours, its credits
  second ..." fails on origin/main's index.mjs (12 pass, 1 fail: Weekly
  where Credits is expected).
- Real account: the owner's GOAT key through hooks.auth.usage now gives
  [5 hours 0.93%, Credits $0.63 / $70.00, Weekly 1.20%] (before: 5 hours,
  Weekly, Credits).
Not tried: a Go, Pro, Max or Ultra account (none here).
2026-10-25 18:56:03 +08:00
yetone 564719b9d9 zen-free 0.1.15: an agent's prompt goes with OpenCode's environment block, so Zen serves it as OpenCode's
杨梅 on magpie's Discord: deepseek-v4.1-flash-free and glm-5.3-flash-free
answered from OpenCode, while the same models from Kimi Work and WorkBuddy
failed at once with 429 (magpie: "额度用尽").

Cause, found against opencode.ai from this machine on 2026-10-25: Zen's
free tier tells OpenCode's requests by the body, not the headers. A
request whose system messages carry OpenCode's environment block (`<env>`,
a `Working directory:` line, `</env>`) is served; one without gets a small
allowance a day, then 429 FreeUsageLimitError "Free usage limit reached.
Free models work in OpenCode", Retry-After to 00:00 UTC. Captured real
OpenCode 2.0.25 (sandbox HOME, MITM with a sandbox CA) and replayed its
request: 200. Its headers with another system prompt, or without tools:
429. Our headers (1.19.0 UA, /inference/v1) with its body: 200, so UA,
path (/inference/openai/v1 vs /inference/v1), session ids, project and
trace headers don't matter. Bisected the prompt to the <env> block: case
sensitive, needs "Working directory:", counts only in a system message
(in a user message or a tool description it doesn't), value free
("unknown", "/" and "" all pass), and still needs tools (the core
stand-ins already sent pass).

Fix: addEnvironment appends "<env>\n  Working directory: unknown\n</env>"
to the agent's first system message (a part of its own for content in
parts, a new first system message when there is none), Anthropic's
`system` and Responses' `instructions` likewise. A prompt that already
has a block, as OpenCode's does, goes as it is. The directory isn't known
in the plugin and the agent's own prompt says it, so it is said as
unknown, not a path that would mislead the model or leak the user's.

Run:
- Real, through the plugin's loader.fetch from this machine (whose
  non-OpenCode allowance was used up): a WorkBuddy-like request (its own
  system prompt, a Read tool, WorkBuddy UA) at origin/main's provider.mjs:
  deepseek-v4.1-flash-free 429 FreeUsageLimitError (2.3s), glm-5.3
  stream 429 (1.8s), the reporter's case. With this change: deepseek 200,
  glm-5.3 stream 200, big-pickle 200.
- tools-smoke.mjs, real: big-pickle and mimo-v2.6-flash-free, stream and
  not, 200 with a Bash call.
- New test, per protocol: the block added once after the agent's prompt,
  added with no prompt and for content in parts, added when the block is
  only in a user message, an OpenCode prompt left as it is. Red on
  origin/main's provider.mjs (3 of 3 fail), green with it.
- HOME=$(mktemp -d) bun test at the repo root: 2670 tests, 0 fail;
  bun scripts/check.mjs: ok.

Not tried: a Responses or Anthropic Messages free model against Zen
(Zen lists none free now; all eight are Chat), so where Zen looks for the
block on those two is a guess from Chat's. Kimi Work and WorkBuddy
themselves weren't run; their request was built by hand.
2026-10-25 18:33:40 +08:00
yetone 57598ad410 zcode 0.1.30: a coding plan's requests name the device in metadata.user_id, as ZCode's do (#387)
wendyeq measured BigModel's GLM Coding Plan through magpie hitting the
prompt cache 1 time in 19 without metadata.user_id and 13 in 16 with it;
the official ZCode on the same account reads 95-98% of input from cache.
The plugin only put user_id on the Start Plan's dressed body; a coding
plan or team request went as the agent sent it, and Pi sends none.

ZCode 3.14.3 (glm/zcode.cjs) sets it on every Anthropic-format request,
not only the Start Plan's: Pst() returns MLs({deviceMid, sessionId}) for
any providerKind "anthropic", and vWr() puts it in
providerOptions.anthropic.metadata.userId for both generateText and
streamText. The value is {"device_id":<machine id>,"account_uuid":"",
"session_id":...}.

Now a coding plan or team request to .../v1/messages gets
metadata.user_id = {"device_id":<sign-in's saved device>,
"account_uuid":"","session_id":""}, the same value dress() puts on the
Start Plan's, when the agent sent no user_id of its own; other metadata
is kept and content-length dropped when the body changed. count_tokens
and non-Messages bodies go as they were. An account known only by a key
(a pasted API key, or a saved state with no device) gets a device id
hashed from the key, so it is the same on every start rather than
anyDevice, which was new per process.

Differences from ZCode, kept on purpose: ZCode overwrites any user_id
and fills session_id with its session (sess_ prefix stripped); this
keeps an agent's own user_id and sends session_id "" as dress() does,
one stable value per account.

Tests: userid.test.mjs (new, 6 tests; 5 red on origin/main's index.mjs,
the count_tokens one passes there as it should). start, toolsearch and
dual tests that pinned coding plan bodies byte for byte now expect the
agent's body plus the device's user_id.
Run at this tree: HOME=$(mktemp -d) bun test -> 2672 pass, 1 skip,
0 fail across 229 files; bun scripts/check.mjs ok.
Not tried: a real BigModel or Z.ai coding plan request, so the cache
hit rate after the change is the reporter's measurement, not mine.
2026-10-25 18:25:51 +08:00
wang2 6188ab5be7 search1api 0.1.0: Search1API's six tools with API key or OAuth sign-in (#384)
Adds packages/search1api as @magpie-community/tools-search1api 0.1.0
(fatwang2, replacing #340). It has six tools: search, news, ask, crawl,
sitemap and trending. Sign-in is one account by API key or OAuth: PKCE
S256, dynamic client registration and a loopback callback. Tokens refresh
through auth.refresh and on a 401. scripts/check.mjs now accepts a tools
plugin with auth and no loader, as long as its config gives the provider
no npm and no models.

Run at 7cf6a5c merged onto main, in a sandbox HOME, with HTTPS_PROXY
pointed at a dead port:
- bun test packages/search1api scripts/check.test.mjs: 19 pass.
- node --test on the package's own tests: 16 pass.
- tests/host.integration.mjs against main magpie's host.js: 2 pass.
- bun test across the whole repo: 2647 pass, 0 fail. This needs 017f05c.
  Before it, gcp-ai's fetch guard refused this package's loopback
  fixtures in the shared bun process.
- bun scripts/check.mjs: all ok.

Broken by hand, each one red:
- Dropping the SAME_SESSION check before a refresh: 1 test.
- Never refreshing an expired token: 3 tests.
- Ignoring the apiKey option: 4 tests.
- Not red: dropping the second check, which catches a logout during an
  in-flight refresh. The first check covers it in the logout test.

Real use:
- A sandbox magpie took the package with `plugin add`. `plugin list`
  shows its 6 tools. `plugin login search1api 2` with a key showed
  Providers as "Search1API · signed in as API key …-384 · no models
  exposed".
- The search tool ran against the real api.search1api.com with a fake
  key and got 401.
- OAuth discovery is live: oauth-protected-resource points to
  clerk.s1.dev, which has a registration endpoint and S256.

Not tried:
- A real OAuth consent, or a search with a real key. There is no
  Search1API account here.

Notes:
- The plugin reads the signed-in record from
  `<directory>/plugin-auth.json` itself, since tools get no getAuth.
  magpie writes that file by temp-and-rename, so a read never sees half a
  write.
- magpie's login line says "its models are search1api/<model>" for a
  provider with no models. That is magpie's wording, not this PR's.
2026-10-25 17:53:00 +08:00
yetone 017f05cbb9 gcp-ai tests: the network guard lets another package's loopback fetch through
gcp-ai's test/network.mjs (from #307) replaced globalThis.fetch with one
that refuses every call. bun test runs every package in one process, so
the guard outlived gcp-ai's files: with #384 merged on top, all eight
Search1API tests that fetch their own 127.0.0.1 fixture failed with
"Unexpected network fetch in test: http://127.0.0.1:…/search" in the
repo-wide run, and passed alone. fetch now refuses only a non-loopback
host, as the socket, http and dns hooks beside it already did. The real
fetch stays inside the module, never on globalThis.

Run (sandbox HOME under TMPDIR, HTTPS_PROXY at a dead port):
- bun test packages/gcp-ai: 40 pass, 1 skip, 0 fail.
- A script importing the guard: a Bun.serve loopback fetch answers "ok";
  https://example.com is refused and the process exits 1.
- bun test (whole repo) with this file over #384's merge: 2647 pass,
  1 skip, 0 fail. Without it: 2638 pass, 9 fail (8 Search1API, plus one
  gcp-ai Chrome test that lost its CDP connection, which passed in the
  next run).
- bun scripts/check.mjs: every package ok.
2026-10-25 17:52:37 +08:00
yetone 5c9b7a4137 zcode 0.1.29: a sign-in keeps the account's user id beside its name
wakkana on Discord reported WorkBuddy accounts of one name collapsing
into one. WorkBuddy's plugin already keeps a uid, which magpie's plugin
host tells same-name accounts apart by. ZCode names an account by email,
else by its name, and gave no uid, so two ZCode accounts with no email
and one name were one account in the host. Both sign-ins (browser and
the ZCode app's) now give uid: user_id. The app's entry also follows
ZCode only while ZCode is signed in to the same user id, not another
account of that name.

Run: HOME=<scratch> TMPDIR=<scratch> bun test in packages/zcode, 112
pass. Both new tests (own.test.mjs, team.test.mjs) fail with index.mjs
from HEAD (uid undefined). bun scripts/check.mjs green.
Not tried: a real ZCode sign-in; whether ZCode's poll user carries
user_id is read from who(), which already reads it.
2026-10-25 17:37:19 +08:00
Kun Songandbborn2 36d8902601 cursor 0.2.23: send cursor-agent's team in x-cursor-team-id (#231)
cursor-agent sends the team a request is billed to in `x-cursor-team-id`, from
cli-config.json's `authInfo.activeTeamId`. Without it, Cursor takes the
token's default team. In an organization that team may have on-demand spend
turned off, and the request then fails with "Team budget limit reached".

The plugin now sends the same header on Run (both the native and the stateless
path) and on the dashboard calls. It takes the team only when the token's
`sub` is the config's `authInfo.authId`, so an account signed in from magpie
never gets another account's team. GetHardLimit and GetCurrentPeriodUsage still
go out with `{}`, as cursor-agent sends them. GetFilteredUsageEvents names the
team only when there is one. The config's location (CURSOR_CONFIG_DIR, then
$XDG_CONFIG_HOME/cursor, then ~/.cursor) and the team check (a positive
integer) match cursor-agent 2026.10.01's paths.js and request.js.

Run at d4476ff merged onto main 1fbe22b, in a sandbox HOME, with the network
pointed at a dead proxy:
- `bun test` (whole repo): 2640 pass, 0 fail. `bun test packages/cursor`:
  303 pass. `bun scripts/check.mjs cursor`: ok.
- Broke each change by hand, and team-id.test.mjs went red each time (11 pass,
  1 fail): the header removed from runNative, the header removed from runOnce,
  and the team put back into GetCurrentPeriodUsage's body.
- Real Cursor account (no team) through the plugin's loader: one chat turn with
  a config that has no team, and one whose activeTeamId is a team the account
  isn't in. Both returned 200 "ok", so a single-team account is unchanged. The
  author ran a real account in two teams: the budget-spent team returned 429,
  the other returned 200.

Not tried: a multi-team account here. Accounts signed in from magpie get no
team (#233 covers those).

Co-authored-by: bborn2 <bborn2@users.noreply.github.com>
2026-10-25 17:37:12 +08:00