Files
plugins/packages
yetone 1dbbc1fb48 zcode 0.1.65: a -Trial pick with no gift names the weekend plan ZCode holds unclaimed (heduian, bg5eau on X)
heduian and bg5eau on X (11-14, a Saturday): magpie no longer uses
ZCode's weekend gift. GLM-5.3-Flash-Trial is not in the list, a
manually added one answers "ZCode has no active limited quota", and
free first spends the weekday gift but not the weekend's.

Diffed against the official ZCode 3.18.2 (zai-org/ZCode fec975905,
11-13) and 3.17.2 (a9fe401ee):

- The weekend plan (ZCODE WEEKEND BUILD, testdata/touch-1030-wk.json)
  is a gift ZCode holds until it is claimed from the app's banner. The
  claim (MarketingTouchProvider -> prepareRequestVerificationClaim ->
  claimManualPlan) carries the app's Aliyun captcha proof in 3.18.2 as
  in 3.17.2, and client/configs still says captcha.enabled true. The
  plugin has posted no claim since 0.1.55 (11-07), and claims without
  the proof were refused 3007 since 10-06. Until the plan is claimed
  in the ZCode app it has no balance bucket, so the plugin lists no
  -Trial entry for it and free first has nothing to spend. That is the
  report. The captcha is not got past.
- The Start Plan request: 3.18.2's headers (buildCliZCodeSourceHeaders,
  zcode-source-headers.ts) are the plugin's startHeaders but for the
  version (3.17.2) in User-Agent and X-ZCode-App-Version;
  @ai-sdk/anthropic is 3.0.81 in both. Start's credential in 3.18 is
  the shared ZCode JWT, as the plugin sends. No header picks a plan or
  bucket: the server chooses which bucket a model spends.
- The balance read (zaiStartPlanBilling.ts) is unchanged in 3.18, and
  on the owner's account the balance, the feed and client/configs
  answer the same for app_version 3.17.2 and 3.18.2. APP_VERSION stays.

So the change is the refusal: a -Trial pick that finds no gift now
reads the claim feed (toClaim; kept ten minutes per session, a failed
read names none and is not kept) and, when ZCode holds a plan there,
says "ZCode holds ZCODE WEEKEND BUILD for this account unclaimed:
claim it in the ZCode app (its claim needs the app's security check),
and GLM-5.3-Flash-Trial spends it". Nothing is claimed and no model is
asked. The card's "Gift plans to claim in the ZCode app" line was
already there. README says what happens until the claim.

Run (mote, sandbox HOME): bun test in packages/zcode, 265 pass 0
fail; bun scripts/check.mjs zcode ok. Real account (owner's, sandbox
HOME): unclaimed() read the live feed, [] (no weekend delivery on that
account today).
Broken by hand, each red, then restored: the refusal without the feed
(2 fail), the ten-minute keep removed (1 fail).
Not tried: a real account holding a weekend plan (the owner's has no
delivery or balance plan today), and a claim in the ZCode app followed
by a request; Windows and Linux.
2026-11-14 18:17:21 +08:00
..
middleware: param-override, model-map, system-prompt, word-guard and think-tags — gateway middleware that magpie runs on every agent's requests and replies, mostly New API's channel settings with the same JSON (the owner) — magpie can now run a plugin as gateway middleware (onRequest, onEvent, onResponse, in-process on moejs), and these are the first ones: param-override is New API's param_override (both forms, operations with gjson paths and conditions, return_error); model-map is model_mapping (chains, /regex/ keys with $1) and puts the asked-for name back into replies; system-prompt adds a prompt in each API's own place, keeping an agent's own unless override (New API's semantics), by agent or model; word-guard is the sensitive-word filter (reject or mask the user's text, optionally replies); think-tags strips a leading <think>…</think> from replies across stream chunks, or puts Chat reasoning_content into the text (thinking_to_content). Each is one file with no imports, named @magpie-community/middleware-<name>, with magpie.options as the example the app's editor starts from; registry.json lists them with "kind": "middleware" and no providers; check.mjs skips middleware-only packages. scripts/middleware.mjs calls the hooks as the gateway does (events split, [DONE] passed by) and runs each package's cases.json. Tested with a real DeepSeek account and real Claude Code through magpie's gateway: a mapped model named back in message_start, max_tokens capped, a system prompt appended for claude only, a word turned away as a 400 in Anthropic's shape, return_error as a 403 in Chat's, <think> stripped from Chat and Responses streams and an Anthropic whole reply, reasoning_content moved into the text. bun test (61 for these five) and bun scripts/check.mjs pass; packages/devin's two image tests fail on this machine only, as on main. Their first npm version has to be published by hand (trusted publishing can't create a package); until then magpie shows them as Coming soon.
2026-10-05 20:49:42 +08:00