When ZCode rate limits a check-in (HTTP 429 on the touch feed, or code 3002 on a claim), the plugin now holds that account itself. Until the wait is over, a check-in answers the same failed (message and until) and sends no request. The wait follows Retry-After (seconds or a date) up to six hours. Without one, it doubles from 30 minutes. A read that comes through with nothing rate limited forgets it. magpie before v0.1.3165 asks a failed again after 30 minutes whatever its until says, which is how #503 saw 180 reads in four days. The hold is keyed by the account (s.key || s.jwt), so keyless Start-Plan sign-ins each have their own. It lives in memory, so a restart forgets it. Run at 017e5dfc (merge base654d3bea), on mote with HOME in a temp folder: bun test packages/zcode 208 pass, 0 fail; check.mjs zcode ok. Merged with origin/main8163be36: zcode 209 pass; the whole repo check.mjs exit 0 and bun test 6498 pass, 20 skip, 0 fail. Broken by hand, each red: holdKey back to s.key (the two-keyless-accounts test), the delete moved before the claims (the claim doubling test), no forget after a read with nothing to claim (the doubling test). CI on-npm and test green at 017e5dfc. Not tried: a live ZCode 429 or 3002.
21 lines
783 B
JSON
21 lines
783 B
JSON
{
|
|
"name": "@magpie-community/opencode-zcode-auth",
|
|
"version": "0.1.52",
|
|
"description": "OpenCode provider plugin: signs in to Z.ai's or BigModel's (智谱) GLM Coding Plan as ZCode does, including team seats and ZCode's Start Plan, and claims its gift plans daily",
|
|
"type": "module",
|
|
"main": "./opencode.mjs",
|
|
"exports": { ".": "./opencode2.mjs" },
|
|
"files": ["index.mjs", "opencode.mjs", "opencode2.mjs", "prompt.mjs", "README.md"],
|
|
"keywords": ["opencode", "opencode-plugin", "magpie", "zcode", "z.ai", "bigmodel", "glm", "coding-plan"],
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/magpie-community/plugins.git",
|
|
"directory": "packages/zcode"
|
|
},
|
|
"magpie": {
|
|
"maxConcurrency": 3,
|
|
"maxAccounts": 2
|
|
}
|
|
}
|