Skip to content

fix(menubar): pick the second row's provider by its worst quota window - #1311

Merged
iamtoruk merged 1 commit into
getagentseal:mainfrom
ozymandiashh:fix/1310-second-row
Sep 12, 2026
Merged

iamtoruk merged 1 commit into
getagentseal:mainfrom
ozymandiashh:fix/1310-second-row

Conversation

@ozymandiashh

Copy link
Copy Markdown
Collaborator

Summary

  • The second row's "quota remaining" metric picked each provider's headlineWindow — a billing horizon (weekly, else monthly, else busiest) that is right for the Capacity Dock rail and wrong for a row meant to name the provider nearest its limit. On a real machine it threw away Cursor's API window at 100% and Claude's 5-hour window at 18% for Monthly 9.5% and Weekly 5%. Each provider now contributes its worst window, per-model rows included, which is exactly what aggregateQuotaStatus (the menu-bar flame tint) already uses — so the row and the flame agree, and README / CHANGELOG / the Settings help are true as written. The comment claiming the row followed the flame was wrong on both counts and is gone. Fixes menubar second row: 'nearest its limit' uses the headline window, not the worst window #1310.
  • A provider in transientFailure keeps its last-known window instead of dropping out of the candidates, matching the Capacity Dock, which shows the same data dimmed during a backoff. The row no longer vanishes and resizes the status item for the length of a retry.
  • Three smaller fixes from the same review: the row is capped at 24 characters, shortening a long provider name rather than letting "GitHub Copilot 12% left · 6d 3h" more than double the item's width; the two-line title gets a VoiceOver label that reads as one phrase instead of a string with a raw newline in it; and the snapshot feeding the row is no longer built on refreshes where the feature is off. With the setting off the title is byte-for-byte what it has always been.

Testing

  • I have tested this locally against real data (not just unit tests)
  • npm test passes
  • npm run build succeeds

mac/Tests/CodeBurnMenubarTests/MenubarSecondRowTests.swift gains cases for the worst-window selection (including the exact real-machine shape from the issue: Cursor API 100%, Claude 5h 18%, Monthly 9.5%, Weekly 5%), per-model windows, the reset instant following the worst window, tie-breaking, all six connection states, the width cap on every metric, and the accessibility label.

cd mac && swift build passes. swift test cannot run on this machine — error: no such module 'Testing' on a CLT-only toolchain, which is equally true on main — so the pure logic was additionally verified with a standalone swiftc harness over the real source, and each new behaviour was mutation-checked by reverting it and confirming the harness fails (headline-window selection: 6 failures; dropping transientFailure: 2; removing the cap: 3; a passthrough accessibility label: 3). The test file was type-checked against the built module with the Testing macros shimmed out.

The "quota remaining" row selected each provider's headline window, which
is a billing horizon: weekly, else monthly, and only then the busiest
window. That is the right number for the Capacity Dock rail and the wrong
one for a row whose whole job is to name the provider nearest its limit.
On a real machine it discarded Cursor's API window at 100% and Claude's
5-hour window at 18% in favour of Monthly 9.5% and Weekly 5%, so the row
read as if nothing were near a limit — while the flame beside it was
tinting off the worst window across every provider. The comment claiming
the row followed the flame was wrong on both counts.

Each provider now contributes its worst window, per-model rows included,
which is exactly the rule aggregateQuotaStatus tints by, so the row and
the flame agree and README, CHANGELOG and the Settings help become true
as written. A provider in transientFailure keeps its last-known window
instead of dropping out, matching the dock, which shows the same data
dimmed during a backoff: the row no longer vanishes and resizes the
status item for the length of a retry.

Three smaller fixes from the same review: the row is capped at 24
characters — about the widest the single row gets at 13pt, since the
second line renders at 9pt — shortening a long provider name rather than
letting "GitHub Copilot 12% left · 6d 3h" more than double the item's
width; the two-line title gets a VoiceOver label that reads as one phrase
instead of a string with a newline in it; and the snapshot feeding the
row is no longer built on refreshes where the feature is off. With the
setting off the title is byte-for-byte the single-row composition it has
always been.

Closes getagentseal#1310

@iamtoruk iamtoruk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on this machine: the selector now names Cursor at 0% left (API window exhausted) where main named Codex 60% left; off path byte-identical; 506/506, mutation-proven. One prose note: the flame's aggregate covers only the six legacy providers, so Cursor's row and the flame can still disagree. Merging.

@iamtoruk
iamtoruk merged commit f1d6ee0 into getagentseal:main Sep 12, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

menubar second row: 'nearest its limit' uses the headline window, not the worst window

2 participants