Skip to content

Merge upstream CodexBar main#2

Merged
ColumbusLabs merged 105 commits into
mainfrom
codex/upstream-sync-v0325-main
Jun 9, 2026
Merged

Merge upstream CodexBar main#2
ColumbusLabs merged 105 commits into
mainfrom
codex/upstream-sync-v0325-main

Conversation

@ColumbusLabs

@ColumbusLabs ColumbusLabs commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Summary

Merges Pete's steipete/CodexBar upstream/main changes since v0.32.4 into QuotaKit while preserving QuotaKit product/release identity.

Closes #1 when merged.

What changed

  • Codex account/auth refresh hardening
  • MiniMax token-plan and subscription metadata fixes
  • Mac menu readiness/performance fixes
  • New Mac localizations from upstream
  • Provider/status fixes for Claude, Antigravity, Cursor, Alibaba, and related tests
  • Daily upstream monitor now uses UPSTREAM_MONITOR_BASE for new-commit detection, while UPSTREAM_VERSION remains the shipped-user release marker

QuotaKit boundaries preserved

  • Kept QuotaKit README/changelog framing instead of upstream CodexBar public copy
  • Kept QuotaKit CLI help branding (QuotaKit / quotakit)
  • Kept QuotaKit release fields and did not bump UPSTREAM_VERSION before release
  • Added UPSTREAM_MONITOR_BASE so the daily monitor will not reopen stale issues after this sync lands, unless Pete commits new upstream changes
  • Preserved QuotaKit-rich UsageSnapshot fields while adding upstream subscription date fields

Secondary review focus

  • Codex auth/account behavior with QuotaKit multi-account expectations
  • MiniMax token-plan/subscription display and sync behavior
  • UsageSnapshot schema compatibility
  • Mac localization resource additions
  • Final QuotaKit branding scan before release

Validation

  • ./Scripts/lint.sh lint
  • swift build
  • Focused Swift tests for Codex account/auth, MiniMax, menu readiness/performance, UsageStore/UsageFetcher encoding, and localization
  • ./Scripts/check_upstreams.sh now reports 0 new commits on this branch because UPSTREAM_MONITOR_BASE points at the merged Pete upstream commit

steipete and others added 30 commits June 2, 2026 15:54
Defer merged-menu close rebuilds, cache repeated menu-card height measurements, and coalesce rapid switcher rebuild requests.

Co-authored-by: hhh2210 <hzy2210@gmail.com>
* Reduce icon observation churn

* Remove residual reflection from icon observation signature

A main-thread sample of the packaged build (Merge Icons on, macOS 26.5)
showed providerStoreIconObservationSignature still bottoming out in
String(describing:) -> _adHocPrint_unlocked reflection, from two
String(describing:) calls over the payload-free IconStyle enum.

Make IconStyle String-raw-represented (rawValue == case name, so the
signature string is byte-identical) and replace both String(describing:)
calls with .rawValue. The icon-observation leaf is now reflection-free;
a re-sample shows providerStoreIconObservationSignature and
_adHocPrint_unlocked gone from the path entirely.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Derive icon credits fallback from the Codex projection, not a hand-rolled predicate

menuBarCreditsRemainingForIcon (used by both the rendered menu-bar icon and
the icon observation signature) reimplemented the menu-bar credits fallback
with its own rate-window predicate over snapshot.primary/secondary. That is a
second source of truth for a decision the Codex projection already owns
(codexConsumerProjection -> menuBarFallback == .creditsBalance): equivalent
today, but free to drift from the rendered/menu fallback semantics as the
projection evolves.

Delegate to store.codexMenuBarCreditsRemaining instead, so render, signature,
and the menu-bar fallback all read one projection. The projection is pure
value composition over already-loaded snapshot/credits state (no IO), so the
icon/signature path stays cheap. Behavior is unchanged in the covered cases
(8 icon observation signature tests still pass).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* Stabilize flaky switcher coalesce test timing

* docs: add changelog for icon observation fix

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Menu cards size from semantic text styles (.body/.footnote/.headline/…)
that scale with the macOS system text-size / Dynamic Type setting. That
scale was in neither the content fingerprint nor the cache key, and no
observer clears the cache when it changes, so a runtime text-size change
could return a height measured at the old scale (clipped or over-tall
cards) until the next data refresh or the 256-entry flush.

Add the resolved .body point size to MenuCardHeightCacheKey. Widening the
key is the safe direction: identical scale keeps hitting as before, a
changed scale forces a fresh measurement. It can never return a stale
height, only (at worst) re-measure once after a scale change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
In Merge Icons mode prepareAttachedClosedMenusIfNeeded eagerly rebuilt the closed merged menu on every store tick, running a full main-thread populateMenu (incl. SwiftUI hosting-view layout) that menuWillOpen redoes on display anyway. Defer the merged menu until next open instead, taking the residual close-path freeze to zero. Refs #1274.
Cache menu card heights and skip closed merged-menu rebuild
Fix Kiro CLI discovery after slow login PATH capture
Try the token-plan remains endpoint first, then fall back to the legacy coding-plan remains endpoint for compatible API-token failures.

Cover the new fallback path and the updated global/China retry request order.
Use the most constrained MiniMax quota window for automatic menu-bar metrics so a near-exhausted weekly lane is not hidden behind a low 5h lane.
steipete and others added 28 commits June 7, 2026 06:06
fix: preserve Codex reset windows across account refresh
The menu readiness signature serializes every enabled provider's token
snapshot and 30-day daily breakdown on each store mutation. Two fixes:

- Skip computing it entirely when no menu is open, since the result
  (refreshOpenMenus) is only consulted while a menu is open. This is the
  common case during background refresh ticks.
- Use the raw Double bit pattern instead of String(format: "%.8f", …),
  which is a hot per-value cost. The signature is only compared for
  equality, so the bit pattern is both exact and far cheaper.

Reduces main-thread work that regressed popup-menu responsiveness in the
0.32 series (refs #1321).

Co-authored-by: Cursor <cursoragent@cursor.com>
Each hosted chart/submenu item built TWO SwiftUI hierarchies on every
(re)build: the MenuHostingView that is actually displayed, plus a separate
NSHostingController created solely to measure height via sizeThatFits. That
controller's result was always immediately overwritten by the subsequent
refreshHostedSubviewHeights() fittingSize pass (run from both menuWillOpen
and refreshHostedSubviewMenu), so the second hierarchy was pure overhead on
a popup-menu hot path that scales with provider/account count.

Measure the live displayed view via fittingSize instead (the same mechanism
refreshHostedSubviewHeights already uses), via a shared
hostedSubviewFittingHeight helper. Final heights are unchanged; only the
redundant SwiftUI tree is removed. Adds a test asserting the append-path
height matches the authoritative re-measure across chart types/providers.

refs #1321

Co-authored-by: Cursor <cursoragent@cursor.com>
Skipping the readiness signature while all menus are closed (the idle-cost
optimization) let the baseline drift from live store data. A menu reopened
from new data, followed by an open-menu change reverting to the previous
baseline value, was treated as unchanged and skipped the rebuild, leaving
stale content visible.

Re-anchor the baseline when a root menu opens (rebuilt from current data).
Only the root open re-anchors; nested submenu opens must not, to avoid
masking a pending parent refresh. Adds a focused regression test.

Co-authored-by: Cursor <cursoragent@cursor.com>
…347)

localizedBundle()/codexBarLocalizationResourceBundle()/lprojBundle() did
Bundle(url:)/Bundle(path:) filesystem lookups on every call. Menu row bodies
re-evaluate them on every closed-menu rebuild tick on the main thread, so idle
CPU climbs. Cache the (constant) resource bundle and the resolved localized
bundle keyed on the current language; a language switch transparently
re-resolves. Single lock with compute-outside-lock keeps disk work off the
critical section and avoids re-entrant deadlock.

Co-authored-by: Cursor <cursoragent@cursor.com>
CI failed because the language-switch assertion used "ja", which has no
ja.lproj in the repo and correctly falls back to en.lproj. Use "es"
instead, which matches an actual catalog.

Co-authored-by: Cursor <cursoragent@cursor.com>
Only re-anchor the readiness baseline on root menu open when the menu was
actually rebuilt or is already fresh for the current menuContentVersion.
When refreshMenuForOpenIfNeeded preserves stale content during an in-flight
provider refresh, resyncing to live store data would mask the
refresh-completion update. Add a focused regression test (negative-validated).

Co-authored-by: Cursor <cursoragent@cursor.com>
Cache localized bundle resolution to cut main-thread disk lookups (#1347)
perf: size hosted menu charts without a throwaway hosting controller
perf: cut menu readiness signature cost on store changes
@ColumbusLabs ColumbusLabs merged commit ab1d52f into main Jun 9, 2026
3 checks passed
@ColumbusLabs ColumbusLabs deleted the codex/upstream-sync-v0325-main branch June 9, 2026 02:32
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.

Upstream Changes Available for Review