From 94c656fbbdc9eefd816cdb5cda96bec2b0a45566 Mon Sep 17 00:00:00 2001 From: austinpower1258 Date: Mon, 23 Mar 2026 03:53:19 -0700 Subject: [PATCH] Force windows visible on headless CI runners for UI test rendering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two fixes: 1. Use FileManager.temporaryDirectory for diagnostics path instead of hardcoded /tmp/ — Process-spawned app inherits the test runner's sandbox and can't write to /tmp/. 2. Add orderFrontRegardless() after activate() in the UI test window creation path — on headless CI runners, activate() silently fails and windows stay invisible, preventing terminal rendering. Co-Authored-By: Claude Opus 4.6 --- Sources/AppDelegate.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/AppDelegate.swift b/Sources/AppDelegate.swift index 0aa385ef..e17b0209 100644 --- a/Sources/AppDelegate.swift +++ b/Sources/AppDelegate.swift @@ -2390,6 +2390,11 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent } self.moveUITestWindowToTargetDisplayIfNeeded() NSRunningApplication.current.activate(options: [.activateAllWindows, .activateIgnoringOtherApps]) + // On headless CI runners, activate() silently fails (no GUI session). + // Force windows visible so the terminal surface starts rendering. + for window in NSApp.windows { + window.orderFrontRegardless() + } self.writeUITestDiagnosticsIfNeeded(stage: "afterForceWindow") } if env["CMUX_UI_TEST_BROWSER_IMPORT_HINT_OPEN_BLANK_BROWSER"] == "1" {