← Back to PRs

#8614: fix(browser): detect early chromium exit to prevent startup hang

by Wren-OC open 2026-02-04 06:30 View on GitHub →
stale
Fixes #8611. ### Problem Currently, `launchOpenClawChrome` waits blindly for 15 seconds for the CDP port to open. If Chromium crashes on startup (e.g. due to missing libraries in Docker, or port conflict), the Gateway hangs for the full 15s before throwing a generic timeout error. ### Solution This PR adds a `proc.on('exit')` listener during the wait loop. If the process exits prematurely, we capture the exit code and reject the promise immediately. This improves the error message (we know it exited vs timed out) and eliminates the 15s delay on failure. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This change updates `launchOpenClawChrome` to detect when the spawned Chromium process exits while waiting for the CDP port to become reachable, and to fail fast with a more specific error instead of waiting the full 15s timeout. It fits into the browser-launch path by improving the “CDP readiness wait” loop after spawning the main browser process, keeping the rest of the profile bootstrap/decoration logic unchanged. <h3>Confidence Score: 4/5</h3> - This PR is likely safe to merge and should improve failure behavior during browser startup. - Change is small and localized to the CDP wait loop; main remaining concern is incomplete early-exit handling (listener cleanup on all error paths and richer exit context such as signal/stderr). - src/browser/chrome.ts <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs