Repository navigation
fix(menubar): pick the second row's provider by its worst quota window - #1311
Merged
Merged
Conversation
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
approved these changes
Sep 12, 2026
iamtoruk
left a comment
Member
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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 whataggregateQuotaStatus(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.transientFailurekeeps 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.Testing
npm testpassesnpm run buildsucceedsmac/Tests/CodeBurnMenubarTests/MenubarSecondRowTests.swiftgains 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 buildpasses.swift testcannot run on this machine —error: no such module 'Testing'on a CLT-only toolchain, which is equally true onmain— so the pure logic was additionally verified with a standaloneswiftcharness over the real source, and each new behaviour was mutation-checked by reverting it and confirming the harness fails (headline-window selection: 6 failures; droppingtransientFailure: 2; removing the cap: 3; a passthrough accessibility label: 3). The test file was type-checked against the built module with theTestingmacros shimmed out.