7b42e404f5f656d7bfb4aa5c7ddbcd1031264a86
10
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
ea9904d54c |
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
|
||
|
|
e0769e8e20 |
zcode 0.1.52: hold a rate-limited account in the plugin until ZCode's wait is over (#503)
When ZCode rate limits a check-in (HTTP 429 on the touch feed, or code 3002 on a claim), the plugin now holds that account itself. Until the wait is over, a check-in answers the same failed (message and until) and sends no request. The wait follows Retry-After (seconds or a date) up to six hours. Without one, it doubles from 30 minutes. A read that comes through with nothing rate limited forgets it. magpie before v0.1.3165 asks a failed again after 30 minutes whatever its until says, which is how #503 saw 180 reads in four days. The hold is keyed by the account (s.key || s.jwt), so keyless Start-Plan sign-ins each have their own. It lives in memory, so a restart forgets it. Run at 017e5dfc (merge base |
||
|
|
81df338116 |
zcode 0.1.50: a claim's code 1004 is ineligible, read again in half an hour (kongbai01203, #729)
A claim ZCode answers with code 1004 (HTTP 400, a plan the account is not offered at that moment) is read as ineligible, naming the plan, and asked again half an hour out as an inactive is, instead of failed. Captcha (3007) is unchanged: still "claim it in the ZCode app", never solved. Version 0.1.50 (maintainer bump on the PR branch). Run at 6837f27e on mote (macOS, Bun 1.4.2, sandbox HOME): - packages/zcode `bun test`: 199 pass, 0 fail. `bun scripts/check.mjs zcode`: ok. - Broken by hand: dropping the 1004 branch in claimOne turns 3 checkin tests red; dropping the recheck `until` on an ineligible turns 2 red. - magpie's host accepts "ineligible" with an until and asks again at it (host.js checkinOutcomes, plugin_checkin.go ValidUntil). Not tried: a real 1004. The owner's one ZCode account answered 3007 (captcha) for zcode-v3-start-plan-1029 and zcode-v3-start-plan-gb-1104 under both 3.16.3's and 3.17.2's header, so the fixture's message text is the author's, from their six accounts on 11-04. Co-authored-by: kongbai01203 <kongbai01203@users.noreply.github.com> |
||
|
|
8fc12a38b3 |
zcode 0.1.46: sign in as ZCode 3.17.2 and take a Start Plan that starts later
Three changes, each matching the client's source at zai-org/ZCode@a9fe401 (v3.17.2): - Every call goes out as 3.17.2: the sign-in, the Start Plan balance, the config, the requests, and (as in #678) the feed and the claim. ZCode gates by the version. #678 found the feed answers empty to 3.16.3, and the balance "judges capability by the real app_version" (zaiStartPlanBilling.ts). MARKETING_VERSION folds into APP_VERSION. - A sign-in whose only Start Plan starts later is taken, not refused with "has ended or was never started". ZCode's resolveStartPlanBalanceAvailability counts such a plan ("pending") as the account's. startPlan takes it only when the sign-in asks (coming); requests and the card are unchanged, and the card already names its start. - X-Client-Language on the feed is zh-CN or en-US only, as marketingTouchService's localeSchema sends it. Before, it was the computer's locale as it was (zh-Hans-CN, en-GB, ...). Run at this tree on mote: - bun test packages/zcode: 191 pass, 0 fail. - bun scripts/check.mjs: clean. Broken by hand: - APP_VERSION back to 3.16.3: 7 red, among them the two new sign-in tests through their balance app_version check. - The sign-in without coming: those 2 red. - The old locale: the language test red. Not tried: a live sign-in, balance or feed. No ZCode account was in a sandbox. Whether the balance answered sliyrainbow's account with no plan under 3.16.3 or with one that starts later is not known; this fix covers both. Reported by jinpy666 (#676) and sliyrainbow (Discord). |
||
|
|
017a7ee3b2 |
zcode 0.1.45: the daily claim reads the feed as the current client does (#678)
The marketing feed (touch) and the claim now go out under ZCode 3.17.2's version header. jinpy666 found that under the pinned 3.16.3 the feed answers empty, while under 3.17.2 the day's banner shows, and checked it against the live API. The check-in no longer reads /billing/preview, which the v3.17 client doesn't poll (docs/marketing-touch-client.md in zai-org/ZCode@a9fe401). Reviewed at f805d97 and run there on mote: - bun test packages/zcode: 187 pass, 0 fail. - bun scripts/check.mjs: clean. - Broken by hand: with MARKETING_VERSION set back to 3.16.3, 4 tests go red (the touch and claim version pins, and the card's feed read). Not tried here: a live feed or claim. No ZCode account was in a sandbox, so the live run is jinpy666's (10 accounts: 7 captcha, 3 inactive). Reported by jinpy666 (#676), who wrote the fix. |
||
|
|
081c4cb8f0 |
zcode 0.1.41: a nothing-to-claim check-in asks again in half an hour (#600)
A plan feed answer of nothing to claim (`inactive`) now carries an `until` half an hour out, so magpie's check-in loop asks again during the day and a gift plan dropped into the feed after the day's first ask (the 19:00 Beijing weekend plan) is claimed before it expires. captcha, claimed, done and failed answers still stand for the day. Bumps the package to 0.1.41. By Pr1p. Run at c655b088ef0eba6e130b78c867e429b6c39ac09c on the Mac mini (Bun 1.4.2, temp HOME): - `bun test` in packages/zcode: 184 pass, 0 fail. - `bun scripts/check.mjs zcode`: ok, exit 0. - Broken by hand: putting `until` on the captcha answer turns "an inactive says until half an hour out…" red (1 fail); removing it from inactive turns 3 tests red. - package.json changes only the version (0.1.40 to 0.1.41). Not tried: a real ZCode account over a day. The README and the RECHECK comment still name "a reset card" among what arrives in the plan feed; reset cards are customer-package-reset and are not claimed here. That wording is fixed in a follow-up commit. |
||
|
|
28881086c5 |
zcode: the daily claim is tested on #503's real marketing/touch reply
kongbai01203 posted the real GET /api/v1/marketing/touch?seq=0 reply
(10-30 22:11 +08:00, comment 6526694290) for the account that claimed
ZCODE WEEKEND BUILD. It is in packages/zcode/testdata/touch-1030-wk.json
as their bytes. Their paste was cut inside
success_popup.description.content's HTML (2510 of 2628 characters), so
only the closing `"}}}}]}}` is added and their trailing "…" taken off.
0.1.39's parser handles it as it is; no change to index.mjs, no version
bump (the package's published files are unchanged):
- checkin: the one claim_zcode_plan button is claimed once with
{"plan_id":"zcode-v3-start-plan-1030-wk"}, named ZCODE WEEKEND BUILD;
the close button ("args": null) and the success popup's navigate and
copy_text buttons claim nothing, and nothing goes to touch/action.
- the same delivery with its claim button taken out is inactive, though
its background and success popup still carry the zcode_plan.
- after the claim, deliveries is empty (their second finding, count
theirs, bytes the real reply's top level): inactive, not failed.
- the card's claim line from the real feed: "1 · ZCODE WEEKEND BUILD".
What the real reply has that the 0.1.39 hand-made fixture didn't:
button text as {format, content}, a close button's args null, a bundle
background, resource_position and priority, and a success_popup inside
the banner repeating the zcode_plan.
Run on mote: HOME=$(mktemp -d) bun test (3880 pass, 0 fail) and bun
scripts/check.mjs (exit 0). Broken by hand: claiming a zcode_plan's
plan_id with no claim button turns "the real delivery without its claim
button" red (the hand-made closeOnly case stayed green); naming a plan
from a later zcode_plan when the first is the same turned the two
real-feed tests red. Not tried: a complete, uncut touch reply (the
reporter will post one at the next window), and a real claim through
the plugin.
|
||
|
|
2e580cfead |
zcode 0.1.39: gift plans are also claimed from the ZCode app's banner feed (#503)
kongbai01203 found on 10-30 that a ZCode claim banner's plan (ZCODE
WEEKEND BUILD, 500M GLM-5.3-Flash tokens) is in neither
/billing/preview nor /billing/current while the app shows the banner,
so 0.1.35's daily claim said "no ZCode gift plan to claim". The app
reads the banner from GET /api/v1/marketing/touch?seq=<n>: each
delivery's banner button with action type claim_zcode_plan carries the
plan_id, and the claim is the same POST /billing/claim. Their capture
has a real code 0 claim reply ("Plan claimed successfully.").
- toClaim reads both lists (the feed first, then the preview) and keeps
each plan_id once; claimDaily and the card's claim line use it.
- The feed goes out with what the capture shows the app sends: the
session, X-Device-Mid, X-ZCode-App-Version and X-Client-Language
(the system locale), seq counting up from 0 per process.
- A list that doesn't read is failed (asked again later), never
"nothing to claim"; a plan claimed beside it is still named.
- claimOne is unchanged; README says the two lists and that a plan just
claimed may show in neither billing list until its effective_at.
Run on mote (macOS, Bun 1.4.2, temp HOME), on
|
||
|
|
7673cd06de |
zcode 0.1.37: an account with no gift plan to claim is no check-in event, not a failed check-in
hykql (Discord, magpie v0.1.2143, zcode 0.1.36) saw every ZCode account's
daily check-in fail with "gift plans to claim: no plan list in the reply",
a Start Plan account and one with no GLM Coding Plan alike. ZCode's
GET /billing/preview answers an account with nothing to claim with no
data at all, not data.plans []:
{"code":0,"msg":"","logid":"202610300535585c4e3de75769b684da87"}
(the owner's account, read 10-30 with GETs only, with and without the
X-ZCode-App-Version / X-Platform headers; both the same). #503's capture
of 10-29 had "plans": [], so 0.1.35 took a missing list as unreadable.
previewPlans now reads the list for both the claim and the card's claim
line: no data, data null, or data without plans (or plans null) is a
list of none, so the check-in is "inactive" (magpie shows "No check-in
event now"). call has already judged the code, so only a code 0 reply
gets here. Data that isn't an object, or plans that aren't a list, still
don't read and stay failed, never claimed.
Run (wsl-run on magpie-desktop, HOME=$(mktemp -d); mote was at load
220-250): `bun test` in packages/zcode, 152 pass 0 fail; the whole
repo's `bun test`, 3720 pass 0 fail of 3727 across 298 files;
`bun scripts/check.mjs zcode` ok. The new checkin test (the real
no-data reply, data null, data without plans, plans null) is red on
0.1.36's index.mjs (1 fail). Broken by hand: plans that aren't a list
read as none turns "a preview that doesn't read is failed" red; put
back, green.
Not tried: a real claim (no account has a plan to claim now), and the
official ZCode client's own parse of this reply (no ZCode app on hand);
the fixture is the vendor's real bytes. Not changed: #505 (freeFirst)
touches other parts of index.mjs.
|
||
|
|
8ebbaa5880 |
zcode 0.1.35: claims each account's ZCode gift plans daily through magpie's check-in (#503)
ZCode hands out gift/resource plans that sit on an account until claimed,
and an account used only through magpie let them lapse. The plugin now has
auth.checkin, so magpie's daily check-in (`magpie accounts checkin`, and
Settings -> Daily check-in, where ZCode is off until the user turns it on)
claims them, the shape the MiniMax, Qoder and Loomy plugins use.
claimDaily reads GET /api/v1/zcode-plan/billing/preview (the list the card
already read) and POSTs {"plan_id"} to /billing/claim for each plan it
lists, with the account's ZCode jwt, X-Device-Mid, X-ZCode-App-Version and
X-Platform, as kongbai01203 captured them. The claim is judged by the body's
code: 0 claimed, 1003 "target already exists" (HTTP 200) done, 3007 or a
captcha message "captcha" (claim it in the ZCode app), anything else, an
HTTP error without a code or a body that isn't JSON failed. A failed read is
never taken as claimed, and no answer carries signIn, so a failed claim
leaves the account as it was. Nothing listed is inactive; a key-only
account is ineligible; an expired ZCode session is failed with no request.
A plan claimed now drops the account's cached route, so the next request
uses it. One failed among several makes the whole answer failed (with the
claimed ones named), so magpie asks again later and the claimed ones then
answer 1003.
Run (on mote, HOME=$(mktemp -d)): `bun test` in packages/zcode, 150 pass;
the whole repo's `bun test`, 3698 pass 0 fail of 3706 across 297 files;
`bun scripts/check.mjs zcode` ok. checkin.test.mjs covers preview empty,
one plan claimed with code 0 (request body and headers checked), 1003,
3007, seven unreadable claim answers, five unreadable previews, one
claimed + one failed then asked again, and key/expired accounts asking
nothing. Broken by hand: 1003 -> claimed and an unreadable reply ->
claimed turned three of these tests red; put back, green.
Not tried: a real claim that answers code 0. No account has a plan to
claim right now (every preview answers plans: []), so the code 0 body is
a fixture carrying only its code, and nothing else of it is read. On
10-06 a claim without the ZCode app's Aliyun captcha was answered 400
code 3007 (#30); if ZCode still asks that for a fresh plan, the check-in
says "captcha" and the plan is claimed in the app, as before. The real
1003 reply is in the tests as captured.
|