Reduce idle menu power usage#1292
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 3, 2026, 12:29 PM ET / 16:29 UTC. Summary Reproducibility: not applicable. as an open PR review. The PR body provides after-fix profiler proof for the closed-menu idle path, but I did not run a local reproduction in this read-only review. Review metrics: 1 noteworthy metric.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow idle-power change only if maintainers accept the first-open latency tradeoff and exact-source full-Xcode validation stays clean. Do we have a high-confidence way to reproduce the issue? Not applicable as an open PR review. The PR body provides after-fix profiler proof for the closed-menu idle path, but I did not run a local reproduction in this read-only review. Is this the best way to solve the issue? Yes, conditionally: the code change is narrow and keeps upgrade-sensitive battery-saver behavior intact. The remaining question is whether maintainers want this runtime tradeoff as the default. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 3387cc8b2d47. Label changesLabel justifications:
Evidence reviewedAcceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Addressed the P1 compatibility finding in @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Added after-fix idle @clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. Re-review progress:
|
Summary
openAIWebBatterySaverEnabledvalue into battery saver mode.Background
A local pre-fix CPU sample of the running menu bar app showed idle CPU dominated by
StatusItemController.rebuildClosedMenuIfNeeded(_:)->populateMenu(_:provider:)-> SwiftUINSHostingController.sizeThatFits(in:), while the menu was closed. WebKit helper processes were not the hot path in that sample.Review updates
3f907011by restoring theopenAIWebBatterySaverEnabledfallback tofalseand matching tests to that upgrade-safe behavior.After-fix profiler proof
3f9070117d350e73c6e90c784c670a7bbdafe953locally withswift build --product CodexBar.#Previewdeclarations fromKeyboardShortcutsand replaced SwiftUI@Entrywith the equivalentEnvironmentKeyimplementation. The app/menu refresh code under review was unchanged, and the working tree was restored afterward..build/arm64-apple-macosx/debug/CodexBar -debugDisableKeychainAccess YES -openAIWebAccessEnabled NO -refreshFrequency oneMinute -debugLogLevel debug.sample <pid> 15 -file pr1292-afterfix-idle.sample.txt.0.0%before and after the 15s sample window, and the sample contained zero occurrences of the pre-fix hot-path symbols:rebuildClosedMenuIfNeeded: 0populateMenu: 0NSHostingController: 0sizeThatFits: 0closed menu rebuild completed: 0Verification
git diff --checkpassed.build/lint-tools/bin/swiftformat --lint .passed:0/1003 files require formatting,87 files skippedswift build --product CodexBarCLIpassedswift build --product CodexBarpassed for the local proof build with the macro-only compile workaround described aboveLocal limitations
xcode-select -pis/Library/Developer/CommandLineTools; this machine has no/Applications/Xcode*.app, andhome-mac-mainalso has no full Xcode install.swift build --product CodexBaris blocked before this change by dependency SwiftUI preview macros under CLT-only setup:PreviewsMacrosis unavailable inKeyboardShortcuts.swift test --filter SettingsStoreTestsis blocked before the target tests by the samePreviewsMacrosissue plus the local CLT test compile not finding moduleTestingforTestsLinux.make checkran SwiftFormat successfully, then SwiftLint failed locally because SourceKitten could not loadsourcekitdInProcunder the CLT-only setup.