zcode 0.1.55: no claim while ZCode asks its security check; the desktop's X-Title and a per-turn x-query-id

young02036 (Discord, 11-07): on an account with a GLM Coding Plan, the
GLM-5.3-Flash-Trial gift answers 405 code 3012 ("blocked due to unusual
activity") while the paid models work, and the plugin's daily check-in
gets a captcha every day while the app shows none.

Diffed against the official ZCode 3.17.2 (zip sha512 matched its
manifest; glm/zcode.cjs and app.asar's host and renderer code):

- The claim. The app's claimManualPlan posts the claim with
  X-Aliyun-Captcha-Verify-Param/Region, and its renderer always runs the
  traceless captcha first. client/configs says captcha.enabled true
  (testdata/client-configs-1107.json, the real reply cut down). The plugin
  can't make that proof, so each day's claim was one more refused claim.
  Now claimDaily reads client/configs (cached ten minutes, a failed read
  not kept) before posting: while captcha.enabled is not false nothing is
  posted and each plan answers captcha, "claim it in the ZCode app"; a
  config that doesn't read is failed, nothing posted. The captcha is not
  got past.
- X-Title. The desktop's model requests say "Z Code@electron"
  (sourceTitle from zcode-protocol-entrypoint); the plugin said
  "Z Code@cli".
- x-query-id. ZCode sends one per user query (query_<uuid>, prefix
  stripped). The Start Plan path now sends a UUID made from the session
  and the count of user text messages: the same through a turn's tool
  results, new with the next user message.

The 3012 itself: on the owner's account (no gift, so code 1005 "exceed
quota limit" means risk control let it through) every shape answered
200 code 1005: adaptive thinking with effort max and max_tokens 64000, a
1.6 MB body, max_tokens 200000, thinking enabled with budget 1024, and
X-Title electron. So the request's shape is not what trips 3012; the
reporter's account looks blocked by risk control as a whole, which only
ZCode support lifts. That the daily captcha-less claims fed it is a
guess.

Run (mote): HOME=$(mktemp -d) bun test in packages/zcode, 222 pass 0
fail; bun scripts/check.mjs zcode ok.
Broken by hand, each red, then restored (cmp ok): the claim gate removed
(2 fail), a config read failure taken as no captcha (1), x-query-id not
set (2), user turns counted wrong (1), the title back to cli (3).
Not tried: a real claim or a real 3012 account (the reporter's); the new
headers against an account that has a gift; Windows and Linux.

Reported-by: young02036
This commit is contained in:
yetone
2026-11-07 14:57:59 +08:00
parent e7cb9dc54c
commit ea9904d54c
7 changed files with 195 additions and 13 deletions
+11 -1
View File
@@ -31,7 +31,10 @@ over Anthropic's Messages API. Provider id: `zcode`.
picks by it, so without it the cache is mostly missed (#387). An
account known only by its key gets a device id made from the key, the
same on every start. Every request also carries the `x-session-id`
header below. zcode.z.ai also
header below. ZCode's headers are the desktop app's (3.17.2):
`X-Title: Z Code@electron`, and an `x-query-id` per user turn, a UUID
that stays the same through the turn's tool results and is new with
the next user message, as ZCode makes one per query. zcode.z.ai also
answers 405 code 3012 to every request of an account its risk control
blocked, ZCode's own app's included (plugins#348). That answer comes
back as ZCode's words, then "ZCode's risk control blocked this account
@@ -326,6 +329,13 @@ the body's code, not the HTTP status:
read is *failed*, never nothing to claim;
- code 0: *claimed* (the next request uses the plan);
- code 1003 "target already exists" (HTTP 200): *done*, claimed before;
- ZCode's own client config (`GET /api/v1/client/configs`, read at most
every ten minutes) says whether a claim needs its security check
(`captcha.enabled`). While it does, which is so since 11-07, nothing is
posted: every plan answers *captcha*, "claim it in the ZCode app", since
a claim without the app's proof only spends one of ZCode's refusals. A
config that doesn't read answers *failed*, and nothing is posted then
either;
- code 3007 "captcha verify failed": *captcha*, the plan is claimed in
the ZCode app — the claim is gated on the Aliyun captcha the app's
renderer answers, and a claim from outside the app is refused it