qoder: the plugin's min is 0.2.46, so used-up credits leave the free models served (coeo91 on Discord)

coeo91: Qoder (and WorkBuddy) still serve free models once the paid
credits run out, but magpie treated such an account as spent for every
model. Qoder's docs say it: "When Credits run out, you can continue using
free basic models, subject to daily and monthly limits"
(docs.qoder.com/Credits; zh: "Credits 用尽后,仍可使用免费基础模型").

The cause was the plugin's usage: every credit window ("Total credits",
"Credits", "Add-on credits", and since 0.2.45 a free account's "0 credits
left") counted every model, so a window at 100% put the account last or
out for qfmodel / dfmodel too. The refusal side was already per model
(PaidBesideFree, 974aaf7e2). Plugins b7bbc9d (record in 1f015f1; the code
went out under a stale subject) makes each credit window name the free
models it doesn't count (notModels: the account's own listing, price_factor
0 and not a promotion's), as WorkBuddy's has since 0.1.23. magpie's
quotaOfPlugin already scopes a window by notModels. npm view --prefer-online
shows @magpie-community/opencode-qoder-auth 0.2.46.

WorkBuddy needs nothing: its usage already leaves free models out
(0.1.23, plugins#138), and its free-only switch (#430) shipped in 0.1.38.

Run at this tree on mote: gofmt -l clean; go vet ./internal/provider/ for
darwin, GOOS=linux and GOOS=windows ok; go test -timeout 45m
./internal/provider/ ok (91s). Plugin: HOME=$(mktemp -d) bun test in
packages/qoder ok, with spare-free.test.mjs (free account, spent plan +
add-on, unreadable listing, no free model, listing not asked twice).
Not broken by hand: no test reads the min itself; keepMovedCurrent updates
moved users to it.

Not tried: a real Qoder account with its credits used up (the owner's has
add-on credits left). Not changed: a free model's own daily or monthly
limit refusal still rests the whole account, as before; nothing from Qoder
says which codes that limit answers with.
This commit is contained in:
yetone
2026-10-28 19:29:39 +08:00
parent 053d0d37f8
commit 51e3169fb7
File diff suppressed because one or more lines are too long