Files
t3code/packages/contracts
Theo BrowneandClaude Fable 5 d95c7667e4 feat(usage): account rate limits on the usage page and sidebar hover
Both provider adapters already emitted account.rate-limits.updated events,
but the payload was typed unknown and nothing consumed them. This adds an
AccountLimitsService that caches one normalized snapshot per provider, fed
passively from those events, seeded for Codex from the rate_limits objects
its transcripts already carry, and persisted across restarts (Claude limits
never hit disk). The Claude adapter now also pulls the full window set (5h,
weekly, Fable) through the SDK usage control request, throttled, since the
streamed event only names the binding window.

Exposed via server.getAccountLimits and rendered as a Limits strip on the
usage page plus a hover card on the sidebar Usage button. Windows render
dynamically, so Codex's paused 5-hour window reappears on its own when the
API ships it again. Spark and the opus/sonnet scoped weeklies are hidden.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-08 19:11:30 -07:00
..
2026-08-07 11:50:54 +00:00