fix: skip parent-process watchdog in headed mode#857
Open
schobiDotDev wants to merge 1 commit intogarrytan:mainfrom
Open
fix: skip parent-process watchdog in headed mode#857schobiDotDev wants to merge 1 commit intogarrytan:mainfrom
schobiDotDev wants to merge 1 commit intogarrytan:mainfrom
Conversation
|
Super happy to see this was identified and is already being addressed, thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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:
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.