Skip to content

Faster / adaptive refresh: 5-minute cadence is too laggy for menu-bar quotas #1233

Description

@KevinXC5

Problem

Background refresh is hardcoded to 5 minutes with no Settings control (docs/refreshing.md: "a fixed cadence — there's no setting for it"). Manual refresh (footer / ⌘R) still works, but that is not a substitute for choosing how often the menu-bar meters update on their own.

I keep OpenUsage in the menu bar all day as a compact quota strip (Bars style, Codex + Grok pins). Five minutes is a reasonable default, but it is the only option:

  • While actively coding against a 5-hour Codex window, 5 minutes is slow — I only find out I am close to the cap after the fact, unless I sit there hitting ⌘R.
  • When I am not coding, polling every 5 minutes is more aggressive than I need. A longer interval (15 / 30 min) would cut API traffic, wake-ups, and battery use.

I know this ground has been covered:

  • #611 removed Refresh Every from Settings and froze the cadence at 5 minutes.
  • #678 asked for 1-minute polling and was closed as not planned, because providers already 429 at 5 minutes and are likely to tighten further.
  • #679 sketched a smart per-provider timer; the shipping behavior is still a single global 5-minute loop.

This request is not "poll every minute". It is "give the user a conservative picker again", with 5 minutes remaining the default and a floor that respects the rate-limit lesson from #678.

Proposed Solution

Bring back a Refresh Interval row in Settings (Appearance or a small Advanced / Usage section), defaulting to 5 minutes.

Suggested options:

Option Intent
5 min (default) Current behavior, unchanged for existing users
10 / 15 / 30 min Lighter polling when the Mac is just sitting in the menu bar
2 or 3 min (optional, last) Fresher session windows while coding; still above the 1-minute floor that #678 rejected

Constraints I think keep this compatible with #678 / #611:

  • Do not offer 1 minute. Floor at 2–3 minutes if a faster option exists at all; otherwise floor at 5 and only expose longer intervals. Even a "5 / 15 / 30" picker would already solve the resource side.
  • Keep ⌘R / footer click as an unbounded manual bypass, as today.
  • Keep one global cadence (no per-provider UI). Per-provider / adaptive scheduling from Smart / adaptive refresh timer with per-provider cadence and exponential backoff #679 can stay a later internal improvement.
  • Cache TTL and the "Next update in Nm" footer should follow the chosen interval so the UI does not lie.
  • Document the floor and the rate-limit reason in docs/settings.md / docs/refreshing.md, so people do not file "please add 30s" next.

The RefreshSetting type still exists from the pre-#611 code; this is mostly restoring the picker and wiring it back to startPeriodicRefresh, not a new scheduler.

Alternatives Considered

  • Live with 5 min + mash ⌘R. Works, but the whole point of pinning meters in the menu bar is glanceable, hands-off numbers. I should not have to babysit the popover.
  • Re-open Polling Interval #678 as 1-minute polling. Already rejected for good provider-health reasons. I am explicitly not asking for that.
  • Wait for the smart/adaptive timer (Smart / adaptive refresh timer with per-provider cadence and exponential backoff #679). Still the right long-term design, but it does not ship today, and it still would not let me slow down polling when I want to.
  • Quit OpenUsage when idle. Defeats the menu-bar use case.

A small, floored picker is the least surprising fix: default stays safe, power users can go slower (or slightly faster), and provider APIs are not spammed.

Additional Context

OpenUsage is the menu-bar tracker I actually want to keep (compact Bars pins, native, much lighter than CodexBar). CodexBar still exposes Adaptive plus 1 / 2 / 5 / 15 / 30 minute presets; I do not need that full set — just a way to choose something other than a locked 5 minutes.

Happy to take "longer intervals only, 5-minute floor" if a faster option is still too risky.

Activity

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions