Repair main's full macOS suite: package test compile and app-host regressions
Refresh note — 2026-09-21
Refreshed onto current main with a normal forward merge after #13442, #13433, #13207, and the CI landing lane advanced. Already-landed popover and PresentedSurfaceFixture changes were dropped from this PR's diff. The surviving repair set is the current-main full-suite delta: Cloud/workspace behavior, browser/tmux/terminal/test synchronization, and the narrow VM socket-deferral / legacy Codex stop repairs in CLI/cmux.swift. No force update was used.
Main's full macOS suite has been red since the merge queue stopped on 2026-09-20: swift-package-tests could not compile Packages/macOS/CmuxTerminal tests, and every run that executes the app-host shards fails across ~60 suites. Ordinary PR runs skip both (compile-only policy), so this only shows on full-ci PRs such as #13151, whose failures reproduce identically on its merged main SHA. Baseline: the workflow_dispatch CI run on main 0ddc6f406c (https://github.com/manaflow-ai/cmux/actions/runs/35590315251), 126 distinct failing tests across the six shards.
Why so many: until 2026-09-21 the app-host gate only counted xcodebuild's "unexpected" XCTest failures, so ordinary assertion failures were invisible for months (the strict check acedf3f244 reached main via #12053 at 07:22Z; #13178 rejects interrupted runs). Most suites here are stale tests or old regressions. Two other sources: PR #13311 introduced a fresh regression (popover binding write during view update), and merge 38b32bb191 on the issue-2824 branch reverted CLI/cmux.swift and two test files to main's copies while keeping the branch's stricter fixtures.
This PR carries the full-ci label so the shards and every package run here.
Implemented
Package compile and package coverage:
test(terminal): restorePresentedSurfaceFixture()in the renderer callback tests; the package job is green on this PR. The eight packages the aborted job never reached pass locally (swift teston AgentJournal, AgentLaunch, FilePreviewCore, Hive, IrxTransport, SyntaxHighlighting, TerminalCore, Updater).
Production fixes (runtime behavior changes; need dogfood):
fix(popover): stopArrowlessPopoverAnchor.updateNSViewrewriting the presentation binding during view update (#13311 regression).SidebarWorkspaceSwitchLayoutFaultTestspasses in this PR's run.fix(cloud): scopecloseReservedWorkspaceto the cancelled machine's loading cards, keep user content, anchor a last-tab cleanup, and returnwindow_idfromworkspace.cloud_vm_bind(tests from #13202 landed ahead of this code; same behavior as the open #13154).fix(cli): restore deferred socket connection forvm dev|layout|env, explicit SSH control options, and Codex legacy-stop idle observations (c8bfb580ba, clobbered by 38b32bb191).fix(restore): keep a restore identity when the persisted surface id collides; since #13098 a nil id was routed as an interactive Cloud create.
Test-side fixes (stale contracts, fixed-spin timing, fixtures that never passed): plus-menu Cloud shortcuts, Bonsplit chrome colors, tmux mirror pane input, browser discarded-webview restore, CLI integration fixtures (hook acks, Codex rollout evidence, SSH startup scripts, session list), workspace fork/git-branch/config sanitization, terminal focus recovery, shortcut routing, session snapshot and projection identity, terminal direct-interaction timing, browser lifecycle/identity/host-view/loopback bridge/portal rebind, right-sidebar palette, update pill.
Flagged for review: (1) three ssh pty-attach cases now expect only pty_bridge after endpoint establishment per #12726; confirm pre-READY bridge failures were meant to stop reconciling. (2) four WindowBrowserHostViewTests asserting a divider own-and-forward design that never shipped were removed; the stale-frame test is realigned to the shipped pass-through contract.
Evidence so far
Run on the first ten commits (https://github.com/manaflow-ai/cmux/actions/runs/35595109013): distinct failing tests 126 → 101; CLI integration failures 77 → 6 (the last 6 fixed after), CLIVMLayoutEnv 33 → 0, CLIVMDev 4 → 0, NewCloudWorkspaceShortcut 10 → 0, WorkspaceChromeColor 9 → 0, sidebar layout faults 15 → 0, CloudMachineWorkspaceResolution fixed. The seven later commits target most of the remaining 101; the run on the current head is in progress.
Proposed (in progress)
Remaining: remote tmux seed transport, SSH and socket transport suites; Cloud sidebar rename reconciliation, shortcut defaults, sidebar table; Cloud tree/placement/native-drop; terminal portal visibility (workspace reveal sizing, a gated step that only runs once the layout step passes); the fork-probe cancellation race; WorkspaceContentViewVisibilityTests re-evaluation counts; SidebarPointerInteractionScaleTests state-write faults (a production issue); TerminalControllerSocketSecurityTests internal_error vs method_not_found.
Verification
- Package compile fix: local
swift test --package-path Packages/macOS/CmuxTerminal; popover package: localswift build. - Full suite: this PR's CI runs (full-ci) against the main baseline above; per-suite hosted
test-depot.ymlruns were used to bisect and attribute.
🤖 Generated with Claude Code
Summary by CodeRabbit
-
New Features
- Added support for querying panel artifact metadata and thumbnails.
- Workspace-cloud binding responses now include the associated window ID.
- CLI development, layout, and environment commands can run without an immediate connection.
-
Bug Fixes
- Improved cancellation handling to preserve user-added workspace content and terminals.
- Fixed restoration of managed remote terminals when surface identifiers collide.
- Improved Codex session stop and idle-state reporting.
- Corrected shortcut, browser, SSH, terminal focus, and Cloud sidebar behavior.
- Improved Cloud terminal naming and rename conflict handling.
-
Tests
- Expanded regression coverage for cloud workspaces, browser navigation, remote sessions, and socket behavior.