jzing.draw on Discord (#feedback, 2026-11-03): Qoder's 我的用量 said
套餐内 Credits 1,817 / 2,000 (剩余 183, refreshing 2026-11-22) and
资源包 2,400 / 3,400 (剩余 1,000). magpie's Routing row said a bare
"剩余 15%", which matched neither pool, so it read as the two not added up.
They were added up already (Total credits since 0.2.44, #454), but every
window sent only a share and a display string. The Routing row shows a
count only for a window with limit > 0, so it had no way to say which
figure it was. Now:
- every pool window and Total credits carry amount, limit and unit, so
magpie says "1,183 / 5,400 credits · 22% left" on the Routing row and
the Usage card, which is Qoder's 183 + 1,000.
- the plan's Credits window carries resetsAt = expiresAt, Qoder's
"将于 … 刷新" date (renewsOn in Qoder 0.4.3's buildUsageItemGroups).
Routing still counts the pools together and sets each pool aside; that
didn't change.
Run (mote, bun 1.4.2): bun test packages/qoder: 382 pass, 0 fail.
Broken by hand: with amount/limit/unit and resetsAt dropped from the
pool windows, the new test ("the plan and the resource pack read as
Qoder's own panel does…") fails.
Not tried: no real Qoder account. The fixture is built from the
reporter's screenshot numbers. The reporter's "15%" (85% used) isn't
reproduced from those numbers: the two pools together leave 22%. It may
be a reading taken later than the screenshot, or a dedicated resource
package Qoder's panel didn't show (the plugin counts those). Without
their reading this can't be told apart.
A Qoder CN / QwenWork phone account's card shows its masked phone
(phoneLabel / cardName, usage's `user`), a real email first, instead of its
uuid; accountId stays exactly what main computes. A renewal reads the name
outside the plugin-wide lock from the account's own site (a VPC token never
goes to the public hosts) and renames nothing. Rebased on a06512e, keeping
3c279f6's listing-renew change.
Reviewed at 6e39e8c (round 5). Run on mote (macOS, Bun 1.4.2) in a sandbox
HOME, at that head:
- bun test packages/qoder: 335 pass / 0 fail (listing-renew.test.mjs 5/0)
- bun scripts/check.mjs qoder: ok
Broken by hand: the device sign-in's cardName `realEmailOf(email) || label`
-> `label` (index.mjs:411) turns "qoder-cn: a device sign-in with an email
and a phone shows the email" red (334/1). Earlier rounds' breaks (renewal
cardName, own site, usage `who`) were red too.
CI (test, on-npm) green at 6e39e8c. Version 0.2.49 -> 0.2.50.
Not tried: a real Qoder CN or QwenWork phone account.
ahang39 (plugins#474): international Qoder answered dfmodel with 403
"Login expired" in bursts of ~16 requests over 2-5 minutes, about every
24h, shown by magpie as 401 "the sign-in lapsed". The report's times put
the burst's start where magpie's renewal came due (saved end less the
10-minute lead) and its end where the renewed pair was saved: Qoder
refused a job token the plugin still had as minutes from its end, and
nothing asked again with a renewed one. Why Qoder ended it early isn't
proven from the report.
- A chat's 401/403 now marks the failure lapsed. ask re-reads the saved
sign-in under the refresh lock: a pair renewed meanwhile (another
request, magpie's auth.refresh, another process) is used with no
refresh; else the refresh token is spent once, the pair saved, and the
request sent once more. A burst shares one refresh. A token this
process renewed under 5 minutes ago that is refused too isn't renewed
again, so a refusal not about the token's end doesn't churn refresh
tokens; the 401 is said as before.
- A refreshed job token's end is read as an exchanged PAT's was:
expire_time / expires_at (a date, or an epoch in s or ms) first, then
expires_in, then a day. An end already past is ignored.
Run (mote, mote-run, HOME=$(mktemp -d), --timeout 60000; mote at load
20-28):
- packages/qoder: 320 pass, 0 fail.
- whole repo: 3129 pass, 1 fail: commandcode "a plan saved stands in
for a subscription slow to read" (16.8s against its 3s bar), passes
alone 13/13, filed as #475.
- bun scripts/check.mjs: ok.
- lapsed.test.mjs on the old index.mjs: 8 of 9 red. The 9th (magpie's
own renewal begun during the refusal) was rewritten after that run and
not run against the old code again.
Not tried: a real international Qoder account at the moment its token
is refused; the fake Qoder (refusal body {"message":"Login expired"},
single-use refresh tokens) is built from the report's words only.
Ariel on Discord: an international free Qoder account signed in fine but
showed no credits. A free account (userType personal_standard, Qoder's
"Experience" plan) has a plan pool of 0 and, until it gets add-on credits,
nothing else. parseUsage drops every pool whose total is 0, so such an
account came out with no window at all and magpie had nothing to show.
Qoder's own client (Qoder.app's buildUsageItemGroups) shows every pool
present, 0/0 included, and counts the account out of credits when what the
pools have left adds up to 0. Now, when no pool gives a window and the plan,
add-on or shared pool reads a total of 0, the account has one "Credits"
window, "0 credits left", used up. A pool that can't be read (a string
total) or no pools at all still say nothing. An account with credits in any
pool is shown as before (the owner's free account: plan 0, add-on 7 / 600,
one Add-on window, unchanged). Same parser for qoder-cn.
Run: HOME=$(mktemp -d) bun test in packages/qoder on mote (299 pass) and
bun scripts/check.mjs qoder (ok).
Broken by hand: the new test against origin/main's index.mjs, red (it reads
no windows).
Read-only real read of the owner's intl account's /sash/api/v2/me/usage
for the envelope's shape (personal_standard, usageType credits, plan 0/0).
Not tried: Ariel's own account; the fixture is the owner's free envelope
with the add-on pool at 0 or absent, since the owner's has add-on credits.
chansee97's Qoder CN trial had its plan's 300 credits spent and 245 of
1,100 add-on credits used, and Routing read the account as 0% left: each
pool was a window of its own, and routing counts the tightest. Qoder spends
the pools one after another before an account stops (docs.qoder.com/Credits:
soonest to expire first, the plan's before add-on on the same day; teams:
then the organisation's shared add-on credits), and its own envelope's
totalUsagePercentage counts them as one. So when more than one of the plan,
add-on and shared pools holds credits in the same unit, "Total credits" is
what they hold together (545 / 1400 here, 61% left) and the one routing
counts, and each pool is shown beside it set aside, as CodeArts' buckets
are under its total. One pool alone is shown as before. Dedicated packages
are left as they were (no word from Qoder on their order).
Run: bun test in packages/qoder (298 pass) and scripts/check.mjs, on mote.
Broken by hand: the new tests against origin/main's index.mjs, red (#454's
reads 0% left; the rotated-token test's windows differ).
Read-only real read of the owner's Qoder account's /sash/api/v2/me/usage:
plan total 0, add-on 7 / 600, which stays one window, unchanged.
Not tried: a real account with both a plan and add-on credits (the owner's
has no plan credits); the fields are the ones that read returns.
SlouchyQuill507 (Discord, qoder-cn) reported Qoder failures of the model's
own vendor, "Error in upstream response", reaching magpie as a 400 invalid
request: the client's fault, never asked again or of another account.
failure() now maps a message saying "Error in upstream response" to a 502
(no X-Magpie-Sign-In, the account untouched), after the queue, quota and
request codes, so a 400 with one of Qoder's request codes (406, 416, ...)
and any other 400 stay 400. It covers an HTTP 400 and a 400 in the
stream's statusCodeValue envelope, JSON or plain text. magpie still tells
an overflow that fails this way apart by its size (tooLongUnsaid takes 502
as well as 400).
Test: usage.test.mjs "Qoder's 400 \"Error in upstream response\" is a
502" - fixtures from the reported literal text, four shapes through the
loader's fetch, plus genuine 400s kept. Red on the old index.mjs (400 for
each), green with the change.
Run on origin/main 6fd976a: TMPDIR=<scratch> HOME=<scratch>/home bun test
(whole repo) 1919 pass 0 fail across 173 files; bun scripts/check.mjs ok.
A failed read of Qoder's model list during a chat (DNS, timeout, an HTTP
refusal) now answers 502 instead of 400, so magpie retries and falls back to
the next member of a group instead of ending the request. A lapsed sign-in
met on that read answers 401 with the sign-in mark, as the chat path does.
Run at the reviewed head fcdf173e1 (on origin/main ff13aac):
- bun test packages/qoder: 139 pass, 0 fail
- bun scripts/check.mjs qoder: ok
- with index.mjs put back to main, the two changed tests go red (2 fail)
- magpie's passing() retries 502 and falls back (internal/gateway/fallback.go);
no magpie parity test pins the old 400
Yayoi_no_yume on X: a request made right after signing in came back
"Qoder: the sign-in lapsed — sign in again" (401), and only installing and
signing in to Qoder CLI made it work. failure() replaced whatever Qoder said
with that fixed text, so the real reason for the refusal could not be seen.
The message is the same, with "(Qoder said <status>: <its message>)" added
when Qoder gave one; the account is still left unmarked (X-Magpie-Sign-In:
kept), as before.
usage.test.mjs gains the case (a 401 whose body says why); it fails on
0.2.11 and passes. bun test (89 pass) and scripts/check.mjs qoder under a
scratch HOME pass. Not tried against Qoder itself (no Qoder account here),
so the cause of the reporter's 401 is not known yet.
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.
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.