Repository navigation
cmux NEXT: a window closed during the launch restore stays closed - #23695
Conversation
The restore puts back the saved registry, where the window is open, and then opens the front window when none is open. A Close All Windows that landed before the restore finished came back 60-75 ms later, so the app never went to background mode (BackgroundAccessoryPolicyTests red on base). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d18-98cd-7a42-ac32-a70f43729c15&host=cosmic-gray
…uring the restore Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d18-98cd-7a42-ac32-a70f43729c15&host=cosmic-gray
|
Owned by an agent session · session |
|
cmux status (one comment, edited in place; each line is updated by the job that owns it) Review App of this head (app.zip, kept 1 day)
Passes: CI passes on CI passes on Written by web and size checks: green |
|
Bead |
|
Review (independent subagent): SHIP at 85912fd
|
This comment has been minimized.
This comment has been minimized.
The launch window often wears the saved front window's id, and its close returned before userClosed, so the restore opened that window again and still landed the first workspace. Record it in closedDuringRestore too, and test a close before the restore finishes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d18-98cd-7a42-ac32-a70f43729c15&host=cosmic-gray
|
|
…estore Closing a launch window with a fresh id left reconcile registering the workspaces under another new id, so a window opened anyway. Keep the closed launch id while restore runs as reconcile's fallback window, and treat the saved window it would have adopted as closed too. The test's temp dir goes in a defer again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d18-98cd-7a42-ac32-a70f43729c15&host=cosmic-gray
Bugbot needs on-demand usage enabledBugbot uses usage-based billing for this team and requires on-demand usage to be enabled. A team admin can enable on-demand usage in the Cursor dashboard. |
…y step itself Closing it after reconcile let the reconcile's sync build and present it for a moment (activating the app out of background mode). The restored-registry swap and every reconcile now mark those windows closed before any sync, and the test checks nothing was presented. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?harness=claude&session=01a15d18-98cd-7a42-ac32-a70f43729c15&host=cosmic-gray
|
Review (independent subagent): SHIP at dc89c30 Fourth pass, after three HOLDs, each fixed on this branch:
At this head, Not blocking: a window closed and then reopened (Dock) before restore finishes is closed again; this is noted in the body. |
|
Review (codex gpt-6.1-sol): BLOCK at dc89c30 Blocking findings:
Non-blocking findings:
Checked: all three changed files against merge-base 01f3767, surrounding launch/adoption, registry persistence/reconciliation, close/reopen action paths, and test assertions; small static source checks only, no builds or Swift suites. Final head recheck matched the SHA above. |
…ort-2/bg-accessory-close
|
Review (independent subagent): SHIP at c4ada02 The head is a clean merge of feat-cmux-next (b5a78a8) into the reviewed head dc89c30. The base merge brings in the base fixes the earlier swift-test run lacked (the tooltip offender and the cut-short run were not this PR's).
|
|
|
|
|
|
Orphaned: no activity for 14 h, and no lane holds a lease on it. Adopted by the orphan sweep: merged |
|
|
|
|
…ort-2/bg-accessory-close
…at once A fade-out defers windowWillClose, so the close could land after the restore cleared closedDuringRestore, and the restore would reopen or reveal into it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-3e2afd09725c1ccba8ee
|
|
Reopen Closed Window cleared nothing, so the restore's next reconcile closed the reopened window again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-3e2afd09725c1ccba8ee
…tays open Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-3e2afd09725c1ccba8ee
|
|
|
Review (codex gpt-6-astra xhigh): SHIP at f3bf599 Four rounds. R1–R3 found the close-fade, reopen and releaseClosed paths, and all three are fixed. R4 shipped it with one non-blocking note: |
|
Shipped in:
|
Summary
BackgroundAccessoryPolicyTestsis red on base on every run, not only on loaded runners. It closes the last window (Close All Windows) as soon as the launch window shows a workspace, and expects the app to have no window and run as a menu bar app. Instead, the same window opens again 56–75 ms later.Cause: since the first launch shows Home early (#22389), a window can show a workspace while
WindowManager.restore()is still running. A window the person closes then is opened again by the rest of the restore:FirstWorkspaceLaunch.land: it reveals the first workspace, which finds its window closed and opens a new one.Fix:
userClosedrecords windows the person closes while the restore runs, inclosedDuringRestore.The launch window too (found by the independent review): closing the launch window during restore used to skip
userClosed.aWindowClosedBeforeTheRestoreFinishesStaysClosed: it closes the launch window before the restore finishes, then checks that no window is open and none was presented.Testing
The red-first test is the existing
BackgroundAccessoryPolicyTests(fails at lines 73, 74 and 82: a window is still open and the app is regular after Close All Windows).FirstWorkspaceLaunch.land.No capture: the change is in window lifecycle timing, not in how anything draws. A window closed during the launch restore now stays closed; no screen state changes, and
BackgroundAccessoryPolicyTestschecks that.SidebarOneMorphingCardTests and PalettePickerSourcesTests fail in
cmux-next swift testhere and fail the same way on base (SidebarOneMorphingCard: three shownCards expectations at df9b43f on the same host).Follow-up fixes after adoption (Codex gpt-6-astra xhigh review)
fadeOutThenClosenow closes at once while the restore runs, or before it has run. A fade could outlive the restore, which then would not know the window was closed and would open it again.reopenClosedWindowoverloads remove the reopened id fromclosedDuringRestore, so a window the person reopens (Dock click, Reopen Closed Window) before the restore finishes stays open. This replaces the race the earlier "Not in this PR" note described.releaseClosedWindow: a window released with no heir opens again on purpose, so its id leavesclosedDuringRestoretoo.These three paths have no regression test: the fade doesn't run in tests, and the reopen paths need the same-tree cmux-tui that
BackgroundAccessoryPolicyTestsskips for in CI.Not in this PR
closedLaunchWindowIDisn't cleared on reopen. This is rare and non-blocking per the review. Follow-up.The culprit is likely #22389, from the timing, but it wasn't bisected.
Agent session: cosmic-gray
🤖 Generated with Claude Code