qoder 0.2.46: b7bbc9d's record (it went out under a stale 0.2.43 subject)

b7bbc9d is "qoder 0.2.46: credits used up leave the free models counted
out, so magpie still routes them"; its message was a stale file from an
earlier commit (a noclobber write that failed). No code changes here.

coeo91 on Discord: a Qoder account whose credits are spent still serves
its free models, but magpie treated it as spent for every model. Qoder's
own docs say so: "When Credits run out, you can continue using free basic
models, subject to daily and monthly limits" (docs.qoder.com/Credits; the
zh page: "Credits 用尽后,仍可使用免费基础模型"). The usage hook's credit
windows counted every model, so a plan used up, or a free account's
"0 credits left" (0.2.45), read 100% for Qwen3.8-Flash and DeepSeek-Flash
too, and magpie's routing put the account last or skipped it for them.

Each credit window from the usage hook (Qoder and Qoder CN, device and PAT
paths) now names the account's free models in notModels, as WorkBuddy's
does since 0.1.23 (plugins#138). magpie's plugin_usage.go reads notModels
into the window's model scope, so Allowance.For/Full/Pooled skip it for
those models. Free is the listing's own (freeOf: 0x, not a promotion's 0
for a while); the listing is the cached one the models hook read, asked
once when none is cached. A listing that can't be read, or that lists no
free model, leaves every model counted, as before. QwenWork (its own usage
path) is unchanged: nothing from it says its free models outlast the
credits.

Run: HOME=$(mktemp -d) bun test in packages/qoder on mote (309 pass);
bun scripts/check.mjs qoder (ok).
Broken by hand: spareFree returning at once, spare-free.test.mjs 6 of 10
red (the four left are the as-before cases).
Not tried: a real account with its credits used up (the owner's has
add-on credits left); the fixtures are Qoder's envelope and listing shapes
from the existing tests.
This commit is contained in:
yetone
2026-10-28 19:17:18 +08:00
parent b7bbc9dc06
commit 1f015f1b1e

Diff Content Not Available