Files
magpie/docs
yetone 980a4b981f provider: an answer naming only five_hour keeps the week kept on disk (ifccod7391564 on X)
On a cold start nothing of a Claude account was in claudeUsage, so the
first rate_limit_event, which often names five_hour alone, became the
account's whole reading: withHeardClaude laid that one window over the
card read from quotas.json, and the 7-day ring, not renewed yet, was gone.
NoteClaudeLimits now merges what an answer tells into what is kept, and
with nothing in memory into the windows quotas.json kept that haven't
renewed since (keptClaudeWindows). A renewed week isn't brought back.
quotas.json is read before claudeUsage is held: lastQuotas has its own lock.

Run (wsl-run, magpie-desktop; mote refused SSH the whole time):
- go test -count=1 -timeout 45m ./internal/provider ./internal/agent:
  provider ok; agent ok but TestGrokInstalled, the known WSL2 binfmt
  red (#3548), unrelated
- TestNoteClaudeLimitsKeepsTheWeekOnDisk on Windows (win-run): ok
- GOOS=linux go vet -tags nogui ./internal/..., GOOS=windows and
  GOOS=darwin (nogui) go vet of agent/provider/gateway: ok; gofmt -l clean
Broken by hand: NoteClaudeLimits ignoring the disk (kept = onDisk[:0]):
the new test is red with the card holding only "5 hours", as reported.
Not tried: a real cold start against a real account's rate_limit_event;
the macOS run (mote down).
2026-11-10 18:21:32 +08:00
..