Fix menu bar item identity#1122
Conversation
|
Codex review: needs maintainer review before merge. Latest ClawSweeper review: 2026-05-23 19:39 UTC / May 23, 2026, 3:39 PM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: no. high-confidence live reproduction by this review; I did not run Thaw/Ice or a macOS display-removal setup. Source inspection of current main does show display-change recovery can recreate visible detached/off-current-screen status items, matching the reported failure mechanism. PR rating Rank-up moves:
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. Real behavior proof Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Merge the non-destructive displaced-item refresh and stable accessibility identity changes if maintainer review accepts the AppKit behavior, while keeping autosaveName persistence out unless separately designed and tested. Do we have a high-confidence way to reproduce the issue? No high-confidence live reproduction by this review; I did not run Thaw/Ice or a macOS display-removal setup. Source inspection of current main does show display-change recovery can recreate visible detached/off-current-screen status items, matching the reported failure mechanism. Is this the best way to solve the issue? Yes, based on source review. The patch preserves destructive recreation for missing button/window or zero-width status items, uses in-place refresh only for displaced live items, and adds focused identity/recovery coverage without introducing autosaveName persistence. Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 94f831a20932. |
fe86e1b to
c41f618
Compare
|
Addressed the ClawSweeper blocker in
Verification after the update:
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Hi, from Thaw here. This fix looks related to an issue we’ve seen in internal testing with CodexBar 0.29.0 on macOS 26, where CodexBar’s menu bar item keeps getting recreated and ends up “stuck” until users reset Control Center’s preferences, which also corrupts its plist files. We’re working on mitigating this from the Thaw side, but a CodexBar release with this change would solve it properly for users. Is there a rough timeline for when a build including this fix might ship? |
|
@steipete @lederniermagicien |
Problem
CodexBar can be reclassified by menu bar managers as a new item after the user pins it visible. Thaw issue stonerl/Thaw#605 reports CodexBar repeatedly moving back into the hidden section.
The risky CodexBar behavior was in status item visibility recovery: a live status item whose backing window had moved off the current screen could be treated as failed materialization, causing CodexBar to remove and recreate the
NSStatusItem. For managers such as Thaw/Ice, that churn can make the pinned item look like a new menu bar item.Solution
Give CodexBar status items stable manager-facing identity and split recovery into destructive vs non-destructive paths:
NSStatusItemand re-renders it instead of replacing it.autosaveName, accessibility identifier/title, and tooltip values.Safety details
NSStatusIteminstances when a menu bar manager may have intentionally parked or moved the item.Changes
Status item identity
Visibility recovery
Tests
NSStatusItem/button instances.Verification
swift test --filter 'MenuBarVisibilityWatcherTests|StatusItemControllerSplitLifecycleTests'make check./Scripts/compile_and_run.shAXMenuBarItemwith titleCodexBarand identifierCodexBar.StatusItem.codex.Full
swift testwas also run. It still fails in unrelated existing tests outside this status-item path:ProviderStorageFootprintTests/forced scheduled storage refresh does not restart identical in flight scanCodexManagedOpenAIWebRefreshTests/regular refresh does not await OpenAI web scrapeCodexBackgroundRefreshCoalescingTests/rapid regular refreshes coalesce concurrent Codex credits fetches