Skip to content

fix: skip parent-process watchdog in headed mode#857

Open
schobiDotDev wants to merge 1 commit intogarrytan:mainfrom
schobiDotDev:fix/headed-mode-parent-watchdog
Open

fix: skip parent-process watchdog in headed mode#857
schobiDotDev wants to merge 1 commit intogarrytan:mainfrom
schobiDotDev:fix/headed-mode-parent-watchdog

Conversation

@schobiDotDev
Copy link
Copy Markdown

Problem

When using $B connect (headed mode), the browse server crashes after ~15 seconds, closing the browser window unexpectedly.

Root Cause

The Parent-Process Watchdog in browse/src/server.ts (line 706-715) polls the parent PID every 15 seconds and shuts down the server when the spawning CLI process exits. This is correct behavior for headless mode, but in headed mode the user has explicitly connected to a visible browser - the server should stay alive regardless of what happens to the CLI command that launched it.

The idle check (line 690-698) already has a headed-mode guard:

if (browserManager.getConnectionMode() === 'headed') return;

But the parent-process watchdog was missing this same guard.

Fix

Add a headed-mode check to the parent-process watchdog, matching the existing pattern used in the idle check:

if (browserManager.getConnectionMode() === 'headed') return;

This skips the parent PID existence check when in headed mode, so the server stays alive until the user explicitly disconnects or closes the browser window.

Testing

Tested and confirmed working - headed browser no longer closes after 15 seconds when the launching CLI command exits.

@taya-tendo
Copy link
Copy Markdown

Super happy to see this was identified and is already being addressed, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants