Commit Graph
59 Commits
Author SHA1 Message Date
yetone 08a852a369 provider: a model off for an agent stays off while the vendor's list lacks it; zcode min 0.1.59 (WJaunita45604 on X)
ZCode's GLM-5.3-Flash-Trial is listed only from about 23:00. SetHiddenModels
rebuilt the agent's off list from the models listed right now, so an off
choice for an absent model was dropped on the next Save, and the model came
back on at 23:00. It now keeps hidden ids that ListedFor no longer lists.
(Provider picks and per-agent PickedModels already survive a relist; a
3-day flip test with an editor Save in between guards that.)

The display half is in the plugin, zcode 0.1.59 (npm checked): a reply the
gift answered names the -Trial entry, so Usage, sessions and the request log
show the model served. The mover min is raised to 0.1.59.

Run: go test ./internal/provider (wsl, ok); gateway zcode/trial tests ok;
gofmt clean; go vet linux, windows, darwin ok. Plugin: bun test in
packages/zcode 243 pass.
Broken by hand: SetHiddenModels reverted -> TestHiddenModelAbsentStaysHidden
red ("an unlisted model's off choice lost"); plugin trialNamed removed -> the
2 new gift tests red.
Not tried: a real Start Plan reply or live account; mote was out of disk, so
tests ran on wsl. GUI not touched.
2026-11-11 14:13:01 +08:00
yetone 5068e46fb6 provider: raise ZCode's plugin min to 0.1.58; a coding plan's 1310 leaves the trials (plugins#438)
takomitkm (plugins#438) hit two problems. The busy hold armed with one
account and one agent. A GLM Coding Plan model's weekly or monthly limit
(1310) also rested the whole account, so its -Trial models got the
cached 1310 without being asked. zcode 0.1.58 (ea3573bf in the plugins
repo, on npm) fixes the first in the plugin and lists the -Trial entries
free. magpie's PaidBesideFree then rests only the refused coding-plan
model. Raising the min brings every moved user up to 0.1.58.

TestZCodeCodingPlanLimitLeavesTrials holds both sides. With the trials
free, the 1310 rests GLM-5.3 alone and GLM-5.3-Trial is still sent. With
no free entries, or with another vendor, the same refusal still rests
the account. The fake plugin's $FAKE_ZCODE_FREE marks the trials free,
as 0.1.58 does.

Run (mote): go test ./internal/gateway -run 'TestZCode' -count=1, ok;
go test ./internal/provider ./internal/plugin -count=1, ok; go vet of
the three packages on mote, in WSL (magpie-desktop) and on Windows
(xiaomi-gpu), ok; gofmt -l is clean. All of this at this head, rebased
on origin/main. A whole-tree Linux vet in WSL stops at Wails' cgo
(webkitgtk-6.0 and gtk4 aren't installed there), so it doesn't cover
the GUI.

Broken by hand: with the fake's free mark dropped, the zcode 0.1.58
subtest fails, because the 1310 rests the account key.

Not tried: a real dual ZCode account that has reached its weekly limit.

Reported-by: takomitkm
2026-11-11 04:42:15 +08:00
yetone 15918265e3 zcode mover: min 0.1.57, the busy hold's answer arms no quota rest
plugins#859 (zxy20250120) merged as 93dacd738: an in-flight Start Plan
request answered by the busy hold's own 429 was counted as a spent gift,
so a -Trial model (or free first) rested in `blocked` for a minute with
quota left. 0.1.57 marks that answer and both gift paths skip it.

npm view --prefer-online --registry https://registry.npmjs.org
@magpie-community/opencode-zcode-auth version: 0.1.57 at landing.

Run on mote: go test -run 'Mover|Moved|Migrat|ZCode|Zcode'
./internal/provider ok; gofmt -l clean. Full suite: not run at push.
The plugin change itself was run in the PR review (bun test packages/zcode
236/0, red on main's index.mjs).
2026-11-08 15:37:01 +08:00
yetone 5dbdfc1bd5 provider: zcode's mover min is 0.1.56, the Start Plan three at a time
ZCode users of other agent apps saw "rate limited 5 times in a minute":
the plugin's busy hold, tripped by refusals the plugin drove itself (up
to six re-asks over ~10s, nothing holding the Start Plan to its in-flight
cap). zcode 0.1.56 (plugins a313a003) re-asks a cap twice, after 1s and
2s, as ZCode 3.17.2 does, keeps an account's Start Plan requests to three
in flight with the rest waiting in the plugin, and counts toward the hold
only a request refused again at its re-ask. keepMovedCurrent brings every
moved user up to it.

Run: npm view --prefer-online --registry https://registry.npmjs.org
@magpie-community/opencode-zcode-auth version = 0.1.56; gofmt -l clean;
go test -count=1 ./internal/provider on mote: ok (171.6s). The plugin's
own runs are in its commit body.
Not tried: a real moved ZCode account updating to 0.1.56 in magpie.

Reported-by: star21321321124
2026-11-07 18:07:13 +08:00
yetone 682d72075a provider: zcode's mover min is 0.1.55, no claim while ZCode asks its security check
young02036 (Discord, 11-07): the daily check-in got ZCode's captcha every
day, and the free GLM-5.3-Flash-Trial answered 405 code 3012 while the
account's Coding Plan models worked. plugins ea9904d5 (zcode 0.1.55,
npm latest per npm view --prefer-online) posts no claim while ZCode's
client config asks its security check for claims, and sends the desktop
app's X-Title (Z Code@electron) and a per-turn x-query-id, as ZCode
3.17.2 does. The min also brings in 0.1.54's busy hold for requests in
flight (plugins#801).

Run (mote): go test -timeout 30m ./internal/provider/ ok (142.5s).
Not tried: a real move or claim with the new min; the reporter's
3012-blocked account (the probe on the owner's account passed every
request shape, so the 3012 looks like the account's risk-control block).

Reported-by: young02036
2026-11-07 15:05:22 +08:00
yetone ca77a9ea85 provider: the ZCode mover needs zcode 0.1.53 (plugins#817)
zcode 0.1.53 turns a spent bucket's HTTP 200 ("exceed quota limit"
1005, 1113) into a 429 on the plain path too, so a gift-only account
whose GLM-5.3 day is spent rests that model and still serves
GLM-5.3-Flash (with fd0cac250 on the gateway side). keepMovedCurrent
brings every moved user up to it.

npm view @magpie-community/opencode-zcode-auth@0.1.53 version
--prefer-online --registry https://registry.npmjs.org: 0.1.53, the
latest, at the time of this change (publish run 42322705464: zcode
published; the run is red for think-tags only, plugins#180).

Run: go test -count=1 ./internal/provider/ on mote: ok (117.7s), at
fd0cac250 plus this change.
Broken by hand: nothing; only the min string and its note change.
Not tried: a moved user's real update to 0.1.53.

Reported-by: zane668
2026-11-07 09:22:36 +08:00
yetone 400b66ec34 provider: ZCode's plugin is brought up to 0.1.52, whose rate-limit hold is per account
plugins#793 (kongbai01203) is merged and npm has 0.1.52
(npm view --prefer-online: 0.1.52). In 0.1.52, a claim or balance read
that ZCode rate-limits holds back only the account it limited, until
ZCode's wait is over. Keyless sign-ins no longer share one hold.
keepMovedCurrent then updates every moved user's plugin.

Run at this tree, on mote: go test -count=1 ./internal/provider/: ok (177s).
Only the min string and its note changed.
2026-11-07 01:24:48 +08:00
yetone 3587bf70e2 providers: a plugin account's Select all available ticks its own list; zcode min 0.1.51 (young02036)
young02036 on Discord: their two ZCode accounts in magpie, one with no
GLM Coding Plan whose Start Plan holds glm-5.3-flash and one subscribed
whose gift shows as glm-5.3-flash-trial, failed while the ZCode app
worked; picking each account's usable models by hand worked. They also
said ticking the available models by default didn't work.

- zcode mover min 0.1.51: the plugin now lists for a gift-only account
  only the models its Start Plan balance names, as ZCode 3.17.2 offers
  it, not every model of the Start Plan config, so routing stops sending
  GLM-5.2 or GLM-5-Turbo to an account that holds only GLM-5.3-Flash
  (plugins c96d04bb, npm 0.1.51 checked with --prefer-online).
- Select all available in an account's model picker ticked every model
  shown for a signed-in account. provider/keylisted now answers for a
  plugin's account with the models its plugin lists for that account
  (plugin.Account.Models, by the provider's listed ids), and the picker
  asks it for accounts as for keys. An account the plugin keeps no list
  for (one account has them all) or doesn't have is unknown, which still
  ticks every model shown; a non-plugin account is unchanged in effect.
  The account title says so, translated in zh, zh-TW, ja and de.

Run on mote:
- go test ./internal/provider -run 'TestKeyListed|TestPluginAccountModels':
  TestKeyListedIsAPluginAccountsOwnList red on the old code (the key
  account's list: [], want [fake-1]), green after.
- node --test account-models-available.test.cjs (chromium + webkit,
  en zh zh-TW ja de, 900 and 420px): with the old app.js the new plugin
  account case and the Codex case (now asks keylisted) are red; green
  after. i18n-keys green.
- go test ./internal/gui -run Budget, go test ./internal/provider (whole
  package), GOOS=windows go vet of both packages, GOOS=linux go vet of
  internal/provider (internal/gui's wails needs cgo for a Linux vet from
  mac), gofmt.
Not tried: a real ZCode account (none available); whether the 3012s
young02036 saw came from these requests is not proven; the whole GUI
suite (only this picker's file and i18n-keys).
2026-11-05 11:46:26 +08:00
yetone e3ed21c7a2 provider: the ZCode mover's min is 0.1.50 (plugins#729)
zcode 0.1.50 reads a daily claim answered with code 1004 as the account
not being eligible for that plan now, and asks again in half an hour,
instead of reporting a failed claim (kongbai01203). Raising the min lets
keepMovedCurrent bring every moved user's plugin up to it.

npm view @magpie-community/opencode-zcode-auth version --prefer-online
(registry.npmjs.org) answered 0.1.50 before the change and again at
landing.

Run on mote (mote-run) at this tree, rebased on 0a6cccc3f (provider
 tests and vet run again after the rebase, ok in 198s):
- go test -timeout 45m ./internal/provider/: ok (133s)
- go test -run 'ZCode|Zcode|Moved|Mover' ./internal/gateway/: ok
- go vet ./internal/provider/ with GOOS=linux, GOOS=windows and darwin: ok
- gofmt -l internal/provider: clean

Not broken by hand: the change is the version string and its note; no
test pins the zcode min. Not tried: a real moved account updating to
0.1.50, and the full suite (runs after the tag).
2026-11-04 23:38:01 +08:00
yetone e2d52b5012 provider: ZCode's mover min is 0.1.49, whose -Trial entry is no longer answered "quota exhausted" after a free-first refusal (Can4ry_ on X)
Can4ry_ on X: GLM-5.3-Flash-Trial answered "429 · ZCode's limited quota
for glm-5.3-flash is exhausted or temporarily unavailable" in magpie while
ZCode's own app was served. The plain GLM-5.3-Flash also kept going to
the Coding Plan after the Start Plan opened at 23:00. And there was no
freeFirst under Providers › ZCode.

zcode 0.1.49 (plugins 36a017a):
- A free-first gift refusal that isn't a quota answer (405/3012) now
  rests only free first's use of the model. Before, it shared the rest a
  -Trial entry obeys, so the Trial answered a local 429 without asking
  ZCode.
- The local 429 keeps the spent words last. 0.1.48 appended "(ZCode
  answered 429 …)" after them, so zcodeSpentWords didn't match and the
  account rested whole.
- free first is a switch, "Free quota first", in the provider's editor
  under Plugin options, just above Advanced (auth.options free_first,
  on by default).
keepMovedCurrent updates every moved user to 0.1.49.

The gateway test gets 0.1.49's rested wording, which rests the Trial
entry alone, and 0.1.48's, which rested the account.

Correction to plugins 36a017a's body: its old-code block-page test
fails because the old code has no `sidelined` map. Its second plain
request did not go to the gift again.

Run on mote, at this tree (rebased on origin/main 7aff42d86, run again there):
- go vet ./internal/provider ./internal/gateway
- go test ./internal/provider -run 'Mov|Migrat|Mover|ZCode|Zcode|Plugin',
  ok
- go test ./internal/gateway -run 'ZCode|Zcode', ok, both new subtests
  pass
- gofmt -l clean
- npm view --prefer-online @magpie-community/opencode-zcode-auth version
  says 0.1.49

Broken by hand: in the plugin (see 36a017a), the new tests against the
old index.mjs, 4 fail, the reported case among them (429 for 200).

Not tried:
- the full suite. mote is running other sessions' suites, and this
  change is one string in the mover plus test cases.
- a real move to 0.1.49.
- a real Start Plan refusal: the owner's account has no live gift.
- the editor's switch in a running app. It comes from host.js optionsOf
  and app.js pluginOptionsField, unchanged.
2026-11-04 02:07:15 +08:00
yetone b92b3bc5b1 provider: raise the ZCode mover min to 0.1.48
0.1.48 (npm, checked with npm view --prefer-online) puts ZCode 3.17.2's
prompt texts in the Start Plan request (jinpy666's plugins#682). 0.1.46
said 3.17.2 in the headers with 3.14.3's system blocks in the body, which
zcode.z.ai has answered with 405/3012 since 11-03 while the ZCode app
works on the same accounts (plugins#348, Discord reports).

Run: go test -timeout 45m ./internal/provider on mote, gofmt -l clean.
Not tried: a real ZCode account; the plugin side rests on #682's live run.
2026-11-04 01:21:48 +08:00
yetone 7785c42787 provider: raise the ZCode mover min to 0.1.47
0.1.47 (npm, checked with npm view --prefer-online) sends a free gift
model such as GLM-5.3-Flash-Trial to ZCode spelled as the registry does
("GLM-5.3-Flash"), as the 3.17.2 app sends it, not the lowercase bucket
name, and the plugin's own 429 says when ZCode answered 429 to the last
request for the model (rested a minute). Reported on Discord as the
free Flash model failing in magpie while working in the ZCode app.

Run: go test -timeout 45m ./internal/provider on mote: ok. go vet for
linux and windows: no errors. gofmt -l: clean. The plugin side ran
bun test packages/zcode on mote.
Not tried: a real ZCode account; the cause is not proven. A 405/3012 is
ZCode's account risk control (plugins#348) and this does not lift it.
2026-11-04 00:47:54 +08:00
yetone 94d0fbfcd3 provider: the ZCode mover installs opencode-zcode-auth 0.1.46 (plugins#676, #678)
ZCode 3.17.2's marketing feed answers empty to the 3.16.3 the plugin
signed in as, so from 11-03 the daily claim found nothing (plugins#676,
jinpy666; rick_49551 on Discord). 0.1.45 (#678, jinpy666) reads the feed
under 3.17.2's version header and drops billing/preview, which the 3.17
client no longer polls. 0.1.46 sends every call as 3.17.2, since the
client says the Start Plan balance judges capability by the real
app_version, and takes a sign-in whose only Start Plan starts later, as
the client's resolveStartPlanBalanceAvailability does, instead of
refusing it as "ended or never started" (sliyrainbow on Discord, whose
account works in the official client). Checked against
zai-org/ZCode@a9fe401. Raising min moves every moved user onto 0.1.46
through keepMovedCurrent.

npm has 0.1.46 as latest (published 2026-11-03T13:41:44Z, plugins
8fc12a3).

Run on mote at this change (on f168dd278; the rebase onto 93b1b4904
only touches a GUI test): go test -timeout 45m ./internal/provider ok
(121s); GOOS=windows and GOOS=linux go vet ./internal/provider ok;
gofmt -l clean. Plugin side: bun test packages/zcode 191 pass; with
the old app version, without the later-start Start Plan, or with the
old locale put back by hand, 7, 2 and 1 tests went red.

Broken by hand here: nothing; this is a version string, and no test
pins the zcode min.

Not tried: no real ZCode account was available, so neither the claim
nor the sign-in was run live by us; the feed's version gate rests on
jinpy666's live run in #678. Packages that import internal/provider
were not run.
2026-11-03 21:43:09 +08:00
yetone 8f128877ae provider: the ZCode mover installs opencode-zcode-auth 0.1.43 (plugins#649, frank6com)
0.1.43: when zcode.z.ai's edge firewall (Aliyun) answers a Start Plan
request (POST /api/v1/zcode-plan/anthropic/v1/messages) with its 405
block page, every account of the plugin holds off zcode.z.ai for three
minutes. The Start Plan and -Trial requests are answered locally with
the same 405 and provider.BlockedHint, so EdgeBlocked and retryable still
fall back. Free first stays on the coding plan. frank6com's two Start
Plan accounts and three sessions with subagents went on knocking from
both accounts after the block, and ZCode's own app got the same 405, so
the address was blocked, not the account. npm --prefer-online had 0.1.43
when this landed.

Run on mote: go test ./internal/provider ok, gofmt -l clean, GOOS=linux
and GOOS=windows go vet ./internal/provider clean. That run was on
2ab923571 with this line and the WorkBuddy and Qoder mins; nothing in
internal/provider changed between it and this commit's base. The
plugin's own run record is in plugins 036fb6e.

Not tried: a real block. Reproducing it means getting the owner's
address blocked.
2026-11-03 02:41:46 +08:00
yetone c51bc9063b provider: ZCode's mover min is 0.1.42, which spends a live gift first (sgfvdsg86265 on X)
zcode 0.1.42 (plugins b820704) makes freeFirst the default: a plain GLM
model spends the account's live ZCode gift first and falls back to the
coding plan. "freeFirst": false in the plugin's or the provider's
options keeps the plan first, as before. Raising the min updates every
moved user's plugin (keepMovedCurrent).

npm view @magpie-community/opencode-zcode-auth version --prefer-online:
0.1.42 when this landed.
Run on mote: go test ./internal/provider -run 'Mover|Moved|Min|ZCode'
ok; gofmt -l clean.
Not tried: a real account with a claimed gift.
2026-11-02 19:21:50 +08:00
yetone 2739626c38 provider: the ZCode mover's min is 0.1.41, nothing to claim is asked again in half an hour (plugins#600)
zcode 0.1.41 (magpie-community/plugins#600) gives a daily claim that
found no gift plan an `until` half an hour out, so magpie asks again
through the day and a plan ZCode drops into its feed later (the weekend
plan from 19:00 Beijing) is still claimed. keepMovedCurrent now updates
every moved user's plugin to it.

npm view @magpie-community/opencode-zcode-auth version --prefer-online
--registry https://registry.npmjs.org: 0.1.41, checked when this landed.

Run on mote (mote-run) at base ff65ebd14 with this change: gofmt -l
internal/provider (clean); go vet ./... for darwin, GOOS=windows, and
GOOS=linux -tags nogui (all ok); go test ./internal/provider/ -timeout
45m (ok, 103.8s).

Not tried: a real ZCode account's move. No real account was moved.
2026-11-02 00:05:39 +08:00
yetone 27a0cbd178 zcode: the mover's min is 0.1.40, the plugin that holds two accounts at once
01huadalang on Discord (#feedback): three ZCode accounts used at once
from one address had the address refused with a 405. zcode 0.1.40
(magpie-community/plugins 26864ec) declares maxAccounts 2, which the
previous commit's Accounts at once reads; keepMovedCurrent now updates
every moved user's plugin to it.

npm view @magpie-community/opencode-zcode-auth --prefer-online: version
0.1.40, magpie { maxAccounts: 2, maxConcurrency: 3 }, checked when this
landed. Run: internal/provider at this head with the commit before
(see its body). Not tried: a real ZCode account's move (none used, per
the task).
2026-11-01 07:39:08 +08:00
yetone 59109044c6 provider: the ZCode mover's min is 0.1.39, gift plans are also claimed from the ZCode app's banner feed (plugins#503)
Plugin 0.1.39 (magpie-community/plugins 2e580cf) reads the ZCode app's
claim banners from GET /api/v1/marketing/touch as well as
billing/preview. A banner plan (ZCODE WEEKEND BUILD, 10-30) is in
neither billing list while the app shows it, so the daily check-in said
there was nothing to claim (kongbai01203's capture on plugins#503). The
claim itself is the same POST /billing/claim; a list that doesn't read
is a failed check-in, asked again later. keepMovedCurrent brings every
moved ZCode user to it.

Run on mote, worktree at origin/main ec5571d6f + this change:
gofmt -l clean; `go vet`, GOOS=linux and GOOS=windows `go vet` of
./internal/provider/ ok; `go test -timeout 45m ./...`: every package ok
except internal/gui, whose ten real-window AppKit tests (TestPanelCloseHidesIt,
TestDockJoinLeadsCommandTab, TestMainWindowCorners, ...) were killed at
their 20-80s deadlines on mote, filed as #4125 and #2645; this change
touches only a string in internal/provider. Rebased onto 5bb252c8f
before the push; `go test ./internal/provider/` at the pushed tree: one
red, TestQuotaSpanCarriesEveryWindowField ("trayKind" isn't on
QuotaSpan), from 7d4a63148 on main, filed as #4457. `npm view
@magpie-community/opencode-zcode-auth version --prefer-online
--registry=https://registry.npmjs.org/` says 0.1.39. The plugin's own
record (zcode 178 pass, 3 red on the old code, dedupe and unread-list
returns broken by hand) is in 2e580cf.

Not tried: a real banner claim through the plugin; its feed fixture is
built from the capture's description of the fields.
2026-10-30 23:25:48 +08:00
yetone c28cc5c87a provider: the ZCode mover's min is 0.1.38, freeFirst spends a dual account's gift first (plugins#505)
Plugin 0.1.38 (magpie-community/plugins 5a9c776, jinpy666's #505) adds
freeFirst, an option off by default (Plugins › Options, or
provider.zcode.options): a plain model request on an account with a GLM
Coding Plan and a live gift spends the gift first, under the name the
gift lists, and any gift failure (spent, block page, 4xx/5xx, its busy
cap waited out, a network throw) is replayed on the coding plan in the
same request; a caller's abort stays an abort. keepMovedCurrent brings
every moved ZCode user to it.

Run (on mote, worktree at origin/main + this change): `go test -timeout
45m ./internal/provider/` ok; `go vet`, GOOS=linux and GOOS=windows `go
vet` of ./internal/provider/ ok; gofmt -l clean. `npm view
@magpie-community/opencode-zcode-auth version --prefer-online
--registry=https://registry.npmjs.org/` says 0.1.38. The plugin's own
review (zcode tests 173 pass, check.mjs ok, abort guard broken by hand
red) is in #505.

Not tried: freeFirst against a real dual account; the plugin's tests run
against a fetch fake.
2026-10-30 14:36:55 +08:00
yetone b26fa09037 provider: the ZCode mover's min is 0.1.37, an account with no gift plan to claim isn't a failed check-in (hykql on Discord)
hykql (v0.1.2143) saw every ZCode account's daily check-in say "签到失败,
magpie 稍后重试 · gift plans to claim: no plan list in the reply". ZCode's
billing/preview answers an account with nothing to claim with
{"code":0,"msg":"","logid":…}, no data at all, which 0.1.35/0.1.36 took
as unreadable. Plugin 0.1.37 (magpie-community/plugins 7673cd0) reads it
as a list of none, so the check-in is "inactive" (the Usage page says
"No check-in event now"). keepMovedCurrent brings every moved ZCode user
to it.

Run (on mote, worktree at origin/main + this change): `go test -timeout
45m ./internal/provider/` ok; `go vet`, GOOS=linux and GOOS=windows `go
vet` of ./internal/provider/ ok; gofmt -l clean. `npm view
@magpie-community/opencode-zcode-auth version --prefer-online
--registry=https://registry.npmjs.org/` says 0.1.37.

Not tried: a real claim of a plan (no account has one to claim now).
2026-10-30 13:59:18 +08:00
yetone 9e8c22dad8 provider: the ZCode mover's min is 0.1.36, gift buckets named by model first (plugins#504)
Danbuth's GLM Coding Max account held ZCode's Start Plan (ZCODE GLOBAL
BUILD) and read the card as having none: the plugin showed it as the
third ring, "ZCODE GLOBAL BUILD · GLM-5.3-Trial", which the ring cut to
"ZCODE GLOBAL BUI…". Plugin 0.1.36 (magpie-community/plugins 63748b9)
names a gift bucket by its model first, as ZCode's own "Today's balance"
lists it, then its plan. keepMovedCurrent brings every moved ZCode user
to it.

Run (on mote, worktree at origin/main + this change): `go test -timeout
45m ./internal/provider/` ok; `go vet`, GOOS=linux and GOOS=windows `go
vet` of ./internal/provider/ ok; gofmt -l clean. npm view --prefer-online
says 0.1.36.

Not changed: the tray panel shows at most three rings and the account
row two windows, so beside a Coding Plan's 5h and weekly only one gift
bucket is on the panel; the others are in its tooltip and on Usage.
2026-10-30 10:36:28 +08:00
yetone 484bdca7c7 provider: ZCode's mover min is 0.1.35, whose daily check-in claims the account's gift plans (plugins#503)
zcode 0.1.35 (on npm, checked with `npm view --prefer-online`) adds
auth.checkin: magpie's daily check-in reads ZCode's billing/preview and
claims each listed plan, judged by the reply's code (0 claimed, 1003
claimed before, 3007 captcha: claimed in the ZCode app; anything
unreadable failed, never claimed). It runs only once the user turns
ZCode on in Settings -> Daily check-in: PluginCheckinOn has no inherited
default for zcode, so it is off for everyone until then.
keepMovedCurrent brings every moved user's plugin to it.

Run: `go test ./internal/provider/` on mote, ok (90.98s), at this tree
(origin/main cdf8151a2 plus this one line).
Not tried: a real claim answering code 0; no account has a plan to
claim now (plugins 8ebbaa5's body has the rest).
2026-10-30 08:29:43 +08:00
yetone d9431dd2ec provider: ZCode's mover min is 0.1.34, whose card names a gift plan that starts later
windy (Discord): with a GLM Coding Plan, ZCode's card didn't tell the
Coding Plan's allowance from the Start Plan's, and a Start Plan taking
effect at 23:00 today wasn't shown. Fixed in the plugin
(@magpie-community/opencode-zcode-auth 0.1.34, plugins 3b3209e): a plan
whose starts_at is still to come is named in an aside line "ZCode gift
plan not started yet" with its start, and gets no requests before it;
beside a Coding Plan every gift bucket is prefixed with its plan's name.

- migrate_zcode.go: min 0.1.34, so keepMovedCurrent updates moved users.
  npm view --prefer-online served 0.1.34 before this commit.
- i18n.js: the new line's name in zh, zh-TW, ja and de.
- quota-name-translated.test.cjs: the not-started line is checked like
  the claim line, every language at 440/560/1000px in both engines.

Run on mote at this tree: gofmt -l clean; go vet ./internal/provider/
for darwin, linux (-tags nogui) and windows ok; go test -timeout 45m
./internal/provider/ ok; node --test quota-name-translated, i18n-keys,
quota-name-wrap and gui-ja, 29 pass 0 fail (chromium and webkit).

Not tried: a real account with a plan not started yet; which status
ZCode gives such a plan is unknown, the plugin goes by starts_at.
2026-10-29 22:38:16 +08:00
yetone 729d5d0c4c provider: zcode's mover min is 0.1.33, for a ZCode 3.16 sign-in's coding plan models (plugins#439)
dinghao-8 (plugins#439): a ZCode 3.16 sign-in that keeps only a
project-key-location record listed the Start Plan's models, without
GLM-5.3, since the plugin's models() read the sign-in without fetching
its key. 0.1.33 (plugins 2ef8b8b) reads the key first; npm shows 0.1.33
(npm view --prefer-online).

Run: `go test -count=1 -timeout 45m ./internal/provider/` at this tree with
both min raises applied, skipping four reds that are red on origin/main
e54a7d50b without them (run there by name): TestUnreadLoginsWriteErrors
KeepCredentials crashes the package (#3632), and TestFetchAsksOneList
OnceForTwoBasesOfIt, TestFetchUnionsProtocolListsWithoutChat and
TestFetchAsksASharedBaseOnce (#3854); the rest ok (157s). gofmt -l
clean; go vet, GOOS=windows and GOOS=linux go vet of internal/provider
clean.
Broken by hand: nothing; a min is a version string no test pins.
Not tried: a real ZCode 3.16 account (its key is in the Keychain).
2026-10-28 00:15:40 +08:00
yetone 39238183da provider: ZCode's mover min is 0.1.32 (plugins#395)
zcode 0.1.32 (plugins 8b21033, ANDY-JK) asks a 429 that is the plan's
in-flight cap (3008/3009) again, the same bytes, for about ten seconds,
no longer counts it as a spent gift, and declares maxConcurrency 3 as a
default magpie's per-account queue applies. keepMovedCurrent brings
every moved user up to it.

Run at this tree (origin/main 9fed5dc8c + this line):
- npm view @magpie-community/opencode-zcode-auth version --prefer-online:
  0.1.32.
- gofmt -l internal/provider clean; go vet ./internal/provider ok.
- go test ./internal/provider -run 'Mover|Moved|Migrat|ZCode|Min' ok.
- go test ./internal/provider: crashes in
  TestUnreadLoginsWriteErrorsKeepCredentials, "close of synctest channel
  from outside bubble" in filememo.Forget, which is #3632, open on main.
Not tried: a moved ZCode account updating to 0.1.32 in a running magpie.
2026-10-27 11:25:48 +08:00
yetone 82edec9cad provider: Kiro's mover needs 0.1.17, ZCode's 0.1.31 (plugins#408, #410)
kiro 0.1.17: the Free trial and Credits windows carry their credits used
and the limit, so the card's Left shows what is left (plugins#408).
zcode 0.1.31: ZCode 3.16's sign-in that keeps only a
project-key-location record reads that key, so its GLM Coding Plan is
found, not only the gift (plugins#410); also the bare-UUID x-session-id
(plugins#388).

npm view --prefer-online: opencode-kiro-auth 0.1.17,
opencode-zcode-auth 0.1.31.
Run: go test -tags nogui -count=1 ./internal/provider (with the #3632
test skipped) ok; gofmt.
2026-10-26 16:13:57 +08:00
yetone 0cba7fa680 provider: ZCode's mover min is 0.1.30 (plugins #387)
zcode 0.1.30 (plugins 57598ad) puts metadata.user_id
{"device_id":<sign-in's device>,"account_uuid":"","session_id":""} on a
GLM Coding Plan or team Messages request when the agent sent none, as
ZCode 3.14.3's client does on every Anthropic-format request
(glm/zcode.cjs Pst/MLs, vWr); before, only the Start Plan's dressed body
carried it. A key-only account's device is hashed from the key, the same
on every start. keepMovedCurrent brings every moved user up to it.

npm view --prefer-online @magpie-community/opencode-zcode-auth version:
0.1.30 when this landed.
Run at this tree: go test ./internal/provider/ -run
'Mover|Move|Moved|Migrat|ZCode|Retir|Adopt|HandOver' -count=1 -> ok.
Not run: the full suite (a one-line min change).
2026-10-25 18:34:27 +08:00
yetone d580537201 provider: the ZCode mover's min is 0.1.29, a sign-in keeping the account's user id
zcode 0.1.29 (plugins 5c9b7a4) gives each sign-in uid: ZCode's user_id,
so the plugin host tells two ZCode accounts of one name apart (wakkana
on Discord reported it for WorkBuddy), and the app's entry follows ZCode
only while it is signed in to that user id. keepMovedCurrent brings moved
users up to it.

npm view --prefer-online @magpie-community/opencode-zcode-auth version:
0.1.29 at landing. go test -run 'Mover|Movers|Notice|Migrat'
./internal/provider: ok.
2026-10-25 17:45:01 +08:00
yetone 492847818b provider: moved ZCode, Cursor, WorkBuddy and Qoder users get the plugins' latest fixes
Mover mins raised to the versions npm has at landing (npm view
--prefer-online): zcode 0.1.28 (plugins #369, #379), cursor 0.2.22
(#377), workbuddy/workbuddy-ai 0.1.34 (#337, #378, #346), qoder/qoder-cn
0.2.36 (#323, #378, QwenWork #319). keepMovedCurrent updates every moved
user's plugin to them.

Run: go test ./internal/provider/ ok (152s); gofmt -l clean.
Not tried: a real move or upgrade on a real account; the plugin fixes
themselves were reviewed and tested in the plugins repo, not against
the vendors' APIs.
2026-10-25 15:47:26 +08:00
yetone 7034378669 zcode: the Start Plan's 405 code 3012 says ZCode blocked the account, and rests it as restricted (plugins#348)
Since 10-24 many ZCode Start Plan accounts get 405 {"code":3012,"msg":
"request has been blocked due to unusual activity."} on every request.
On several of them ZCode's own app (3.16.3) gets the same 405, and
ZCode's support bot calls 3012 risk control on the account. magpie said
"though magpie sends it as the ZCode app does; it can be a network block
of this IP", rested the account as an unknown failure, and asked it again
soon after.

- provider.ZCodeRestrictedHint: the words @magpie-community/opencode-
  zcode-auth 0.1.27 puts after ZCode's own ("ZCode's risk control blocked
  this account for unusual activity (code 3012); it rests, and the
  group's other providers are used. If the ZCode app fails on this
  account too, only ZCode support can lift the block").
- gateway: restrictedSaid reads those words as failRestricted, as
  WorkBuddy's 11140: the account rests restrictedRest (2h), the next
  member is asked, and the Routing page's lift button brings it back.
- Routing page: the hint replaces the old one, in zh, zh-TW, ja and de.
- zcode mover min 0.1.27 (npm view --prefer-online: 0.1.27).

Not proven: why ZCode flags these accounts. Diffed against ZCode 3.16.3's
glm/zcode.cjs: the Start Plan goes unsigned there too (client request
signing is off for zhipu-account start-plan), and the headers match the
plugin's. Not tried with a real blocked account.

Run (sandbox HOME, at this tree): go test ./internal/provider ok;
go test -tags nogui ./internal/gui/... ok; go test ./internal/gateway
-run 'ZCode|Restricted|Blocked|EdgeBlocked|Moved' ok, and the new
TestZCodeStartPlanBlockRestsRestricted is red with routing.go reverted;
go vet darwin, linux, windows on provider and gateway ok; gofmt clean.
GUI (Playwright 1.62.0, chromium + webkit): routing-zcode-blocked,
i18n-keys, routing-blocked, routing-wb-restricted, gui-de, gui-ja,
gui-zh-tw: 41 pass, 0 fail. Not run: the full ./... suite (the machine
had a queue of full suites at load ~120).
2026-10-24 23:42:50 +08:00
yetone 638e51fe3f provider: ZCode's mover min is 0.1.26, so a signed-in account's gift plans keep their -Trial models
bigsteven (Discord #feedback, 10-24) saw no GLM-5.3-Trial on the latest
ZCode plugin. plugins cc0bd90 (0.1.26) fixes three ways the -Trial
entries went missing:
- ZCode's config out of reach marked the list fellBack, so magpie's host
  kept the last good list and dropped a gift's fresh -Trial entries;
- one failed gift-balance read hid them for 10 minutes (now 1);
- an API-key account, or a sign-in whose ZCode session expired, listed no
  -Trial models and the card said nothing. The card now says the gift
  plans need ZCode's sign-in.

Run: go test ./internal/provider (ok, 129s) at this head, on
origin/main b855cfee9. npm view --prefer-online gives 0.1.26.
In the plugins repo: bun test packages/zcode (102 pass) and
bun scripts/check.mjs zcode; each of the three fixes reverted by hand
turns its own tests red.
Not tried: a real account with a gift plan through the moved plugin.
2026-10-24 17:13:06 +08:00
yetone 4689ba69bd provider: the ZCode mover's min is 0.1.25, so a planless key says a ZCode gift plan needs ZCode's sign-in (rtbeilin on X)
rtbeilin's account is on ZCode 1024 Dev Day with no GLM Coding Plan.
ZCode's sign-in worked, an API key did not. zcode.z.ai serves gift
plans only to ZCode's session JWT, so a key can never spend one; 0.1.24
showed such a key an empty card and passed its requests' 1113 through
bare. zcode-auth 0.1.25 (plugins 71021b8) says why and what to use, on
the card and on the refusal. keepMovedCurrent brings every moved user
up to it.

npm: npm view --prefer-online @magpie-community/opencode-zcode-auth
version = 0.1.25; registry latest shasum 86033cf1 matches the publish
run 40078784618 (the run is red only for think-tags, plugins#180).

Run at this head (origin/main 6db5e9d59 + this change): gofmt -l and
go vet ./internal/provider/ clean; go test -count=1 ./internal/provider/
ok (97s), TestMovedBuiltinsSayTheirPlugin included.
Not tried: a moved account's plugin update from 0.1.24 in a real app.
2026-10-24 16:44:59 +08:00
yetone dd1e8822d9 provider: the ZCode move installs zcode-auth 0.1.24, so a Claude Code subagent on ZCode sees Bash, Read and Write
小八 on Discord (10-24): through magpie's ZCode plugin (glm-5.3, glm-5.3-flash)
a Claude Code subagent's tool list held only deferred MCP tools; Bash, Read
and Write were gone, the main conversation was fine. api.z.ai's Anthropic
endpoint, given a tool named exactly ToolSearch, shows the model no tool
but the ones a tool_reference loaded (input tokens 2886 with ToolSearch,
2439 with no tools, 6346 with it renamed). zcode-auth 0.1.24 (plugins
d1b6500) sends the search as ToolSearchTool, without defer_loading or the
placeholder, and renames the model's calls back. The Zhipu/Z.ai presets on
the gateway's Anthropic route are the same upstream; the cause is on #3253.

npm view @magpie-community/opencode-zcode-auth version --prefer-online:
0.1.24 at 23:44 UTC. The plugins publish run is red only for think-tags'
known E404 (plugins#180); zcode's line is "+ ...@0.1.24".

Run at this tree: gofmt -l internal/provider (clean); GOOS=linux, windows,
darwin go vet ./internal/provider (clean); go test -count=1 -timeout 45m
-ldflags='-s -w' ./internal/provider ok 86s (the disk had 250MB free, and
the unstripped test binary failed to link: no space left on device).
Not run: the full suite (same disk).
2026-10-24 07:46:27 +08:00
yetone a6a3dbde83 provider: the ZCode mover's min is 0.1.23, so a second gift plan's GLM-5.3 shows beside a spent one (01huadalang on Discord)
01huadalang's ZCode account has two gift plans, the 1024 Dev Day plan and
the new-user plan. Once the new-user plan's GLM-5.3 was used up the card
showed GLM-5.3 at 0 and never the 1024 plan's GLM-5.3. The plugin named
every bucket by its show_name alone and sent them in the balance's
order, so the account row's first two windows were the spent plan's and
the live plan's allowance sat in the tooltip under the same name.

Plugin 0.1.23 (magpie-community/plugins 1f8d38b) names each bucket after
its plan when there are several ("ZCode 1024 Dev Day · GLM-5.3") and puts
the buckets a request spends before those set aside. `npm view
@magpie-community/opencode-zcode-auth version --prefer-online` gives
0.1.23.

Run at this tree (origin/main a93190ae1 + this line): gofmt -l
internal/provider clean; GOOS=darwin, linux and windows go vet
./internal/provider ok; go build ./... ok; go test -timeout 45m
./internal/provider ok (89.7s). Plugin side: package tests 92 pass,
whole plugins repo 2375 pass, check.mjs ok; the new tests are red on
0.1.22's index.mjs.
Not tried: a real account with two active gift plans; the reporter's
own balance wasn't read.
2026-10-24 05:08:55 +08:00
yetone 843417957c provider: the ZCode mover's min is 0.1.22, so a Start Plan request goes with ZCode 3.16.3's headers alone (01huadalang on Discord)
01huadalang got the Start Plan's 405 again on plugin 0.1.21. A plugin
provider has no account of its own in the gateway, so Claude Code's own
headers (anthropic-beta, x-app, x-stainless-*,
anthropic-dangerous-direct-browser-access, x-claude-code-session-id)
and ?beta=true reached the plugin. 0.1.21 passed them on to zcode.z.ai.
The retired built-in never sent them.

Plugin 0.1.22 (magpie-community/plugins 57ec655) builds a Start Plan
request's headers from scratch, as ZCode.app 3.16.3 sends them: the new
x-zcode-query-source: main_turn, X-Os-Version as os.release(), and app
version 3.16.3. It also drops the URL's query. `npm view
@magpie-community/opencode-zcode-auth version --prefer-online` gives
0.1.22.

Run: go build ./..., go vet ./internal/provider, and go test -run
'Mover|Moved|Migrat|ZCode|Zcode|Min' ./internal/provider ok. Plugin
bun test (temp HOME): 90 pass.
Not tried: a real Start Plan account. Whether zcode.z.ai keys on these
headers is not established, and an IP block is still possible.
2026-10-24 00:50:49 +08:00
yetone c551a22997 provider: the ZCode mover's min is 0.1.21, whose Start Plan request keeps ZCode's three system blocks (plugins #343)
zcode.z.ai answers a Start Plan request whose system has a fourth block
with 405/3012 "request has been blocked due to unusual activity", and the
plugin up to 0.1.20 sent the agent's system prompt as that fourth block,
so every agent was turned away on a Start Plan account (fordlyn). 0.1.21
(plugins 44036e2) joins it to the end of ZCode's third block, as ZCode
3.14.3's ContextBuilder joins every dynamic system section.
keepMovedCurrent brings every moved user's plugin up to it.

npm view @magpie-community/opencode-zcode-auth version --prefer-online:
0.1.21 (its tarball carries the #343 change).
Run: gofmt -l internal/provider (clean); GOOS=darwin|linux|windows go vet
./internal/provider/ (ok); go test -timeout 45m ./internal/provider/ (ok,
98.9s). Not tried against the real API: no Start Plan account at hand.
2026-10-23 23:26:13 +08:00
yetone a00900d642 provider: ZCode's mover installs plugin 0.1.20, a team's plan beside the account's own (plugins #285)
An account with a GLM Coding Plan of its own and a seat on a team's could
only reach its own plan through the plugin. zcode 0.1.20 (plugins
d87dd8f, on npm) adds "ZCode: a team's GLM Coding Plan", which signs in
to the team seat as an account of its own, "<email> (team)". Raising the
min lets keepMovedCurrent bring every moved user to it.

Run at the parent 5fadf6ace: gofmt -l (clean); go vet ./... on darwin,
GOOS=linux -tags nogui and GOOS=windows (ok); set -o pipefail;
GOMODCACHE=/Users/yetone/go/pkg/mod go test -timeout 45m ./... (exit 0).
npm view @magpie-community/opencode-zcode-auth version --prefer-online:
0.1.20.
2026-10-21 09:35:44 +08:00
yetone f9ceac1628 provider: a move onto the plugin takes every account, and no model holds it back
The built-ins are retired (the owner, 10-16: 一定要下线完毕), so a move
can't be held back by something only the built-in could fix. Before, a
move failed when every account was lapsed, when one account's check
failed (the vendor unreachable through the plugin), when the vendor
refused every account, or when a model in use wasn't in the plugin's
list. Each of those left the user on a built-in that is going away.

Now Move installs the plugin and imports every account:
- one the vendor refuses goes along marked lapsed, as before;
- one already lapsed, or whose check fails otherwise, goes along untried
  and unmarked, for the plugin's own reads to judge, and is logged;
- no model is checked against the plugin's list.

Only an install failure, the plugin not serving the id, or a sign-in the
plugin won't import fails the move, which puts everything back and is
tried again after moveRetry. The movers' served (Devin, Cursor) and
builtin (ZCode) hooks, modelsInUse, modelNames, lapsedAll and devinBase
had no other use and are gone, with the tests of the hooks. The page still
translates an older magpie's lapsed, unserved and account whys, which
migrations.json can hold.

Tests:
- TestMoveEveryAccountLapsed and TestMoveTriesEachAccount are new, and
  TestMoveToPlugin's first case is now a refused account that moves.
  importAuth is a seam: the fake mover's "r-noimport" sign-in fails part
  way, so TestMoveToPlugin, TestMoveTidiesItsPlugin and TestMoveCutShort
  still test putting back.
- TestMoveCutShort's cut-short record now carries the sent sign-in's
  hash, as a real move writes it. Without it putBack took the built-in's
  sign-in as renewed. The old test passed only because the check renewed
  the token a second time.
- Broken by hand: with a failed check or a refusal returning an error
  again, TestMoveToPlugin and TestMoveTriesEachAccount go red.

What was run:
- go test -tags nogui ./internal/provider -run
  'Move|HandOver|Lapse|PutBack|Retir|Adopt|KeepMoved|ReleasePlugin|
  ZCodeStartPlan|Devin|Cursor' passes.
- go vet passes and gofmt -l is clean.
- At ab7b28510 on ba132d68b: go test -tags nogui ./... -count=1
  -timeout 90m, 66 packages ok, no FAIL; GOOS=linux and windows go vet
  of provider, gui and cli pass.
- Rebased onto origin/main with the next commit; the suite at that head
  is in its body.
2026-10-16 22:58:41 +08:00
yetone 53009f81a4 provider: every mover's min is the plugin that closes its gap with the built-in
Moved users are kept on these versions by keepMovedCurrent, each on npm
(npm view --prefer-online):
- devin 0.1.20: JSON output when asked; tool result images on the tool message
- commandcode 0.1.13: Credits reset at the subscription's end (#2454)
- cursor 0.2.18: a failed tool result read as isError; keychain backoff
- zed 0.1.8: "No plan" for a free account
- zcode 0.1.19: personal and team resets; Start Plan hint
- kiro 0.1.12: JSON output (output_config.format)

Run at 63be47717 with this batch: go test -tags nogui ./... -count=1 -timeout 90m, 66 packages ok, no FAIL (load ~250). gofmt -l clean; GOOS=linux and GOOS=windows go vet of provider, gateway and plugin pass. (devin's min rose after the run: go test ./internal/provider -run 'Mover|Moved' ok.)
2026-10-16 19:38:06 +08:00
yetone 63ad2b7c76 provider: a moved ZCode updates to plugin 0.1.18, which reads ZCode 3.15's plan key from config.json (#2130)
Plugin zcode 0.1.18 (magpie-community/plugins 5c0aebc, on npm) gives moved
users the built-in's 1d8e83a79 fix. ZCode 3.15 keeps the GLM Coding Plan
key only in config.json's provider options.apiKey, so a valid plan read
as "no plan, Start Plan ended". keepMovedCurrent now updates every moved
ZCode user to it.

Run: npm view @magpie-community/opencode-zcode-auth@0.1.18 resolves;
gofmt -l; go vet for darwin, linux (nogui) and windows;
go test ./internal/provider/ -run 'Move|Migrat|Plugin|ZCode' passes.
2026-10-14 15:50:26 +08:00
yetone 23611ca6a5 provider: a moved ZCode subscription takes plugin 0.1.17, which reads ZCode's sign-in from the folder its data was moved to
What changed: the zcode mover's min goes from 0.1.16 to 0.1.17, so
keepMovedCurrent updates every moved user's @magpie-community/opencode-zcode-auth.
41972b25f made the built-in follow ZCode 3.14's 数据存储路径 (dataBaseDir in the
home folder's .zcode/v2/setting.json); the plugin, which is what runs for a
moved ZCode subscription, still read ~/.zcode/v2/credentials.json and
runtime/provider only, so "ZCode app's sign-in" read the stale copy ZCode
left at home. plugins 65a7676 (0.1.17) reads dataBaseDir as ZCodeDataIn does
(trimmed, ignored when empty or not absolute) for credentials.json and the
zcode-builtin.json walk, and keeps reading setting.json from the home folder,
where ZCode keeps it (getSettingsFile; copyDataDirectory leaves it out).

ZCode's CLI session database (~/.zcode/cli/db/db.sqlite, internal/sessions)
does not move with dataBaseDir: the CLI (glm/zcode.cjs, 3.14.3) takes it
from storage.sessionDbPath, default "~/.zcode/cli/db/db.sqlite" expanded
with os.homedir(), and the host sets neither ZCODE_SESSION_DB_PATH nor
ZCODE_STORAGE_DIR; copyDataDirectory copies .zcode/v2 only. So the session
reader is unchanged.

What was run:
- npm view @magpie-community/opencode-zcode-auth@0.1.17: published (publish
  run 38370080577; that run is red only for zed-auth and zen-free-auth,
  E404 Trusted Publisher).
- Plugin: HOME=$(mktemp -d) bun test at the repo root, 1185 pass; its new
  moved.test.mjs fails with the old path.
- gofmt -l; go vet ./internal/provider (darwin), GOOS=linux and
  GOOS=windows go vet -tags nogui; go test -tags nogui ./internal/provider
  under a sandbox HOME: ok.
- Not run: a real ZCode with a moved folder, Windows.
2026-10-13 16:40:14 +08:00
yetone 6a8b2c6831 provider: a moved ZCode account is brought to plugin 0.1.16, whose app sign-in follows ZCode only while it is signed in to the same account (LingYi_Stu on X)
Raises the zcode mover's min so keepMovedCurrent updates every moved user
to @magpie-community/opencode-zcode-auth 0.1.16 (plugins d2be892). With
the "ZCode app's sign-in" added for account A and again after ZCode
switched to B, A's entry read ZCode's current credentials on every
request, so it sent B's requests and its usage card showed B. 0.1.16
follows ZCode only while ZCode's user is the entry's account; otherwise
it uses what was saved at sign-in, and asks for sign-in again when that
session has run out. Published by the plugins repo's publish workflow;
npm view says 0.1.16 is latest.

Run: go test ./internal/provider/ (ok, 99s); gofmt -l internal/provider
(clean); go vet ./internal/provider/ on darwin, GOOS=linux, GOOS=windows.
2026-10-12 14:47:13 +08:00
yetone c763d4fe1d provider: a moved ZCode or Command Code account is brought to plugin 0.1.15 / 0.1.10, which say the agent's folder (plugins #86, Hipple)
Raises the movers' min so keepMovedCurrent updates every moved user:
- @magpie-community/opencode-zcode-auth 0.1.15 (plugins baa788b): the
  Start Plan's environment section says the folder and git repository
  magpie tells it, never magpie's own folder, and leaves out what it
  isn't told and the shell.
- @magpie-community/opencode-commandcode-auth 0.1.10 (plugins 7e67b98): a
  Go request's workingDir and isGitRepo are the agent's.
Both were published by the plugins repo's publish workflow and are the
registry's latest. Run: go test internal/provider.
2026-10-11 21:51:34 +08:00
yetone 927da8c41a provider: moved ZCode users get plugin 0.1.14, which lists a gift-only account's GLM-5.3 as GLM-5.3 (#1261)
sun1090's ZCode account has no GLM Coding Plan, only the Start Plan, whose
buckets serve GLM-5.3 and GLM-5.3-Flash. The card counted GLM-5.3, but the
plugin listed the Start Plan's config models (GLM-5.3-Flash, GLM-5.2,
GLM-5-Turbo) and GLM-5.3 only as GLM-5.3-Trial. ZCode itself lists a Start
Plan account's models as its balance's buckets name them, so 0.1.14
(magpie-community/plugins aca7c59) lists them by their own names too, and
keeps the -Trial entries. keepMovedCurrent updates every moved ZCode user.
The builtin check's note says the plugin now lists GLM-5.3 while a gift
bucket serves it; the check itself is unchanged.

0.1.14 resolves with npm view and its publish run passed. The plugin's
bun test (75) passes and its new test fails on 0.1.13. go test -tags nogui
./internal/provider under a temp HOME passes; GOOS=linux and GOOS=windows
go vet pass. Not tried with a real Start Plan account here.
2026-10-08 16:23:52 +08:00
yetone e4c292f655 provider: moved ZCode users get plugin 0.1.13, whose claim line has one fixed name the GUI can translate (plugins #43) 2026-10-08 11:57:15 +08:00
yetone 92e4fc32fa provider: moved ZCode users get plugin 0.1.12 and moved WorkBuddy users 0.1.10 — ZCode's counted windows carry their amount and limit so the card's count follows used/left (#659, magpie-community/plugins#35); WorkBuddy's credits-used-up error (code 14018, matched as the whole code) says so with the nested message (plugins#25). Both versions resolve with npm view. go test -tags nogui ./internal/provider under a temp HOME passes; the plugins' own bun tests passed at merge. Not tried with a real ZCode or WorkBuddy account here. 2026-10-07 18:52:23 +08:00
yetone b95ce8c6f3 provider: ZCode's mover asks for @magpie-community/opencode-zcode-auth 0.1.11, which names a gift plan ZCode holds but hasn't granted on the usage card ("1 to claim · claim it in the ZCode app") — #1001 (MiFaZhan): a day's ZCode Trust Build is not on the account until the ZCode app claims it, and an account signed in through magpie alone let it lapse. The plugin (magpie-community/plugins#30) reads ZCode's own GET /api/v1/zcode-plan/billing/preview with the card and adds one window set aside, so routing, caps and the menu bar pass it over; it never claims (the claim needs the Aliyun captcha only the app's renderer makes). A failed or empty preview adds nothing and an error card asks nothing. keepMovedCurrent updates every moved ZCode user to it. go test ./internal/provider and gofmt pass; the plugin's bun test (72) and check.mjs pass, 4 of its new tests fail on 0.1.10. Not tried with a real ZCode account here. 2026-10-06 17:50:39 +08:00
yetone 15102c809f provider: a ZCode account's spent gift bucket doesn't hold up a model another of its plans still has (ganlerk on Discord) — an account with ZCode Trust Build (GLM-5.3-Flash 14.5% used) and the Start Plan (GLM-5.3-Flash all used) read GLM-5.3-Flash, and so the account, as 100% used: every bucket's window counted its model, and routing takes the fullest. The server picks the bucket (ZCode sends no plan with a request), so a model now counts on one bucket, a live one before a spent one, the least used; a bucket no model counts on stays on the card set aside. The plugin does the same from 0.1.10 (magpie-community/plugins 6b13dc0), and the mover's min is raised to it. TestZCodeStartSpentSiblingAside fails without the change. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass. 2026-10-05 20:02:13 +08:00
yetone 2350ea7aa7 provider: moved ZCode users get plugin 0.1.9, where the gift's models are trial entries the user picks (plugins #21) — 0.1.8 spent a dual account's gift before its GLM Coding Plan for every model the gift served, so a user who meant to spend the plan had no say. 0.1.9 lists each live gift model again as <model>-Trial (GLM-5.3-Flash-Trial): that entry spends the gift and answers 429 locally when its bucket is spent or blocked, and a plain model always spends the coding plan. Reviewed line by line and run against a fake upstream (a coding-only account's trial entry is a local 400, a streamed trial request reaches zcode.z.ai with the raw model, a 1113 inside a 200 becomes 429 and keeps the entry off for a minute, a plain model still goes to api.z.ai); bun test (65 pass) and bun scripts/check.mjs zcode pass. go vet and go test -tags nogui ./internal/provider/ under a temp HOME pass. 2026-10-05 14:29:35 +08:00
yetone 14f59920f0 zcode: moved accounts are brought to the plugin's 0.1.8, which spends an account's ZCode gift plans before its GLM Coding Plan (magpie-community/plugins#19, erlinerd) — an account with both a coding plan and a gift (a Trust Build grant, say) sent every request to the coding plan, and the gift lapsed unspent. 0.1.8 sends a model the gift serves to it first, replays to the coding plan on any refusal (a quota answer keeps that model off the gift for a minute), and shows the gift's buckets on the coding card. With the owner's real GLM Coding Lite account (no gift) the card and a glm-4.6 request were as before; the gift route is covered by the plugin's tests only. go vet, builds (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass. 2026-10-04 20:09:16 +08:00