Parity with magpie's built-ins: a failed sign-in says why, CLI-backed Command Code and Devin accounts follow the CLI's key, Factory's refused renewal is a 401 in the caller's API shape

- every {type:"failed"} carries an error reason magpie shows
- commandcode/devin: accounts taken from the CLI are marked metadata.cli and re-read its credentials on each request, usage and models
- factory: a refused refresh answers 401 authentication_error (Anthropic shape on /llm/a/, OpenAI's elsewhere) instead of throwing; the whoami back-off is per account; 403 hints name the account to sign in again
- versions: factory/devin/commandcode/cursor/kiro/mimo/zed/zcode 0.1.2, workbuddy 0.1.3
This commit is contained in:
yetone
2026-10-01 00:55:50 +08:00
parent bd9c0780cc
commit c8f4d448df
22 changed files with 228 additions and 75 deletions
+1 -1
View File
@@ -661,7 +661,7 @@ async function authorize(site, log) {
instructions: `Sign in to ${SITES[site].name} in the browser; this finishes on its own.`,
method: "auto",
async callback() {
const fail = (msg) => (log(msg), { type: "failed" })
const fail = (msg) => (log(msg), { type: "failed", error: msg })
for (;;) {
await sleep(interval)
if (Date.now() > deadline) return fail("the sign-in expired; start again")
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@magpie-community/opencode-zcode-auth",
"version": "0.1.1",
"version": "0.1.2",
"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",
"type": "module",
"main": "./index.mjs",