Commit Graph
83 Commits
Author SHA1 Message Date
yetone 01acd0951c minimax 0.1.1: a refresh token is never sent twice, and magpie renews the sign-in ahead of time through auth.refresh (ARNO on Discord: minimax插件的登录状态容易掉登陆,几个小时就提示要重新登陆了)
MiniMax spends a refresh token once: sent again it is invalid_grant, which
signs the account out (MiniMax Code takes a lock across its processes and
keeps a generation for it). The plugin's refresh request is MiniMax Code's
own, so what drops the account is a refresh token spent a second time:

- auth.refresh + refreshLead (10 minutes): magpie renews the account once,
  before its requests, models and usage ask for it. The 2-minute check
  before each request stays for OpenCode.
- A refresh whose save failed kept its tokens a minute, then went back to
  the spent refresh token on disk. They are kept now until saved, and
  latest() follows them.
- invalid_grant when the store holds a newer refresh token than the one
  spent (another magpie process renewed it) uses that one, not a sign-out.
- A 401 retries with a newer saved token when there is one, and refreshes
  only when the token turned away is still the newest.

Five tests in refresh.test.mjs, all failing on 0.1.0. HOME=$(mktemp -d) bun test: 353 pass.
2026-10-03 11:39:06 +08:00
yetone 93aa1671aa cursor: write each catalog entry as its CallDynamicTool call; a thinking-only turn is an empty reply (#11)
GLM-5.3 read the catalog's <tool name=...> entries as tools of its own and
called them by bare names, which went nowhere. Each entry is now the
CallDynamicTool call itself (namespace, toolName, arguments) — the change
infinitr0us proposed in #11, thanks! A turn that ends with only thinking,
no text and no tool call, is answered as an empty reply so the client asks
again, as the stream's end already did. 0.1.8.
2026-10-03 08:39:01 +08:00
XIQI ef68e7c7c0 factory: handle quoted tool metadata and directory model updates (#10) 2026-10-03 00:34:10 +08:00
yetone 8f25b63718 publish from GitHub Actions with npm's trusted publishing, no one-time password [skip ci]
.github/workflows/publish.yml runs the tests (in a throwaway HOME) and
scripts/publish.sh on each package.json change pushed to main, or by hand;
npm's OIDC exchange stands in for a token and an OTP. Every package now
names magpie-community/plugins' publish.yml as its trusted publisher on
npmjs.com, and gets the repository field npm checks it against.
2026-10-03 00:00:23 +08:00
XIQI d7d8d61c42 factory: adapt Claude Code's standalone model-switch system updates (#9)
After /model, Claude Code 2.1.287 sends a separate string-content system message that opens with the new model paragraph and carries <total_tokens> metadata but no environment block; Factory refused it with 403, so continuing a conversation after a model switch failed. systemContext now also adapts that shape: only when the message starts with the model paragraph and has a complete generated <total_tokens>N tokens left</total_tokens> paragraph, it rewrites each whole model paragraph (named or not, routing-group ids, accumulated switches) to Current model / Model ID / Model knowledge cutoff, leaving every other byte, role and order as sent; inference and count_tokens share it, and a second pass is byte-identical. Tests cover accumulated switches across both endpoints with idempotence, and pass-through for incomplete markers, quoted text, array content and non-system roles. Factory bumped to 0.1.9.
2026-10-02 23:22:21 +08:00
yetone ef81d34320 tests: a usage test's offline fetch is put back when its file is done, so the next file doesn't inherit it
bun test runs every file in one process, and three usage tests left
globalThis.fetch on a fake of theirs: zcode's (offline, set in a
beforeEach, never restored), kiro's and workbuddy's (offline, set at
import, never restored). A file run after them got that fake:

- minimax's tests (27/27 alone) failed 19 after zcode's usage test: the
  plugin's requests to the local fake MiniMax went to zcode's offline and
  threw "no network in tests".
- qoder's cn.test.mjs takes globalThis.fetch as the real one when it loads;
  after kiro's or workbuddy's usage test that was offline, so every request
  meant for its Bun.serve stand-in threw. The CN sign-in, which polls on
  through errors, timed out at 10 s and kept polling, and the job-token test
  timed out too, so a full bun test never finished.

Each of the three now keeps the fetch it found and puts it back in
afterAll. Test-only; no package version changes. HOME=$(mktemp -d) bun
test: 341 pass, 0 fail across 42 files (8.5 s); bun scripts/check.mjs
passes.
2026-10-02 23:13:06 +08:00
volcanic 8b4f759455 Cline: usage billing, ClinePass and the free models, with Cline's own device sign-in or an API key (#2)
* Cline: usage-billed models, ClinePass's and Cline's free ones, on your own Cline account — Cline's device sign-in (WorkOS device code, traded at /auth/register) or an API key; chat completions on api.cline.bot with Cline's own client-identity headers (pinned to the current CLI release — what the free models' gate reads), the non-stream data envelope unwrapped, the model list from Cline's recommended-models feed, usage from the account's balance (counted in millionths of a dollar). cline-pass answers 403 ENTITLEMENT_ERROR without the subscription and the message says so; so does an empty balance, with the top-up URL.

* cline 0.1.0: the pinned CLI version and the workos: prefix move to Cline's current client — apps/cli is at 3.0.68, and provider-auth-registry's formatProviderOAuthApiKey lowercases before it startsWith("workos:") so a token stored as WorkOS: is not double-prefixed here either; bearerOf's "once" test fails against 0.1.0.

* cline 0.1.0: the model list is Cline's whole catalog, not just the recommended feed — the title promised usage-billed models but the plugin read only recommended-models (6 paid models), while Cline's own clients also load /api/v1/ai/cline/models (loadCloudModels), so most usage-billed models were missing. The four feed arrays are now read by name instead of walking every value (a tag or description could become a model, and one in both recommended and free lost its "(free)"), clineCloud stays out as the client leaves it out, a raw-id name is prettified, and the bundled snapshot drops gemini-2.5-pro and minimax-m2.5 (not in cline-recommended.generated.ts) and gains the missing cline-pass/* entries; the parseFeed, snapshot and models-merge tests fail against 0.1.0.

* cline 0.1.0: a refresh failure no longer fails a request that still has a good token, and a rotated pair survives a failing auth.set — a 4-minute token plus a 500 from /auth/refresh answered the chat 502 and never sent it, and with auth.set throwing the next request re-spent the old refresh token, got invalid_grant and marked the account expired. fresh now keeps the current token on a transient failure while it is still good (Cline's getValidClineCredentials), failing only once it has expired, and the latest rotated pair is held in memory beside the save (kiro's held), used when getAuth still hands back the spent token; the still-good-token and rotated-pair tests fail against 0.1.0.

* cline 0.1.0: failure() keys on Cline's error codes and whole phrases, not loose substrings — a 403 whose text mentioned "tokens" (max_tokens exceeds…) became "the sign-in lapsed — sign in again" and lost the real message, and any message containing "credit" became a 429 usage limit. The 401/403 token check, the out-of-credits and entitlement checks and the 429 check now match what Cline's client matches (ENTITLEMENT_ERROR, insufficient_credits, SPEND_LIMIT_EXCEEDED, the not-subscribed wording), and a renewed token clears the lapse mark through the error path too as qoder's renewed() does; the codes-and-phrases and renewed-mark tests fail against 0.1.0.

* cline 0.1.0: device polling grows the interval for good and rides out a bad poll — slow_down raised it for one poll only (RFC 8628 and Cline's pollWorkOSTokens do interval += 1 permanently), the minimum was 0.25s where the client clamps to 1s, and a single 5xx, non-JSON reply or network error ended the sign-in with "the token answer had no access token". The poll now keeps polling through those; the slow_down, one-second and bad-poll tests fail against 0.1.0.

* cline 0.1.0: the held pair covers every refresh token this run has spent, not only the last — when auth.set goes on failing (which a store that failed once usually does) getAuth keeps handing back the first pair, and a second rotation overwrote held.from, so the third request refreshed the already-spent r1 again: /auth/refresh went r1, r2, r1 and the chat answered 401 expired. held.from is a Set every rotation adds to now, and the held pair is used whenever the refresh token getAuth hands back is in it; the two-rotation test fails against 0.1.0 (200, 200, 401).

* cline 0.1.0: X-CORE-VERSION moves to 0.0.90 with the CLI release — the header set pinned 3.0.68 beside 0.0.89, but cline@3.0.68 depends on @cline/core 0.0.90 (0.0.89 is what 3.0.67 shipped) and resolveProviderRequestHeaders sends X-CORE-VERSION from that dependency, so the number the comment calls the one that has to match was a release behind; the client-header test pins the pair now and fails against 0.1.0.

* cline 0.1.0: a poll reply that isn't JSON and isn't a 5xx fails the sign-in at once — a body that wouldn't parse was read as WorkOS having a moment, so an HTML 400 (a proxy's error page, say) kept the poll going to the deadline, ten minutes, before failing there anyway. Only a network error and a 5xx are a poll to try again now; a 4xx that isn't JSON is the poll refused. The refusal test fails against 0.1.0.

* cline 0.1.0: a renewal's mark survives a network error on the chat itself — the 502 the fetch throws after a renewal returned without signed(..., renewed(cred)), so the request that never left the machine dropped the mark while the request that came back refused kept it; it is wrapped the way the !res.ok path is. The network-error test fails against 0.1.0.

* cline 0.1.0: the held pair is kept per rotation chain, so no account is sent on another's token — magpie calls ClinePlugin once for the provider and hands every account its own getAuth, so the one `held` pair outlived them: with two accounts, a save failing every time and every token wanting renewal, A, B, A went out as A-jwt1, B-jwt1, B-jwt2 and A's third request refreshed with B's token, spending it and billing B (yetone's two-loader repro, page-for-page the same). A spent refresh token now maps to the newest pair its own chain reached — the token getAuth handed back and the one the refresh spent both point at that chain — so a request offering either finds its own account's pair; the per-chain test fails against 0.1.0 on the third request's Authorization, with the 51 before it passing.
2026-10-02 23:03:54 +08:00
XIQI a51d4d2ec7 factory: adapt Claude 5 system-role runtime metadata (#8) 2026-10-02 23:03:32 +08:00
yetone e2c72b2ae7 qoder 0.2.2, workbuddy 0.1.6: each model's credit rate goes to magpie (rate, rateWas), as magpie's built-ins read it (yetone/magpie 33acb6bc, v0.1.667)
magpie now shows each model's credit rate in the provider's model list and an agent's picker (01huadalang on Discord: pick the cheap models without opening Qoder or WorkBuddy); a plugin gives it beside free on each model its provider.models hook lists. Qoder and Qoder CN: rate is the price_factor (priceFactor); rateWas an active promotion's before_promotion_price_factor, else an original_price_factor above the price (Qwen3.8-Flash: 0x, 0.1x struck through); a promotion's 0 that isn't free is its price before times its discount_factor; a listing with no price gives none — the rule of internal/qoder/models.go's ModelInfo.free. WorkBuddy and WorkBuddy AI: rate is the model's credits ("x0.03" is 0.03; x0.00 stays free; an unreadable, negative or infinite rate is neither free nor rated), as wbCredits reads it.

usage.test.mjs in each package gets a test fed a fake listing / fake /v3/config (the cases of core's TestParseModelsRate and TestWBCreditsRate); both fail against the previous index.mjs and pass now. No request was made to Qoder or WorkBuddy. bun test (HOME a temp dir) and bun scripts/check.mjs pass.
2026-10-02 22:54:55 +08:00
yetone 7c859cc532 minimax 0.1.0: MiniMax Code (mcode) accounts' credits and M Plan, China (minimax-code) and international (minimax-code-global), with MiniMax Code's own device sign-in (Magic_zero on Discord)
A new package, @magpie-community/opencode-minimax-auth, written from MiniMax Code 0.6.2's bundle.

Sign-in: MiniMax Code's OAuth device flow, the same one mcode uses (account.minimax.cn / account.minimax.io, client mcode-public, scope agent.default, audience agent-backend, PKCE S256). It also handles MiniMax's own variant, where there is no device_code, the user_code is polled for, and expired_in may be an at-ms. The account is named from MiniMax's signed /v1/api/user/info. mcode's ~/.minimax sign-in is never read or written. Each account is a sign-in of its own, so magpie can hold several.

Refresh: two minutes before the token ends, or once on a 401. One refresh runs per account (keyed by the refresh token it spends), and its result answers for the old token for a minute, so a late reader doesn't spend a rotated token twice. Only invalid_grant with HTTP 400 signs the account out (signIn: expired); any other failure keeps it and uses the token in hand while it lasts.

Chats: Anthropic messages at <agent>/mavis/api/v1/llm/v1/messages, carrying:
- Authorization: Bearer <token>
- x-api-key sk-xxx (mcode's placeholder)
- User-Agent MiniMaxAgent
- X-Mavis-Agent-Id main
- X-Mavis-Timezone-Offset
- X-Mavis-Session-Id, from chat.headers' sessionID (otherwise a fixed id per run)

A 402, 403 or 429 whose body says credits or quota ran out goes on as a 429 "usage limit reached".

Models: the live config at GET /mavis/api/v1/models?region=&buildEnv=prod (asked again without auth on a 401/403), with mcode's built-in four as the fallback: MiniMax-M3.1-Flash-Preview, MiniMax-M3, MiniMax-M2.7 and MiniMax-M2.7-highspeed. Variants follow what mcode sends: adaptive thinking at an effort (output_config.effort), and none to turn thinking off.

Usage: mcode's signed account API: user info, the type-0 workspace from get_user_extra_info, then get_membership_info. The card shows credits left (op_credit_summary / opcredit_balance), Free or "M Plan <tier>" with its end, and, for an M Plan, coding_plan/remains with X-Group-Id. That is read as magpie's readMiniMaxPlan reads it. There is no check-in.

Tests: fakes only. nonet.mjs is imported first, so only 127.0.0.1 can be reached. They cover:
- sign-in, the variant, refused, and other errors
- refresh, a three-way race plus a late stale reader, per-account refreshes, invalid_grant, other failures, and 401 then refresh then retry
- request headers and chat.headers
- credits running out going on as a 429
- the live list, the retry without auth, and the fallback (the given object back)
- signing, against fixed vectors and the bundle's formula
- usage parsing (readMiniMaxPlan's own fixture), Free, M Plan, and a refused account

bun test packages/minimax (27 pass) and bun scripts/check.mjs pass.

End to end through magpie: origin/main b0486663, built with -tags nogui in a worktree since removed, under env -i with a sandbox HOME, a fake upstream on 127.0.0.1:47811, and a copy of the package with its hosts pointed there:
- plugin add
- plugin login minimax-code: the device flow and the account named; a second login of the same account merged into one
- the live list: 2 models
- provider test minimax-code: the chat went out with the headers above
- quota: M Plan Plus, 321.5 credits, 5 hours and 7 days windows
- an expired token refreshed and saved

No request was made to MiniMax.
2026-10-02 22:38:41 +08:00
yetone 3ae3e4393e cursor 0.1.7: a model Cursor serves only in Max Mode is asked for in Max Mode, and the models Cursor's picker offers beyond the CLI's list (GLM-5.3, GLM-5.3 Flash) are listed (ARNO on Discord: "Cursor: Max Mode Required: The model "gpt-5.6-luna-low" requires Max Mode to be enabled"; "cursor provider 里少了 glm-5.3 和 glm-5.3-flash")
The Run's model went as ModelDetails and RequestedModel with its id alone, never max_mode (ModelDetails field 7, RequestedModel field 2), so a model Cursor serves only in Max Mode was refused. cursor-agent (2026.10.01) turns Max Mode on for such a model itself: requiresMaxMode is supportsNonMaxMode === false or a variant's isMaxMode in AiService/AvailableModels, and a usable model's own maxMode is kept. Now the list notes Max Mode from GetUsableModels' maxMode and from the picker (AvailableModels with useModelParameters, as the CLI asks for it), the Run sends it, and a model neither says it of is asked once more in Max Mode when Cursor answers "Max Mode Required" (the CLI's MAX_MODE_REQUIRED), and in Max Mode from then on. An account Max Mode isn't open to gets Cursor's own answer.

The list was GetUsableModels alone, which is `cursor-agent models`; Cursor's picker offers models it leaves out. The picker's models that no usable id, name or slug names are added: one per variant with a legacy slug, else the model by its name with its default variant's parameters, sent as RequestedModel.parameters; hidden, chat-only, Tab-only and non-agent models, and the four the CLI drops, stay out. A picker Cursor can't give leaves the list as it was.

The tests now import nonet.mjs first: fetch and HTTP/2 reach only this machine, so a test without its fake, or work still running after it, can't send a token to Cursor. maxmode.test.mjs (fake API and agent API: the list with GLM-5.3 and its Flash and Max Mode marked, the picker down, the Run's max_mode and parameters, the retry after Cursor's refusal) fails without the change (5 of 5) and passes with it; bun test packages/cursor (27 pass) and bun scripts/check.mjs pass. No request was made to Cursor.
2026-10-02 22:10:35 +08:00
XIQI bcfb867635 factory: adapt built-in configuration skill metadata (#7) 2026-10-02 22:03:31 +08:00
yetone 6fd444cf5b qoder 0.2.1: a model is free only at a price_factor of 0 — Qwen3.8-Max, 0.5× with an off-peak discount, is no longer marked free
Qoder's listing (as it came on 2026-10-02) carries is_free true on Qwen3.8-Max, whose price_factor is 0.5 and whose promotion is the off-peak 60% off (错峰 4 折, rule idle_time_model_credit_discount, before_promotion_price_factor 0.5); Qoder's own app ignores is_free in the model picker and shows 0.5×. freeOf took is_free true OR a price_factor of 0, so Max came out free. Now the price decides, as Qoder's app shows it: a price_factor (priceFactor) of 0 is free — Qwen3.8-Flash, 0× with original_price_factor 0.1 struck through, stays free — any other price is not, whatever is_free says, and a 0 that lasts only while an active promotion with a price before it runs is a discount, not free. is_free is read only from a listing that gives no price at all.

usage.test.mjs's new test feeds the listing's own entries (Max, Flash, Qwen3.7-Max, Kimi-K3) and promotion shapes; it fails against 0.2.0 (Max free). The built-in (internal/qoder/models.go, ModelInfo.free) has the same is_free || price 0 rule and needs the same change on magpie's side.
2026-10-02 21:50:13 +08:00
yetone 15e66f6792 cursor 0.1.6: a conversation's Runs keep one conversation_id, so Grok's and Opus's prompt cache on Cursor sticks, and Cursor's usage no longer counts the cache twice (#6, the port of yetone/magpie#498's 0f415708 the plugin missed)
buildRun gave every Run a new random AgentRunRequest.conversation_id, so Cursor's backend sent each turn to whichever machine and the prompt cache hit only by chance (congee949: cache_read 0, 1152, 0, 0, 0, 0 over six turns of one Grok conversation). The id is now made as the built-in's cursorConversation makes it: a UUID hashed from what names the session — the request's prompt_cache_key (Codex's thread id), else the session magpie (or OpenCode) tells the new chat.headers hook, which the hook hands the loader's fetch in x-magpie-cursor-session and which goes no further — together with the conversation's first user message, so subagents under one session are conversations of their own. With nothing naming the session it stays random per Run: magpie's own "magpie-<24 hex>" session, made of the first message alone when the agent names none, is taken as none, as the built-in's nativeSessionOf does. The hook only marks requests to cursor, as every plugin's chat.headers sees every provider's.

TurnEndedUpdate.input_tokens counts the whole prompt, the cache read and written included; it was taken as the uncached input and the cache added again for prompt_tokens. Now, as cursorUsage: input = max(input_tokens - cache_read - cache_write, 0), reasoning_tokens (field 5) given as completion_tokens_details.reasoning_tokens. The prompt is guessed only when Cursor counted nothing at all, not when it was all read from the cache.

conversation.test.mjs runs the plugin against a fake Cursor (its API a stand-in fetch, the agent API an HTTP/2 server on 127.0.0.1, any other connection refused): a session's turns keep one id, another session or another first message gets its own, prompt_cache_key wins over the host's session, no session gives a new id each Run, the hook leaves other providers alone, and the issue's numbers come out counted once. All five fail against 0.1.5.
2026-10-02 21:50:13 +08:00
XIQI 6f061c5c60 factory: support Claude Code on the Anthropic Messages route (#3)
* factory: adapt Claude Code Anthropic request bodies

* factory: address Anthropic compatibility review

* factory: handle additional directories and refresh 403 guidance
2026-10-02 21:36:33 +08:00
yetone cc57432d16 zcode: Start Plan requests go as ZCode's own, with its headers and system prompt (0.1.7) (#5)
ARNO on Discord: the plugin's Start Plan requests were answered 405 / 3012
"blocked due to unusual activity" while his own plugin (Freeflow, provider
zcode-start) worked from the same machine. zcode.z.ai serves the plan only
to what looks like ZCode's own request: a Start Plan request now carries
ZCode's headers and its body is dressed as ZCode's (three cached system
blocks, the environment section, the date reminder as the first turn, one
cache mark on the last block, metadata.user_id naming the sign-in's
device). The prompt texts are magpie's (901fd87e), each matching ARNO's
plugin's hash. Coding Plan and team requests are unchanged. The Start Plan
is advertised again.
2026-10-02 19:28:42 +08:00
yetone 8c7e31911e qoder: Qoder CN (qoder.cn) as a second provider, qoder-cn (#1) (#4)
Hosts, client id and paths read from Qoder CN's own CLI (@qodercn-ai/qoderclicn 1.1.65): sign-in on qoder.cn, accounts on openapi.qoder.com.cn, models and chat on gateway.qoder.com.cn, client id e883ade2-…; signing unchanged. The same as magpie's built-in Qoder CN. When qoder.cn refuses a job token the account chats on its device token, renewed through /api/v1/deviceToken/refresh, as the CN CLI does. cn.test.mjs (12 tests, a local server standing in for every host) covers sign-in, polling, both tokens' refresh, a chat, models, usage and qoder.com unchanged; 6 fail with the CN chat host pointed back at api3.qoder.sh or the fallback off. Version 0.2.0.
2026-10-02 18:30:00 +08:00
yetone dbc1c301df publish: always to registry.npmjs.org, whatever ~/.npmrc names — with npmmirror as the registry (common in China) the publish went there and was refused (ENEEDAUTH), and npm view checked the mirror for what is published 2026-10-02 16:58:50 +08:00
yetone 427947eadc factory 0.1.5: another agent's request to /api/llm/o opens as Droid's does, and a Factory API key can be added (yetone/magpie#506: factory-plugin/glm-5.3-flash answered 403 "Factory refused this account the request; check that droid…" on magpie v0.1.641) — the plugin had none of the built-in's fixes after 30 Sep. As the built-in's factoryDroidBody (e413dd84, magpie v0.1.630) has it, Responses' instructions, or chat completions' first system message (text parts joined with "\n"), open with droid 0.231.0's "You are Droid, an AI software engineering agent built by Factory." and "\n" before the agent's own; with none, the line alone goes first; droid's own requests and everything on /api/llm/a go on byte for byte, and a rewritten body drops the old Content-Length. The requests say droid 0.231.0, GLM-5.3-Flash takes images, and a 403 says what the built-in's factoryExplain says (5523eb17). A Factory API key (fk-…), droid's FACTORY_API_KEY, is an "api" sign-in method as factory_key.go (bb5e8a2b) keeps one: the bearer with droid's headers, never renewed, no X-Factory-Org-Id, not mended on a 403; whoami asked once with the key gives its region/host and whose it is, kept in the key's metadata. No request was made to Factory. droid.test.mjs (the built-in's TestFactoryOpensAsDroid cases, images, key requests and usage) fails against 0.1.4; bun test and scripts/check.mjs factory pass. 2026-10-02 16:33:14 +08:00
yetone bd5e91ee00 zcode: stop advertising ZCode's free Start Plan — zcode.z.ai serves it only to requests carrying the official ZCode client's system prompt and answers others HTTP 405 'request has been blocked due to unusual activity'; the plugin, like magpie, never rewrites prompts or poses as the official client, so the plan can't be used through it. registry.json's summary (en/zh), the root README's table, the package's description and its README now name the GLM Coding Plan and team seats only, and the package README says why the Start Plan isn't usable. Text only; no code or version change. 2026-10-01 23:11:00 +08:00
yetone 09053e36d3 devin 0.1.6: an assistant reply goes to Devin with every tool call it made (#416 on yetone/magpie: swe-2 always answered "capacity issues" on the plugin, never on the built-in) — build() let the pending list share the reply's own calls array, so answering a call took it off the reply too, and Devin got tool results with no call that asked for them from the first tool round on. pending is now a copy, as the built-in's buildDevin keeps it; with tool history the request decodes the same as the built-in's. request.test.mjs fails against 0.1.5. 2026-10-01 20:34:49 +08:00
yetone 7b70b40c7b zcode 0.1.6: ZCode's config out of reach, the plugin's table stands in marked Symbol.for("magpie.fellBack"), and magpie keeps the list it was told last, as the built-in keeps the one it fetched last. models.test.mjs (passes on Linux with no ZCode installed; with ZCode.app on macOS its own config is read, unmarked). 2026-10-01 17:06:07 +08:00
yetone ea1ab932ef commandcode 0.1.7: a list that can't be had says so — the Go table, or the defaults, handed back when Command Code's list fails is marked Symbol.for("magpie.fellBack"), and magpie keeps the list it was told last, as the built-in keeps the one it fetched last. models.test.mjs checks the mark on each failure and its absence on a list read. 2026-10-01 17:06:07 +08:00
yetone ce298d8ad9 grok 0.1.5: a token Grok refuses before its time says the sign-in has expired, as one past its time does — magpie's move takes such an account along untried; "Grok models: 401 …" stopped every Grok account's move. models.test.mjs fails against 0.1.4. 2026-10-01 12:37:59 +08:00
yetone 466d06ce55 zcode 0.1.5: the month's MCP tool calls are set aside as 'MCP · Month', as the built-in's quota did, not counted as a window — an older plan reports that uncapped month as 100% used, which read the account as out of quota and skipped it; a limit whose whole is 0 is set aside too. The new test in usage.test.mjs fails against 0.1.4. 2026-10-01 07:04:59 +08:00
yetone e44077a705 grok 0.1.4: grok-4.7 keeps its low/medium/high/xhigh reasoning levels when Grok's model list can't be read, as the built-in offered them — the default list carries the variants. models.test.mjs fails against 0.1.3. 2026-10-01 07:04:58 +08:00
yetone 083251d778 qoder 0.1.4: a job token refresh Qoder refuses while listing the models marks the account, as the built-in's model read through QoderCredentialOf did — the models hook throws with signIn: expired on a 401/403 refresh and falls back to the listed models on any other failure; a renewal made while listing is said renewed by the account's next usage read or answer, and the refresh errors read 'qoder job token refresh' as the built-in's did. Four new tests in usage.test.mjs fail against 0.1.3. 2026-10-01 06:53:59 +08:00
yetone 7b072d798b zed 0.1.6: a model token Zed refuses while listing the models marks the account, as the built-in's zedLapse did there — the models hook throws with signIn: expired on the refusal (magpie 78c3229 reads it), and falls back to the listed models on any other failure as before. models.test.mjs fails without the change. 2026-10-01 06:34:07 +08:00
yetone 36f88f242c commandcode 0.1.6: a Go account lists the models Command Code has for Go, not ten, as the built-in's cmdGoFetch does (magpie b00387f) — the Provider API's /models asked without the key, less the 30 models Go is refused (cmdGoRefused), decorated from the CLI's 57-model table (1.73.0), which stands in when the list can't be had; models.test.mjs fails without the change. 2026-10-01 06:24:20 +08:00
yetone 01aee5da28 all: a usage read says what it means for the sign-in, and a renewal clears the mark whatever follows, as the built-ins did (要保证插件跟内置的所有逻辑都要一模一样) — auth.usage returns signIn on every path: expired where the built-in's quota read marked the account (Zed's /users/me 401, Factory's and MiMo's refused renewals, Qoder's refused job refresh), renewed after a renewal, which took the mark off, kept everywhere else, so magpie no longer guesses from the words 'sign in again' (Kiro's, Devin's and ZCode's usage errors marked accounts their built-ins never did) nor clears on a clean read. A request after a renewal says renewed on any status; one without says kept, as the built-ins cleared only on renewal. Kiro, Cursor, Devin, Command Code, WorkBuddy, Grok and ZCode, whose built-ins never marked an account, say kept on every answer. New tests fail against 85d7dd0's index.mjs. 2026-10-01 04:53:29 +08:00
yetone 85d7dd0d0a all: each plugin fails with its built-in's status and marks the sign-in as it did, through X-Magpie-Sign-In (要保证插件跟内置的所有逻辑都要一模一样) — Factory's and MiMo's refused renewals are the built-ins' 502 marked expired, not 401s; Qoder's vendor 403 is the built-in's 401 kept, its model list's failure a 400, its job refresh refused marked expired; Zed's retried 401 is a 401 kept, not a 403; Kiro's unreachable refresh a 401 kept; Cursor's expired trial a 401 kept; a vendor 401 WorkBuddy, Grok, Devin, Command Code and ZCode passed on no longer marks the account, as their built-ins never did, and Grok and MiMo no longer retry what their built-ins sent once. Messages take the built-ins' words. New tests fail against the previous index.mjs. 2026-10-01 04:47:03 +08:00
yetone 53e0db6648 zed 0.1.4: a streamed reply is held until it says something, as the built-in's relayStatus holds it, and a failure before that is answered with its status rather than a 200 carrying it — Zed's failed status keeps the status its code names (upstream_http_401 a 401, http_403 a 403, billing a 402, where magpie read the old stream's chat and Responses errors as 502s), the provider's own error event is a 502 with its message, a reply ended with nothing said is a 502 "Zed ended without an answer" and one cut short a 502; a whole reply carrying the provider's error is that error (it was a 200 with nothing in it), and a code outside 400–599 is a 502. errors.test.mjs fails without the change. 2026-10-01 03:45:58 +08:00
yetone 8efe85163c kiro 0.1.4: an exception Kiro sends before any of the answer (a throttle, a quota, a server error) is a status, not a 200 stream holding an error event, as the built-in's relay answers it: a 429 when it reads as a quota or rate limit (magpie's quotaWords), else a 502, so magpie moves on to the next account exactly as it did; unstreamed, what was said before a later exception is the answer, as the built-in's collector gives it, where the plugin answered 502. errors.test.mjs fails without the change. 2026-10-01 03:45:12 +08:00
yetone f62d7d1057 commandcode 0.1.4: a Go account's failure reads as the built-in's cmdFailure says it — an empty reply is its status's name as Go's http.StatusText gives it (an empty 429 "Too Many Requests", which magpie's quotaWords know), where it was "HTTP 429"; credits run out are said as "out of credits: …" unless the message is already in quotaWords' words ("Monthly limit hit" is not, "余额不足" is), where a looser test of its own kept "limit" and prefixed Chinese; an error object without a message is its JSON. errors.test.mjs fails without the change. 2026-10-01 03:44:06 +08:00
yetone e39f4f4dc0 devin 0.1.4: errors no longer start with "Devin: ", which magpie adds (it read "Devin: Devin: usage limit reached: …"), a stream error before anything included; an error Devin gives no words for is worded as Go's status text ("Payment Required") as the built-in's devinFailure does, where it read "HTTP 402"; an empty reply is the built-in's 502 "the reply broke off: EOF". Statuses were already the built-in's (unauthenticated 401, resource_exhausted/quota/rate limit 429, too long 400, invalid_argument 400, unavailable 503); errors.test.mjs checks them 2026-10-01 03:43:41 +08:00
yetone 3d94a667f6 cursor 0.1.4: an error Cursor gives no words for is worded as magpie's built-in words it, Go's status text ("Payment Required", "Too Many Requests", "Unauthorized — sign in to Cursor again"), where it read "HTTP 402": a 402 now reads as the credit refusal it is to magpie's routing, as the built-in's did. Statuses were already the built-in's (resource_exhausted/quota/rate limit/usage limit 429 "usage limit reached: …", too long 400, invalid_argument 400, unavailable 503, permission_denied 403, other codes 502, pre-content stream errors answered with their status); errors.test.mjs checks them all 2026-10-01 03:43:39 +08:00
yetone 6ba28f67ae registry: list magpie's community's plugins alone — the OpenCode community's weren't written against magpie's sign-ins and fell short of them; they stay a search away in magpie 2026-10-01 03:26:40 +08:00
yetone 23a580b6aa factory 0.1.3: a refusal says what to do after an em dash ("<Factory's message> — Factory refused this account…"), as the built-in's Provider.Explain joins them, where it used ": "; an empty 403 reads "403 Forbidden", the status Go falls back to 2026-10-01 03:21:02 +08:00
yetone b9404c8f68 commandcode 0.1.3: on every plan but Go a model the Provider API serves on Responses and not chat completions is asked on Responses (@ai-sdk/openai at /provider/v1), the first of its APIs in magpie's order (chat, Responses, Messages) as the built-in picks it, where it was asked on chat completions and refused; errors no longer start with "Command Code: ", which magpie adds 2026-10-01 03:19:57 +08:00
yetone 96b3ad276b kiro 0.1.3: only a sign-in that is gone (a refresh Kiro refused, no refresh token, no sign-in, a refused API key) answers a request with the 401 magpie marks the account lapsed on; a refresh that timed out, failed to connect or met a 5xx is a 502; errors no longer start with "Kiro: ", which magpie adds 2026-10-01 03:17:51 +08:00
yetone eab92c33a0 qoder 0.1.2: a chat Qoder refuses with a 403 stays a 403, only its 401 (the job token refused) is the 401 magpie marks the account lapsed on; a model the listing marks free (is_free, or a price_factor of 0, snake or camel case, as internal/qoder/models.go reads it) is marked free; errors no longer start with "Qoder: ", which magpie adds 2026-10-01 03:16:04 +08:00
yetone aac52c9ce4 mimo 0.1.4: a chat body handed over as bytes is read, so mimo-auto is still asked as mimo-pro; a sign-in Xiaomi no longer takes answers the request with a 401 in the built-in's words (<user>: the Xiaomi MiMo sign-in has expired — sign in again) instead of a thrown fetch 2026-10-01 03:13:34 +08:00
yetone 3d3f3b7bf1 zed 0.1.3: an account reply that can't be read is the card's error, as zed.FetchMe says it (Zed: an unreadable account: <encoding/json's words>), not a plan-less card; a free account reads Free, as the built-in's row names it (zed.PlanName); a model token refused right after it was minted is a 403, not a 401 magpie would take for a lapsed sign-in; errors no longer start with "Zed: ", which magpie adds; a model Zed gives no limits has none made up (was 200000/32000) 2026-10-01 03:12:11 +08:00
yetone 0c7275a140 grok 0.1.2: a usage fetch that fails or a reply that isn't JSON is the card's error, as grok_usage.go says it (Go's Get "<url>": … with no such host / connection refused / timeout / EOF for magpie's keepLast, encoding/json's words); a status Go has no words for says "HTTP <n>"; a model list Grok couldn't give fails instead of falling back to the configured few; a request body handed over as bytes is reshaped as a string one 2026-10-01 03:07:40 +08:00
yetone 0b425bee69 workbuddy 0.1.4: every refused meter status is an error with words, Go's http.StatusText in full (a 409 was an empty error), "HTTP <n>" for one Go has none for; a refusal in WorkBuddy's own {code, msg} reads its msg before the hint, as wbExplain's; a chat body handed over as bytes is read, so it still gets WorkBuddy's system message 2026-10-01 03:05:22 +08:00
yetone d8739bcdbc devin 0.1.3: the card's quota windows are "1 day" and "7 days", shown only when Devin says what is left of them (one left out is no longer taken for used up); usage no longer overwrites the row's plan ("Devin Pro", as devin auth status names it) with planName's bare "Pro"; a refused key says "Devin's sign-in has expired — sign in again"; the efforts none and minimal go as given; a variant the user picked stays, as magpie's devinCollapse keeps it; only a model models.dev says takes images gets image input 2026-10-01 03:03:01 +08:00
yetone b70f871d97 zcode 0.1.3: every card starts from the saved plan, as magpie's built-in's did — a reply with no level, a team detail that failed or an error no longer drops it; a model ZCode's config gives no context or output keeps 0, as the built-in, instead of a made-up 200K/131072 2026-10-01 02:56:05 +08:00
yetone befd071701 cursor 0.1.3: the card names the plan as cursor-agent about does (GetPlanInfo's planName, kept an hour); only a token or session run out is a 401, as magpie marks the account lapsed on one; errors no longer start with "Cursor: ", which magpie adds; a model list Cursor couldn't give fails instead of shrinking to the configured few 2026-10-01 02:52:43 +08:00
yetone fb82ecd4d2 mimo 0.1.3 2026-10-01 02:45:37 +08:00
yetone d28f9dfa09 mimo 0.1.3: two accounts signing on at once each keep their own session — one renewal was shared by every account, so an account could get another's session and show its plan and allowance 2026-10-01 02:45:10 +08:00