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).
This commit is contained in:
@@ -203,8 +203,8 @@ test("a Start Plan request carries ZCode's headers, and only those", async () =>
|
||||
"anthropic-version": "2023-06-01",
|
||||
"content-type": "application/json",
|
||||
"http-referer": "https://zcode.z.ai",
|
||||
"user-agent": "ZCode/3.16.3 ai-sdk/anthropic/3.0.81",
|
||||
"x-zcode-app-version": "3.16.3",
|
||||
"user-agent": "ZCode/3.17.2 ai-sdk/anthropic/3.0.81",
|
||||
"x-zcode-app-version": "3.17.2",
|
||||
"x-title": "Z Code@cli",
|
||||
"x-release-channel": "production",
|
||||
"x-client-language": o.locale,
|
||||
|
||||
Reference in New Issue
Block a user