Files
magpie/internal
yetone 08168fdb0b provider: a ClinePass API key card whose limits fail to read says so beside its credits, instead of looking like no ClinePass (magpie-community/plugins#79, AkaChou)
clineKeyUsage dropped every usage-limits failure once the balance was
read: only a 404 means the account has no ClinePass (as AxonHub's Cline
checker reads it), but a 401, 403, 429, 5xx or timeout also left the
card with its credits alone and nothing said. It now returns the balance
with the error "ClinePass limits couldn't be read: <Cline's answer>"
(clineLimitsUnread, the words the Cline plugin uses), and KeyBalances
keeps that balance on the card beside the error. A transient failure
(5xx, 429, timeout) still shows the last good reading through keepLast.
The other half of #79 (windows dropped when the balance fails) was
already right here: the limits read are returned without the balance;
the test now covers it.

TestClineKeyUsage gains keys whose limits answer 503 and 403 (balance
kept, error says why) and one whose balance answers 502 (three windows
kept, no error), with the real {success, data: {limits: [...]}} shape
and 404 for no ClinePass. Without the change it fails: "a key whose
limits fail with 503: {... Balance:$12.00 ... Error: ...}". gofmt -l
clean; go vet, GOOS=linux and GOOS=windows go vet -tags nogui
./internal/provider pass; go test -tags nogui ./internal/provider passes
under a temp HOME. Not tried with a real Cline key (none at hand).
2026-10-10 21:49:14 +08:00
..
…
…