Skip to content

chore(menu-bar): add bounded Control Center startup diagnostics - #4012

Merged
steipete merged 4 commits into
mainfrom
triage/20260921-control-center-v
Sep 26, 2026
Merged

steipete merged 4 commits into
mainfrom
triage/20260921-control-center-v

Conversation

@steipete

@steipete steipete commented Sep 26, 2026 •

Copy link
Copy Markdown
Owner

CodexBar can remain alive on Tahoe while Control Center creates no hosted status-item window (#3377). The new 0.66.0 report persists with fresh preferences, a single display, and Bartender stopped. Current source does not establish the cause, so this change adds opt-in startup evidence and leaves recovery decisions unchanged.

CODEXBAR_STATUS_ITEM_DIAGNOSTICS=1 emits at most 128 JSON records covering launch, zero-width creation, stable naming, sizing, rendering, the startup check, and a 15-second settled sample. Records include AppKit state/geometry, expected visibility, activation policy, recognized placeholder windows, and Control Center window counts/numbers and named candidates. It does not log window titles, provider content, or credentials. Missing/redacted names are not treated as proof of hosting failure.

The nearby cleanup shares startup recovery diagnostics and removes unused screen-count decision parameters/bookkeeping. Existing debounce, guidance gates, and bounded retry behavior are preserved. Documentation includes a debug-only production-identity build recipe and the reporter capture command. Keep #3377 open pending the affected-machine capture; no diagnostic artifact has been distributed and no runtime hosting fix is claimed.

Validation:

  • CODEXBAR_SUPPRESS_TEST_KEYCHAIN_ACCESS=1 swift test --jobs 2 --filter 'StatusItem.*Tests|MenuBar(StatusItem|VisibilityWatcher|Layout).*Tests|ProviderArchitectureGatekeeperTests|AppDelegateTests' passed: 495 tests in 29 suites, zero failures. This ran on ea10876a4a00; the diagnostic runtime files and diagnostic/visibility tests are byte-identical after the subsequent upstream merge.
  • Final integrated make check passed: 0/2665 files require formatting, 6 files skipped. and Found 0 violations, 0 serious in 2664 files.
  • Initial local compilation hit shared disk exhaustion before tests executed. After space recovered, the focused retry above passed. The checkout's .build was removed after final verification; the full sharded suite was not run locally.
  • First CI run failed because removing two unused fields moved an existing gatekeeper anchor from line 349 to 347. The one-line correction is included, and ProviderArchitectureGatekeeperTests passed locally. CI is rerunning for the final integrated head.
  • Upstream Extract layout options row and remove hint #3999 introduced a CHANGELOG-only merge conflict while verification ran. The merge preserves both entries and contributor credit; no history rewrite or force-push was used.
  • Codex AutoReview through P2: scoped-clean, no actionable findings. Both documented shell blocks passed bash -n without execution. git diff --check passed.
  • Against current main: production 6 files, 114 insertions, 115 deletions; net −1. Tests 3 files, 72 insertions, 26 deletions; net +46.

The running app was not relaunched or reconfigured, and no real-account provider probes were run. Synthetic tests cover owner/layer filtering, duplicate and redacted names, exclusion of unrelated titles, and the unchanged no-record recovery decision. Regression red→green is established for the CI anchor correction, not for the unresolved hosting bug.

Refs #3377
Refs #3355
Refs #3201

Record opt-in startup state for the unresolved Tahoe hosting report in #3377. Preserve recovery policy and remove unused screen-count bookkeeping. Document a signed diagnostic build and reporter capture recipe.
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4d54ab16b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +45 to +47
@MainActor static func trace(_ stage: String, item: NSStatusItem? = nil, evidence: String = "") {
guard self.diagnosticsEnabled, self.diagnosticRecords < 128 else { return }
self.diagnosticRecords += 1

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reserve records for the lifecycle checkpoints

With merged icons disabled and 41 or more enabled first-party providers, the two launch traces plus three creation traces per status item exhaust this 128-record cap before scheduleStartupStatusItemVisibilityCheck emits rendered, startup-check, or settled. That leaves precisely the large multi-icon configurations most likely to expose hosting problems without the before/after lifecycle snapshots the diagnostic document asks reporters to compare; reserve capacity for those stages or stop emitting per-item creation records once the reserve is reached.

Useful? React with 👍 / 👎.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 26, 2026
@clawsweeper

clawsweeper Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Codex review: needs changes before merge. Reviewed September 25, 2026, 11:25 PM ET / September 26, 2026, 03:25 UTC (Revision 3).

ClawSweeper review

What this changes

Adds opt-in JSON diagnostics for menu-bar item creation and Control Center windows, simplifies display-change bookkeeping, and adds tests and diagnostic-build instructions.

Merge readiness

⛔ Needs changes before merge - 2 items remain

Keep open: current main lacks the startup evidence needed for the Tahoe investigation, and the record-cap defect identified in the previous review remains on this head. The underlying hosting failure remains tracked at #3377.

Priority: P2
Reviewed head: 5e93d50e92178dbfa091d297980867d8f29e12c3

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The diagnostic is focused and has useful synthetic coverage, but its record cap still loses essential observations in a supported large-provider setup.
Proof confidence 🦐 gold shrimp (3/6) Not applicable: This owner-authored PR is exempt from contributor runtime proof. Reported synthetic tests exercise window filtering through the test entrypoint, but no production-identity Tahoe launch or observed hosting result is supplied; the PR does not claim a hosting fix. No stored-data contract changes.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This owner-authored PR is exempt from contributor runtime proof. Reported synthetic tests exercise window filtering through the test entrypoint, but no production-identity Tahoe launch or observed hosting result is supplied; the PR does not claim a hosting fix. No stored-data contract changes.
Evidence reviewed 7 items Introduced trace budget: The opt-in trace stops all records at 128, regardless of stage.
Startup record order: Creation emits three records per item before the controller schedules rendered, two-second startup-check, and 15-second settled samples. Split icons can create a merged item plus one item per enabled provider.
Previous finding unchanged: The diagnostic production files and tests are unchanged since the previously reviewed head; the prior record-reservation finding still applies.
Findings 1 actionable finding [P2] Reserve records for the later startup checkpoints
Security None None.

How this fits together

CodexBar turns provider settings into macOS menu-bar items, which Control Center hosts. A startup watcher checks those items for visibility problems; the new diagnostics sample that path and write JSON to stdout.

flowchart LR
 A[Provider settings] --> B[Status item controller]
 B --> C[AppKit menu items]
 C --> D[Control Center windows]
 C --> E[Opt-in diagnostics]
 D --> E
 B --> F[Startup visibility check]
 E --> G[JSON stdout]
Loading

Before merge

  • Reserve records for the later startup checkpoints (P2) - With split icons and 41 enabled providers, startup creates 42 items. Two launch records plus three creation records per item fill the 128-record cap before rendered, startup-check, or settled can be emitted. Reserve or coalesce records for those stages and cover this configuration in a synthetic test.
  • Complete next step (P2) - Reserve or coalesce trace capacity for the later startup checkpoints and add a large-provider regression test before merge.

Findings

  • [P2] Reserve records for the later startup checkpoints — Sources/CodexBar/MenuBarStatusItemWindowProbe.swift:46-47
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta production +114/-115 lines; tests +72/-26 lines Production size is nearly flat, while the added tests exercise filtering but not the trace budget.
Trace capacity 128 records total; 3 creation records per item A large split-icon setup can consume the entire budget before later startup samples.

Root-cause cluster

Relationship: partial_overlap
Canonical: #3377
Summary: This PR adds evidence collection for the canonical Tahoe hosting report without claiming to fix it; the other cited menu-bar reports describe distinct placement or identity symptoms.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep the trace bounded while coalescing creation data or reserving capacity for the later lifecycle samples; use the resulting signed production-identity build to investigate the still-open Tahoe failure.

Do we have a high-confidence way to reproduce the issue?

Not applicable to the diagnostic addition. The linked Tahoe hosting failure is reported on an affected machine, but this branch does not reproduce or fix it.

Is this the best way to solve the issue?

No, not yet: the shared record cap can discard the comparison stages the diagnostic is meant to capture. Reserving or coalescing those records is the narrow repair.

Full review comments:

  • [P2] Reserve records for the later startup checkpoints — Sources/CodexBar/MenuBarStatusItemWindowProbe.swift:46-47
    With split icons and 41 enabled providers, startup creates 42 items. Two launch records plus three creation records per item fill the 128-record cap before rendered, startup-check, or settled can be emitted. Reserve or coalesce records for those stages and cover this configuration in a synthetic test.
    Confidence: 0.97

Overall correctness: patch is incorrect
Overall confidence: 0.94

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 56bf55bd9b69.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded diagnostic improvement with one concrete defect affecting large split-icon configurations.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: This owner-authored PR is exempt from contributor runtime proof. Reported synthetic tests exercise window filtering through the test entrypoint, but no production-identity Tahoe launch or observed hosting result is supplied; the PR does not claim a hosting fix. No stored-data contract changes.

Evidence

Acceptance criteria:

  • [P1] CODEXBAR_SUPPRESS_TEST_KEYCHAIN_ACCESS=1 swift test --jobs 2 --filter 'StatusItemHostingDiagnosticsTests|MenuBarVisibilityWatcherTests|ProviderArchitectureGatekeeperTests'.
  • [P1] CODEXBAR_SUPPRESS_TEST_KEYCHAIN_ACCESS=1 make test.
  • [P1] make check.

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Petr Kratochvíl: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Reserve or coalesce trace records so rendered, startup-check, and settled survive a 41-provider split-icon startup.
  • Add a synthetic record-budget regression and complete Keychain-safe test and check validation after the repair.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-26T02:47:40.604Z sha a4d54ab :: blocked before merge. :: [P2] Reserve records for the later startup checkpoints
  • reviewed 2026-09-26T02:54:58.888Z sha ea10876 :: blocked before merge. :: [P2] Reserve slots for the later startup checkpoints

The status-item cleanup removed two stored fields, moving the unchanged Codex metric branch from line 349 to 347. Preserve its existing anchor, fingerprint, and justification.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant