Commit Graph
4 Commits
Author SHA1 Message Date
yetone 6a75bbd43c zcode 0.1.47: a gift model goes out under ZCode's registry spelling, and a rested model says why
A -Trial request took the model name from the bucket's capabilities,
lowercased ("glm-5.3-flash"), and sent that. ZCode 3.17.2 sends its registry
id ("GLM-5.3-Flash"): normalizeOfficialGlmModelId's spelling, which its own
docs say is not rewritten on requests. The plugin now sends the registry
spelling for the models ZCode knows (wireModel), for trial entries and the
free-first plain model alike; unknown names go as the bucket wrote them.

A 429 from the gift also rests that model for a minute, and the local
refusal in that minute read the same as a spent bucket. It now says ZCode
answered 429 to the last request and the model is not asked again for a
minute.

Not changed: X-Device-Mid. 3.17.2's docs say it goes on config GETs, not on
the model transport, and start.test.mjs holds that.

Run at this head: bun test packages/zcode on mote, 193 pass. Undoing
wireModel turns 7 tests red. Not tried: a real account (none here); the
cause of the reports (429 and 405 on glm-5.3-flash-trial, 11-03) is not
proven, the model spelling is the one request difference found in the
3.17.2 source.
2026-11-04 00:35:49 +08:00
Jinpy 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.
2026-11-03 21:29:46 +08:00
yetone b820704803 zcode 0.1.42: a plain GLM model spends a live ZCode gift first, by default (sgfvdsg86265 on X)
The request (X, 2117210897471169009): when the account has gift quota
for a GLM model, which ZCode hands out every weekend, spend that first.
freeFirst (#505) already does it, but only when it was turned on, so a
gift lapsed unused behind an agent that asks for the plain model. It is
now on unless the plugin's options or the provider's say
`"freeFirst": false`, which are still honoured as they are. Every way
the gift can fail (spent, a model it doesn't serve, no ZCode session, a
refusal's minute of rest) still falls back to the coding plan, as
before. A team seat's plain model spends the personal gift first too.

The tests that are about the plan and the -Trial picks now build the
plugin with freeFirst off, as they assumed it was.

Run on mote: HOME=$(mktemp -d) bun test in packages/zcode, 187 pass;
bun scripts/check.mjs zcode ok.
Broken by hand: with the default back to off, "free first is on when
nothing sets it" and "free first is on by default for a team seat"
fail; the rest pass.
Not tried: a real account with a claimed gift. The owner's account has
only an unclaimed one, which wasn't claimed for this.
2026-11-02 19:13:09 +08:00
location-txl 935ddb5b45 zcode: a team seat lists the person's gift plans and their -Trial models (#359, #371)
A team seat's ZCode session also reads the person's own gift plans (#359): plansOf no longer returns {start:false, gift:null} for every team seat. A team seat stays on its team plan (its personal plan list is not read), its <model>-Trial entries are listed, its card shows the gift buckets beside the team's windows, and a team seat with no or an expired ZCode session gets the "ZCode gift plans (-Trial models) need ZCode's sign-in" line. Plain models spend the team key; -Trial models go to zcode.z.ai with the ZCode session and no team key or organization header.

Reviewed at 4778e0d (on main ba9801c, merges clean). Run in a worktree, Bun 1.4.2, sandbox HOME and TMPDIR: `bun test packages/zcode` 107 pass, 0 fail. With main's index.mjs put back, 6 fail (the 4 new team-gift tests and the two changed team-seat tests), so the tests guard the change. `bun scripts/check.mjs zcode` ok. Loaded through magpie's plugin host (magpie origin/main 4dfd88206, scripts/try.sh in a sandbox HOME): zcode listed with 4 models.

Not tried: a real team-seat account here; the author reports a BigModel team seat listing the trials and a Flash Trial request answering 200. The version bump (0.1.28) follows in its own commit.
2026-10-25 14:22:19 +08:00