Commit Graph
11 Commits
Author SHA1 Message Date
yetone 39d9cffe7d qoder 0.2.3: magpie renews the sign-in ahead of time through auth.refresh
auth.refresh with refreshLead 10 minutes (in-fetch: 5) for qoder and
qoder-cn: the job token through refreshJob, or a qoder-cn device-token chat
through refreshDevice (both pairs given). Under the request path's lock; a
spent map lets a request holding the old pair use the new one. 401/403 is
signIn "expired" as on the request path; anything else is retried.

The check before each request stays for OpenCode, which doesn't call the
hook (magpie 0.1.684+ does). refresh.test.mjs fails without the change;
HOME=$(mktemp -d) bun test passes (396 across the repo).
2026-10-03 12:07:23 +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
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 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 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 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 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 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 4dd783a2c0 qoder 0.1.1: usage shows as magpie's built-in did — plan, period, windows and what they count, balanceqoder 2026-09-30 23:03:10 +08:00
yetone c5af8f5dec qoder: Qoder — device sign-in, one-use refresh tokens saved at once, COSY-signed chat generation; tried with a real request 2026-09-30 17:08:36 +08:00