Repository navigation
cmux-next: close batch B2 overlay and harness windows - #27258
Conversation
Leo (2026-10-28), on Swift suites that leave windows open for the suites after them: "But why do you guys not just clean up after yourselves, or at least do your best to?" Each suite in this batch now closes every window its tests open, in the test's own teardown, and carries `.closesItsWindows` so a new leak fails by name: - teardowns that only ordered a window out close it; - tests that make browser pages release them (or close the chrome's popup panels), and tests that open the palette close its panel; - background mode's menu bar item goes when the launch test shuts down. Product code never closed three kinds of panel, only ordered them out, so they stayed in the app's window list while anything held their owner: - a window's overlay host panel, when the window closed (WindowOverlayHost); - a browser page's Page Info and Extensions panels, when its tab closed (BrowserEntry.close now calls BrowserChromeView.closePopupPanels); - the Mac screen approval prompt's panel, whose content holds the prompt (now closed and dropped when the prompt hides; the next request makes one). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-85ca59f74f02d81734c3
…heir panels Leo (2026-10-28): "But why do you guys not just clean up after yourselves, or at least do your best to?" - WindowOverlayHost keeps a closed window's torn-down host registered, so a late `host(for:)` for that window returns it instead of making a fresh panel nothing closes; a window shown again gets a new host, and `existingHost` still answers nil once torn down. - NativePopupHost.closePanel closes a popup's panel for good; Page Info, the Extensions bubble and the host pressure popover (when its indicator leaves its window) use it. - DebugPaletteCaptureTests and HomeOpenFocusesComposerTests drop the trait for now: the first leaves only AppKit's own TUINSWindow, the second the Chief Settings popover's panel, which its owner never closes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-85ca59f74f02d81734c3
…pKit-only suites keep the trait Leo: "But why do you guys not just clean up after yourselves, or at least do your best to?" Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-85ca59f74f02d81734c3
Leo (2026-10-28): "But why do you guys not just clean up after yourselves, or at least do your best to?" - WindowOverlayHost.tearDown closes its overlay panel when its window closes (it only ordered it out, so every closed window left an open OverlayHostPanel in the app's window list). - Test windows close instead of ordering out (isReleasedWhenClosed = false first); harnesses that never closed their window now do. - Hover card, tooltip and palette windows the code under test opened close in teardown. - App harness tests (withApp, the multi-view fixture) close the windows their app opened, including the page chrome's Page Info and Extensions bubbles. - Each fixed suite carries .closesItsWindows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-85ca59f74f02d81734c3
…host; app harness releases its pages Leo (2026-10-28): "But why do you guys not just clean up after yourselves, or at least do your best to?" A toast or overlay presented while a window closes (a toast's dismiss that offers the next one) reached a new host for the closed window and opened a new panel nothing closed. The torn-down host answers for the window until the close is over and never attaches its panel again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-85ca59f74f02d81734c3
…ith the close Leo (2026-10-28): "But why do you guys not just clean up after yourselves, or at least do your best to?" A window controller's teardown (run from the close) could make the window's first overlay host; its close observer came after the close notification, so its panel stayed open. The window manager tears that host down after the controller's teardown. The palette test ends the search field's editing before it closes the palette. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-85ca59f74f02d81734c3
…es what the app opened for its windows Leo (2026-10-28): "But why do you guys not just clean up after yourselves, or at least do your best to?" Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-85ca59f74f02d81734c3
…down a host made during the close Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-85ca59f74f02d81734c3
|
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)
red: cmux-next checks (god files, concurrency, crash safety, l10n); NEW: Default changesNo defaults change at Shipped in:
|
|
Bead |
|
Review (codex-review-box/gpt-6-astra high, lane-place): BLOCK at f4a00b0 BLOCK Exact head:
Validation limits: all 47 changed files match the diff’s head blob hashes. Teardown ordering, late-overlay guards, and window ownership were reviewed statically. No macOS runtime suites ran; this box is Linux without Swift. Runtime suites and the five-step full census remain pending fleet execution. No crash or incomplete run is excused as base-red. No files were modified or merged. |
|
Found 8 test failures on Blacksmith runners: Failures
|
…dow-leak-suites-B2-codex
|
Review (codex-review-box/gpt-6-astra high, lane-place): BLOCK at f8bbe6b BLOCK Reviewed head
The first two profile tests now cover the throwing palette wait. B2’s fullscreen cleanup precedes async initialization, and both routing factories cover partial construction; their window sweep filters by suite and test ownership. Validation was static: all 47 changed files match the diff’s head blob hashes; none are omitted. No macOS build or runtime suites ran in this Linux box. Fleet suites and the complete census remain pending; readiness and absence of runtime regressions are unverified. Crashed or incomplete runs provide neither passing evidence nor proof of base failures. |
|
Review (codex-review-box/gpt-6-astra high, lane-place): SHIP at 89f803e SHIP |
|
Review (codex gpt-6-astra high, next-review): BLOCK at 141a41b
|
|
Orphaned: no activity for 19 h, and no lane holds a lease on it. The orphan sweep could not merge |
This reverts commit 141a41b. Agent-Session: https://cmux.com/deeplink/agent?id=aid-1a293c23a59e24572f4b
This reverts commit 2153d45. Agent-Session: https://cmux.com/deeplink/agent?id=aid-1a293c23a59e24572f4b
… it already covers B2 Base (#27236, #28091, #31155) already closes the windows these suites open, stops daemon owners, and keeps a window closed during the restore. Conflicts take base; B2 keeps only what base lacks: the app-harness window close (AppHarnessWindows), the cross-machine and palette teardown, and the trait on four suites that open windows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-1a293c23a59e24572f4b
… open Review of #27258 (BLOCK at 141a41b): noteUserClose recorded the close before the window's delegate decided, so a cancelled incognito confirmation during the restore left the window remembered as closed and the restore tore it down. That code is gone (base's #31155 records the close in windowWillClose, after AppKit carries it out); this test keeps it that way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-1a293c23a59e24572f4b
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. |
…e throws) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Agent-Session: https://cmux.com/deeplink/agent?id=aid-1a293c23a59e24572f4b
![Fix with [code]smith](https://pr-comments-assets.blacksmith.sh/codesmith/fix-with-codesmith-light-3x.png)
Batch B2 closes the remaining overlay-host and app-harness windows that outlived their tests. This follows Leo's instruction: "But why do you guys not just clean up after yourselves, or at least do your best to?"
A closing window now tears down an overlay host created during the close, and the Menu Key Routing, Multi Window Input Routing, and related harnesses close the app-owned windows they create. This branch is stacked after the merged overlay-host fix.
No capture: no visible change; these changes only close hidden panels and test windows after their owner closes.
Agent session: agent session
Carry: merged with feat-cmux-next, review BLOCK fixed (head 2e607e3)
The earlier lane went quiet, so this was carried to the finish.
feat-cmux-next. Since B2 was opened, base landed most of this cleanup itself: cmux-next: enforce window cleanup trait coverage #27236 put.closesItsWindowson these suites and closes their windows (closeAfterTest,putAway,tearDown), and carry of #27257: close batch B1 test windows #28091 (B1) landed the daemon-owner teardown. Every conflict (includingDaemonConnection.swiftandDaemonPrestart.swift) takes base. B2 copies that duplicated base were removed: a secondshutdownConnectionAndWait, secondclose()helpers and duplicate imports would otherwise not compile. What B2 still adds over base:AppHarnessWindows(closes the app-harness windows and page panels anAppServicestest opened), the cross-machine harness teardown (both daemon owners reaped, windows and palette closed, state removed only once reaped), the palette Settings test closing its panel, and.closesItsWindowsonMoveToNewWindowTests,StashTests,PageFullscreenWholeScreenTestsandPaletteSettingWriteTests.BackgroundAccessoryPolicyTests.aWindowClosedBeforeTheRestoreFinishesStaysClosedred. fix(windows): a window closed during launch stays closed when the restore's workspace is reported late #31155 found and fixed the cause on base: the restore's workspace being reported late. fix(windows): a window closed during launch stays closed when the restore's workspace is reported late #31155 replacedclosedDuringRestorewithRestoreClosedWindows. Keeping its design, nothing here changesWindowManagerorWindowHandlers.noteUserCloserecorded the close before the window's delegate decided, so a cancelled incognito confirmation during the restore left the window remembered as closed and torn down). That code is gone. Base records a close only inwindowWillClose, after AppKit carries it out. New testBackgroundAccessoryPolicyTests.aCloseTheWindowRefusesDuringTheRestoreKeepsItOpenkeeps it that way: during the restore, Close All Windows meets a window that refuses its close, as a cancelled confirmation does. The window must stay open,restoreClosedmust stay empty, and the restore must end with an open window.Testing
cmux-ci run --class light --script scripts/ci/package-test-lane.sh --ref <sha> --arg suite --arg Packages/macOS/CmuxNext --arg <suites>aCloseTheWindowRefusesDuringTheRestoreKeepsItOpenfailed at BackgroundAccessoryPolicyTests.swift:160, 161, 167: the refused close was inrestoreClosed, was remembered as the closed launch window, and the restore ended with no open window.BackgroundAccessoryPolicyTests(all 4 tests, including the new one andaWindowClosedBeforeTheRestoreFinishesStaysClosed),CrossMachineTabMoveTests,MenuKeyRoutingTests,MoveToNewWindowTests,MultiWindowInputRoutingTests,PageFullscreenWholeScreenTests,PaletteSettingWriteTests,PasswordImportConflictTestsandStashTestspassed.WindowCleanupCoverageTestsfailed onNewTabHoldCancellationTests.swift:5andAAProfileMenuGalleryTests.swift:15. This PR does not touch those files, and on base they lack.closesItsWindowsthe same way, so it is a base red.Observed / Not run
prepush-gate.pyreports no new violations.RestoreClosedWindowsTests(the step filter named the wrong target, so it matched nothing; this PR does not change it); a fullCmuxNextAppTestsrun; the five-step window census (the table above stays pending).Changelog
none
🤖 Generated with Claude Code
Agent session: agent session