Repository navigation
fix(menu): avoid placeholder Dock promotion and show limiting quotas - #4335
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. Reviewed October 7, 2026, 3:13 PM ET / 19:13 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch prevents empty Settings placeholders from creating a Dock icon, makes OpenCode Go’s automatic quota displays show its tightest allowance, and documents prefix-free weekly percentages. Merge readiness✅ Ready for maintainer review The PR remains useful: current main lacks both repairs, and no introduced correctness or security defect was found. The previous review's empty findings remain supported; no unresolved product decision or additional merge blocker was established. Priority: P2 Review scores
Verification
How this fits togetherCodexBar uses window notifications to manage temporary Dock presence and provider usage snapshots to render menu-bar percentages and switcher bars. These changes filter unwanted Settings windows and select the OpenCode Go quota that most limits remaining capacity. flowchart TD
A[Window notifications] --> B[Identify Settings placeholder]
B --> C[Guarded dismissal]
B --> D[Dock presence policy]
E[Provider usage snapshot] --> F[Automatic quota selection]
F --> G[Menu percentage and switcher bar]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep placeholder handling centralized and OpenCode Go quota ranking provider-scoped, preserving real-dialog behavior and explicit metric preferences. Do we have a high-confidence way to reproduce the issue? Yes from source for placeholder promotion and healthy-quota misselection on pinned main. The macOS 27 demotion failure is reporter-supported and was not independently executed. Is this the best way to solve the issue? Yes. The patch reuses established identity and presentation helpers, and the owner-authored change settles the broader OpenCode Go ranking choice without changing stored preferences. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 36bf01ace109. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
# Conflicts: # CHANGELOG.md
CodexBar treated the empty SwiftUI Settings placeholder as a presented Settings window, promoting the app at launch. On the reported macOS 27 failure path, AppKit accepts promotion but refuses to restore accessory policy, leaving a Dock icon. Exclude the placeholder from promotion and regular-policy retention using the existing identifier/autosave-name rules, while preserving real Settings, minimized Settings, and Sparkle dialogs. Route the post-launch dismissal through the existing re-entry-safe guard and keep the placeholder out of restoration.
OpenCode Go's automatic menu-bar percentage and merged switcher now select the least remaining five-hour, weekly, or monthly quota before exhaustion. For a fixture with 20% rolling, 40% weekly, and 90% monthly usage, the switcher changes from 60% remaining to 10%. Explicit choices and other providers retain their existing rules. The UI guide also spells out the existing prefix-free weekly lane token for Codex and Claude.
Validation:
03a51bdcfc6:source Scripts/test_environment.sh; CODEXBAR_SWITCHER_QUOTA_PROOF_PATH=/tmp/menu-appkit-evidence/switcher-before.png swift test --build-system native --jobs 4 -Xswiftc -gnone --filter 'DockIconPolicyDecisionTests|SwitcherExhaustedQuotaTests'— 17 tests, 21 failed assertions (3 Dock, 18 quota).source Scripts/test_environment.sh; swift test --build-system native --jobs 4 -Xswiftc -gnone --filter 'DockIconPolicyDecisionTests|PlaceholderSettingsWindowGuardTests|AppDelegateTests|MenuBarMetricWindowResolverTests|SwitcherExhaustedQuotaTests|MenuBarLayoutRendererTests|MenuBarLayoutEditorTests|MenuBarLayoutTests|SparkleUpdaterControllerTests|OpenCodeGoProviderStrategyTests|ProviderArchitectureGatekeeperTests|ProviderPresentationPolicyCharacterizationTests|StatusItemBalanceDisplayTests|ClaudeDirectUsageFallbackTests|ClaudeSyntheticPlaceholder|ClaudeUsageInsightsTests|CompactOverviewTests'— 398 tests in 21 suites passed atde208143699.CODEXBAR_TEST_SUITE_TIMEOUT=360 ./Scripts/test.sh --swift-command /tmp/menu-appkit-evidence/swift-native --direct-workers 4— all 144 groups passed first try atde208143699, zero retries or timeouts; direct runtime verified 14,028 test methods. The wrapper forwardstest/buildtoswiftwith--build-system native --jobs 4 -Xswiftc -gnone.source Scripts/test_environment.sh; make check— passed on the final head; zero SwiftLint violations across 2,837 files.Earlier full-suite attempts caught two expectations for the previous OpenCode Go policy: the switcher-membership golden and a balance-display fixture expecting primary 12% instead of the limiting weekly 34%. Both are updated. An earlier check hit an unchanged process-cleanup timing test; serial reruns passed. An earlier full run recovered two unchanged Claude test groups on retry. The final-head full run above was clean without retries.
Dock validation uses deterministic descriptors without live NSApp activation; the reported macOS 27 LaunchServices failure was not exercised locally. Intentional Settings/update presentation still uses regular policy, so the OS can still refuse demotion after those real dialogs close. Opt-in live UI proofs and real account probes stayed disabled.
Production diff: 5 files, 26 insertions and 38 deletions (net -12). Tests: 6 files, 88 insertions and 15 deletions. The reduction removes the duplicate startup dismissal and a single-use quota wrapper while preserving its default ordering. The rebase preserved incoming Unreleased notes and left all source/test files owned by this PR unchanged.
Synthetic native rendering, identical fixture:
Exact-head CI run remains pending as of 2026-10-07 19:00 UTC, after the lane’s 12 permitted status polls: lint, change detection, Linux x64, Linux arm64, and Linux musl passed; macOS test shard 0 is running, shard 1 and macOS 15 compatibility are queued. No CI job has reported failure. Final job states were read through native REST using the authenticated personal writer; cached overall status was not treated as completion proof.
Fixes #4101
Fixes #3349
Refs #3671
Refs #4114