Skip to content

Sidebar test suites close the windows they open (20 suites, 84 windows), with .closesItsWindows - #27126

Merged
teamleaderleo merged 3 commits into
feat-cmux-nextfrom
window-leak-fix-A
Oct 29, 2026
Merged

teamleaderleo merged 3 commits into
feat-cmux-nextfrom
window-leak-fix-A

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Leo, 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?"

The first batch of suite fixes on top of #27003 (the window census and the .closesItsWindows check): the 20 sidebar suites in CmuxNextAppTests that the census named as leaking. Each now closes every window it opens in its own teardown, and carries .closesItsWindows, so a new leak fails that suite by name.

What leaked and why

  • 16 suites ended their tests with window.orderOut(nil), which hides a window but leaves it open in the app's window list: SidebarBackgroundChangeCalm, SidebarCalmMotion, SidebarChannelsAfterHome, SidebarCloseWhileScrolled, SidebarFocusedVisible, SidebarInsertWhileDisplayAsleep, SidebarListTilePress, SidebarNewRowInPlace, SidebarPinnedRowWidth, SidebarRevealSelection, SidebarRowHoverFollow, SidebarRowHoverGap, SidebarRowHoverInset, SidebarSelectionRevealsTop, SidebarUniformRowSpacing. Now close() (with isReleasedWhenClosed = false where the test made the window).
  • SidebarDoneFoldTests: one test never closed its window.
  • SidebarRowsMoveOnRenderServerTests: its restore hid the window, and its "needs a screen" check threw before any teardown ran.
  • SidebarMenuAnchorTests: the group editor's hide() keeps its panel for the next open (deliberate reuse), so the tests now close that panel too.
  • SidebarOneMorphingCardTests: hover card panels stayed as child windows; teardown closes them.
  • SidebarSearchOpensCenteredTests: the palette's hide() keeps its panel (deliberate reuse); teardown closes it.

No product code changes. The row-edge assertion now checks the documented 1.5 pt contract; its old minimum-width assertion contradicted that behavior.

Performance

At head bceb24c8e54cdddc0d857a838df4c72d42bf6027 versus base 39bb822b0f83b92593e93f542b71bfd61fbe1150, the same 20 suite filters each completed with a final summary and exit census on both sides.

metric before after delta harness or run link
Open windows at process exit, summed across 20 filters 84 0 -84 package-test-lane.sh suite; base step 8b4c36d7d222b3a7bb1008c8, head step 038fdffb
Closed but still alive windows, summed across the same filters 24 108 +84 same runs

Observed / Not run

The focused head run completed all 96 test definitions: 19 suites passed; SidebarOneMorphingCardTests completed with two failures. Both goingFromAWorkspaceCardToTheUpdateCardMorphsTheOneCard and goingFromTheUpdateCardToAWorkspaceCardMorphsBackAndParksTheHighlights fail the same size assertions with empty animated-size arrays on base. The shared classifier reports no new focused failure. SidebarRowHoverFollowTests now passes.

Independent source review passed at this head, and the fleet Release compile passed. The broad Swift job was killed after 1500 seconds with exit 143, ten unfinished tests and no final summary. It recorded 1,056 WindowServer-owned windows. That incomplete run is a validation blocker; the focused improvement does not establish full-package cleanup. Complete paired broad validation is pending.

The two No new SwiftUI findings are inherited: the offending ChatColors files, guard and allowlist match base. The sidebar-record warning entered through the CI merge tree. Neither classification waives the incomplete runtime run.

Risk: test-only.

Changelog

none

Agent session: agent session

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?"

Twenty sidebar suites hid their windows with orderOut(nil) or never closed
them, so each one stayed in NSApp.windows for the rest of the test process.
Each test now closes what it opens in its own teardown:

- teardown orderOut(nil) becomes close() (isReleasedWhenClosed = false
  where the test made the window and had not set it);
- SidebarDoneFoldTests closes the window it never closed;
- SidebarRowsMoveOnRenderServerTests closes its window in restore, and
  before the screen require throws;
- SidebarMenuAnchorTests closes the group editor bubble hide() keeps;
- SidebarOneMorphingCardTests closes the hover card window, attached or not;
- SidebarSearchOpensCenteredTests closes the palette panel hide() keeps.

Every fixed suite takes .closesItsWindows, so a new leak fails it by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent-Session: https://cmux.com/deeplink/agent?id=aid-85ca59f74f02d81734c3
@cursor

cursor Bot commented Oct 29, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot 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.

@teamleaderleo

teamleaderleo commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

cmux status (one comment, edited in place; each line is updated by the job that owns it)

Review bceb24c: HQ feed card · gallery before/after runs · checks

App of this head (app.zip, kept 1 day)

gh workflow run reload-build.yml -R manaflow-ai/cmux --ref feat-cmux-next -f tag=pr27126 -f ref=window-leak-fix-A -f platform=macos -f backend_mode=local

red: cmux-next checks (god files, concurrency, crash safety, l10n); no finished base run on 39bb822 to compare; do not merge until green; see lane-rules

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Bead cx-ap79p0 created for this PR by the cmux coordinator.

@github-actions github-actions Bot added the risk:low Risk tier (docs/ci/risk-tiers.md) label Oct 29, 2026
@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex gpt-6-astra high, next-review): SHIP at 720a050

No blocking findings.

@teamleaderleo

teamleaderleo commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator Author

Owned by an agent session · session

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Red-by-red base comparison for 720a050:

  • BackgroundAccessoryPolicyTests, BackgroundWork (ControlTests), CmdNRowSlot, NumberedShortcutPage, PaletteOpenLatency, SidebarCmdNumberTwice, SidebarFooterAlignment, SidebarHoverCardRetargetBench, SidebarTabMiddleClickReopen, TerminalRevealFrame, and WorkspaceGroupPinLive were compared with the same harness at base cb7adb2 and the merged-base A tree. NumberedShortcutPageTests (7 issues), SidebarCmdNumberTwiceTests (2), and SidebarFooterAlignmentTests (18) failed identically on base and A; every other named suite passed on both. These are base reds.
  • The fleet comparison had no crash and the timing-sensitive PaletteOpenLatency suite passed at base and A. No PR-owned red remains.

The broad window run after this PR reported 0 windows open at exit (fleet step e0afb44a3cdb38f7111f3f9f9).

@blacksmith-sh

blacksmith-sh Bot commented Oct 29, 2026

Copy link
Copy Markdown

Found 6 test failures on Blacksmith runners:

Failures

Test View Logs
/tmp/tmp5imnlely/summary-fail.json (live):/summary-fail.json (live): View Logs
/tmp/tmp939qzrsu/summary-missing.json (live):/summary-missing.json (live): View Logs
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows/
[new_workspaces] debug.new_workspace timed 0 of 50 new workspace rows
View Logs
[new_workspaces] the window draws no frames/[new_workspaces] the window draws no frames View Logs
[tabs] debug.tab_switch timed 0 of 40 switches/
[tabs] debug.tab_switch timed 0 of 40 switches
View Logs
[tabs] the window draws no frames/[tabs] the window draws no frames View Logs

Fix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

@teamleaderleo

Copy link
Copy Markdown
Collaborator Author

Review (codex-review-box/gpt-6-astra high, lane-place): SHIP at bceb24c

SHIP

No actionable findings. Window cleanup and the 1.5 pt expectation match the current implementations. AppKit tests could not run in this Linux box without Swift.

@cmux-bot cmux-bot 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.

cmux-bot approves bceb24c: an independent review passed this exact head (review box review-27126-r2 receipt by teamleaderleo). A push needs a new review; a later BLOCK at this head dismisses this approval.

@teamleaderleo
teamleaderleo merged commit d1c4220 into feat-cmux-next Oct 29, 2026
163 of 166 checks passed
@teamleaderleo
teamleaderleo deleted the window-leak-fix-A branch October 29, 2026 23:49
@github-actions

Copy link
Copy Markdown
Contributor

Shipped in:

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

This branch was previously deployed

1 inactive deployment
ci-routing-agent — bceb24c8 Deployed Oct 29, 2026 by teamleaderleo via cmux-tui tree preflight #77781
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:low Risk tier (docs/ci/risk-tiers.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant