POST /v1/magpie/quotas/refresh with no card named ran ReadAllCards,
which only cleared the caches (AskUsage). A saved, inactive Claude
account's /usage was never run again, so another magpie's refresh of
this one, or an app with a gateway key, kept showing its old numbers.
#5380 (814a625a2) fixed the GUI and the TUI and missed this route.
- ReadAllCards asks AskEveryClaudeUsage, as the Usage page's Refresh
does. The 30s per-account floor and the running holds are unchanged;
saved accounts are read side by side by fetchSubscriptionUsage, each
bounded by its 20s wait, inside the handler's 30s.
- A key told only some cards had them read one after another, each
waiting up to 20s, so a few cards outlasted the 30s handler.
RefreshEach reads them side by side.
- Another magpie's refresh of its remote card waited 8s for the POST
(remoteBody's GET wait) and fetched the old cards while the remote was
still reading. The refresh POST now waits remoteRefreshWait (25s);
kept-card and history GETs keep 8s.
Other routes checked: the GUI's asked=1&all=1 and the TUI's r already
read every account. The CLI has no whole-page refresh: `magpie quota`
and `accounts` open with AskClaudeUsage by design, `quota refresh
<provider>` reads per card, `quota wait` waits, `accounts refresh`
renews logins. Unchanged.
Run at this head (rebased on b4799a6bb), on mote through mote-run:
go vet, go test -count=1 ./internal/provider: ok (148.3s)
Run at f86dd7910 (b4799a6bb since touched quota history in provider only):
go test -count=1 ./internal/provider: ok (131.9s)
go test -count=1 -run 'Quota|Remote|LAN|Lan|Cors|ReadOnly|Readonly|Held|Antigravity|Draw'
./internal/gateway: ok (36.3s)
go vet of internal/provider and internal/gateway: clean.
GOOS=linux and GOOS=windows go vet of both, at d2c29abe7: clean.
gofmt -l: clean.
Broken by hand, each red, then restored:
ReadAllCards back to AskUsage: TestReadAllCardsReadsSavedClaude fails
(ran the saved account's /usage 0 times, want once more).
The refresh POST back on the 8s wait (remoteWait):
TestRemoteMagpieRefreshWaitedFor fails (old Used 0).
RefreshEach made serial: TestRefreshEachReadsSideBySide fails (alone).
Not tried: the reporter's case end to end with a built magpie in a
sandbox HOME (a fake claude binary behind a real gateway); a real Claude
account; Windows and Linux runs (vetted for both). The full suite runs
after the push, under mote's suite lock.
Reported-by: prgrmrwy