QuotaWindow
How far through a provider's rate-limit window we are, as facts.
In the namespace octomy::opal::ui. Declared in src/libs/libopal/opal/ui/QuotaWindow.hpp.
Detailed description
Why this is not inside OpalStatusLine
It used to be. Three things made it untestable there, and all three are properties of the placement rather than of the arithmetic:
- The only way in was a live `ClaudeCodeClient`, whose `mLimitInfo` is private and is filled by parsing a provider's `rate_limit_event`. There is no seam, so the rows it serves could be checked only against a real subscription.
- It read the clock itself, so even with a seam two runs could disagree.
nowSecsis a parameter here for that reason. - It is pure arithmetic over three numbers, and pure arithmetic in a paint-adjacent method is arithmetic nobody can put a number to.
Quota used, with the clock beside it
fromRateLimits() is what the bar draws: the share of a window's quota USED, the figure Claude Code's own statusline shows. Until 2026-10-03 the bar drew fromRateLimit()'s wall-clock progress instead, because the event then carried no usage; the owner read OPAL's 61% (61% of the week gone) beside the statusline's 92% (92% of the week's quota used). Claude Code 2.1.286 reports `utilization` for both windows, so the bar shows that, and the clock is the pace figure in the tooltip, as the statusline's pace needle is.
See also OpalStatusLine.