From 5acfc64d1e4190d764e50cbdea4b9d586c7b67d9 Mon Sep 17 00:00:00 2001 From: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Date: Sun, 15 Mar 2026 20:47:19 -0700 Subject: [PATCH] fix(browse): use CDP websocket fallback on Windows Bun's pipe transport hangs when Playwright launches Chromium on Windows (#77). Detect Windows and pass --remote-debugging-port=0 to use websocket transport instead. macOS/Linux behavior is unchanged. Co-Authored-By: Claude Opus 4.6 --- browse/src/browser-manager.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/browse/src/browser-manager.ts b/browse/src/browser-manager.ts index f684ce1..9ece9d3 100644 --- a/browse/src/browser-manager.ts +++ b/browse/src/browser-manager.ts @@ -42,7 +42,18 @@ export class BrowserManager { private dialogPromptText: string | null = null; async launch() { - this.browser = await chromium.launch({ headless: true }); + const isWindows = process.platform === 'win32'; + + if (isWindows) { + // Bun's pipe transport hangs on Windows (garrytan/gstack#77). + // Use websocket transport instead of the default pipe. + this.browser = await chromium.launch({ + headless: true, + args: ['--remote-debugging-port=0'], + }); + } else { + this.browser = await chromium.launch({ headless: true }); + } // Chromium crash → exit with clear message this.browser.on('disconnected', () => {