Skip to content

menubar: quota windows show no pace — add run-out projection (deficit, lasts-to-reset / runs-out-in) #726

Closed

Description

@avs-io

Problem

The Plan tab shows each quota window's used% and reset time, but not the one thing the user actually wants to decide: am I going to make it to the reset? "Weekly window 68% · resets in 5 days" forces the user to do the pace math themselves, every time they look.

Proposal — phase 1, linear pace (no new data required)

Everything needed is already in each window: usedPercent, resetsAt, limitWindowSeconds.

  • elapsed = duration − (resetsAt − now); expected% = elapsed/duration × 100
  • Deficit/reserve: Δ = used% − expected%, rendered as "N% in deficit" / "N% in reserve" / "on pace" (staged at |Δ| ≤ 2 / ≤ 6 / ≤ 12 so the wording is legible, not twitchy).
  • Run-out ETA: whole-window linear rate used%/elapsed; eta = (100 − used%)/rate. If eta ≥ time-to-reset → "lasts until reset"; else → "runs out in ~X".
  • Noise guards (these matter more than the math): show nothing until expected% ≥ 3 (kills early-window nonsense projections), skip when elapsed ≤ 0 (reset-time skew) or the window is already exhausted, clamp everything to sane ranges.
  • Rendering: the plumbing already exists — UtilizationRow accepts a projection and ProjectionCaption renders it; the Codex Plan rows currently pass projection: nil. Phase 1 is largely "compute a WindowProjection for Codex windows and stop passing nil", keeping the caption explicitly estimate-flavored.

Phase 2 — historical forecast (separate follow-up, only if wanted)

The menubar already persists per-window usage snapshots (SubscriptionSnapshotStore). With ≥3 complete past windows, a nonparametric forecast becomes possible: reconstruct each completed window as a monotone cumulative curve, shift each curve vertically through the current (elapsed, used) point, and read off (a) the recency-weighted median crossing of 100% as the ETA and (b) the smoothed weighted fraction of curves that end ≥ 100% as an explicit run-out risk percentage. With thin history it blends toward the phase-1 linear baseline — and is capped so expected usage never exceeds the linear baseline, meaning a habitual heavy user is never flattered with "in reserve". Filing the design detail here so the scope is visible, but phase 1 stands alone and ships first.

Tests

Pace math as pure functions with injected now: deficit staging boundaries, both ETA branches, each guard (early window, zero/negative elapsed, exhausted, reset in past). Phase 2, if it proceeds, gets fixture-snapshot curve tests.

Question for the maintainer: happy with phase 1 alone as the first PR, or would you rather see both phases designed together before any code?

Activity

  1. added
    enhancement
    on Jul 17, 2026
  2. iamtoruk commented on Jul 17, 2026

    @iamtoruk
    Member

    This is Part 2 (burn-rate forecast) of the quota-intelligence epic #725 filed yesterday, and it is well scoped. Verified the grounding against main: WindowProjection, UtilizationRow's projection parameter, and ProjectionCaption all exist and the Claude windows already render projections, so phase 1 really is compute-for-Codex-and-stop-passing-nil. SubscriptionSnapshotStore exists for phase 2.

    Green light on phase 1 as specified. The noise guards (nothing until expected% >= 3, skip on reset skew, staged wording) are the important part and you have them.

    Two notes:

    1. Consider suppressing the run-out ETA on the 5-hour window specifically and showing only deficit/reserve there. Linear extrapolation is at its noisiest on a short bursty window: one heavy burst reads as runs out in ~40min, then recovers. The daily/weekly windows are where a linear ETA is defensible. Deficit/reserve is fine everywhere; the ETA is the part that can cry wolf.

    2. On phase 2 when you get there: per the epic's evidence gate, the historical forecast needs validating against real completed windows before it ships to users, replay each past window, compute the forecast at each point, and check the ETA and the run-out risk % against what actually happened at the boundary. Your blend-toward-linear-with-thin-history and the no-flatter cap are already the right shape; the ask is to make that validation an explicit step, not just a design property, since a confidently wrong forecast is worse than none.

    Keep the caption estimate-flavored as you noted. Looking forward to the PR.

  3. iamtoruk commented on Jul 20, 2026

    @iamtoruk
    Member

    Shipped in #728: Codex quota rows now show deficit/reserve, linear projection, and lasts-to-reset / runs-out-in ETA. Note the staged 3-tier wording from the proposal was simplified to the on-pace band plus exact percentages. Phase-2 historical forecast continues in #725.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions