mirror of
https://github.com/getpaseo/paseo.git
synced 2026-07-29 12:01:31 +00:00
The Claude usage card showed only Session and Weekly. Anthropic moved model-scoped weekly limits out of the top-level `seven_day_<model>` keys into a `limits[]` array, and `seven_day_opus` / `seven_day_omelette` now return null, so the scoped bar silently disappeared. Nothing errored, so the card looked healthy while under-reporting. Scoped limits are now read from `limits[]`, restoring a `Weekly · Fable` bar. Session and all-models weekly keep coming from the top-level keys, which is also where the Claude CLI reads them from. A response mid-migration can describe one limit twice, as a legacy key and as a `limits[]` entry, so both shapes normalize into a single `ScopedLimit` and one predicate decides whether two are the same limit: same dimension, same id when both carry one, else same normalized name. That is the only comparison in the file. Comparing display labels would conflate a surface with a model of the same name, and collapse ids that differ only by punctuation. The `limits[]` entry supplies identity, since that is the shape the API is migrating towards. Its `percent` and `resets_at` are nullable, so each field falls back to the legacy twin rather than discarding a value the response did carry. Legacy scoped windows adopt the same id scheme, so `weekly_opus` becomes `weekly_model_opus`. Window ids are internal React keys, not user-facing, and unifying them is what lets a limit keep one id whichever shape of the response carried it. Two supporting changes: - `limits[]` entries are validated one at a time. The response goes through a single parse, so one malformed entry would otherwise throw and take the windows that already parsed with it. - The provider stores the logger it was already handed and warns when a response parses but yields no windows, when a scope resolves to no name, and when an entry is unparseable. This failure was silent at every level, which is why it went unnoticed. Warn rather than debug, because file logging defaults to info. Scoped windows render even at 0% and inactive, so a bar does not appear and disappear between refreshes. Closes #2302 Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>