ZCode 3.15 keeps no coding plan key in credentials.json any more. The key
it uses is in config.json, at provider["builtin:bigmodel-coding-plan" /
"builtin:zai-coding-plan"].options.apiKey (ZCode 3.15.3's host reads that
value as it is). zcodeOwn found no key, so a signed-in BigModel GLM Coding
Pro account went on to the Start Plan and read as "this account has no GLM
Coding Plan, and ZCode's Start Plan has ended or was never started".
zcodeOwn now falls back to config.json when credentials.json has no key:
Z.ai's first, as before, then BigModel. It also accepts the provider ids
ZCode 3.15 normalizes to (account:*-individual-coding-plan) and a value
written encrypted. A value that isn't a key, such as "{env:...}", is
skipped. A key in credentials.json still comes first, and so does a team
switch.
What was run:
- TestZCodePlanKeyFromConfig uses the reporter's layout: credentials.json
with BigModel sign-in data and no key, and config.json with the key under
builtin:bigmodel-coding-plan. The account reads as GLM Coding Pro with
two windows and never asks the Start Plan. Without the zcode.go change
it fails, with the key empty.
- gofmt -l; go vet for darwin, linux (nogui) and windows.
- go test ./internal/provider/ passes.
Not tried: a real ZCode 3.15 account. The fix rests on the reporter's
account of their config.json, which they verified against the plan
endpoints with the key, and on ZCode 3.15.3's extracted host code.
Moved users get the same fix through the plugin, in a separate commit.
The list is asked with the plan's key, bare in Authorization, at the host its
term (subscription/list) is asked at, so open.bigmodel.cn and api.z.ai alike;
a ZCode account on the built-in gets the same. The tooltip says "The plan's
resets" for a person's own, "The team plan's" for a team's (ResetCredits.Team).
Tested: the reporter's literal reply (ids and times filled in, same shape)
in TestZhipuPersonalResets, TestPlanQuotas and TestZCodeAccounts, each
failing with the change reverted; reset-each-title in Chromium and WebKit,
en/zh/ja/de; a real Z.ai key through zhipuPersonalResets (1 five-hour,
1 weekly). Not tried: a real bigmodel.cn key.