ReneXiong's Zed Student account (an organization without an active subscription) showed "zed (Zed, 6 models)" with no error: the six models the config hook declares before sign-in, with their hard-coded limits. provider.models handed those back whenever /models failed and no list had been read for the account. The likely path for this account is a 200 whose models are all disabled: parseModels throws "Zed lists no models for this account", the hook returned the declared list, and magpie's host, seeing the last fetch answer 200, didn't mark the list as fallen back, so nothing said it wasn't the account's. Now, with no list ever read for the account, the hook throws the reason (Zed's own "Zed: ... (status)", "Zed lists no models for this account ...", or "Zed: this account's models couldn't be read: <cause>"). magpie's host takes a thrown models error as fellBack with that message as listError, and the editor and `magpie providers` show "couldn't list its models: <reason>". A list read before is still kept on a later failure, as it was. A 401 for the model token still marks the sign-in expired. Tests (bun 1.4.2, packages/zed): models.test.mjs 7 pass. With the old index.mjs and the new tests, 3 fail: "the list refused with the token just minted", "Zed down before any list", "a 200 listing nothing callable" (each got the declared models back). Whole package: 33 pass, 0 fail. Siblings: minimax, qoder, trae, raccoon, workbuddy and opendesign also return provider.models on a failed list. Each of those checks a response status magpie's host sees, so a failed read is marked as fallen back with its HTTP status; not changed here. Not tried against a real Zed account.
12 lines
478 B
JSON
12 lines
478 B
JSON
{
|
|
"name": "@magpie-community/opencode-zed-auth",
|
|
"version": "0.1.9",
|
|
"description": "Sign in to a Zed subscription (Zed Pro, trial, student, business) from OpenCode or magpie",
|
|
"type": "module",
|
|
"main": "./index.mjs",
|
|
"files": ["index.mjs", "README.md"],
|
|
"keywords": ["opencode", "opencode-plugin", "magpie", "zed"],
|
|
"license": "MIT",
|
|
"repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/zed" }
|
|
}
|