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.
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.)
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.
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.
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.
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.
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.