fix(browser): avoid bogus Chrome launch fallback

Detect an actual Chrome/Chromium executable before printing a manual CDP launch command, including common WSL-mounted Windows browser paths, so /browser connect does not suggest google-chrome when it is unavailable.
This commit is contained in:
Brooklyn Nicholson 2026-04-28 22:18:41 -05:00 committed by Teknium
parent f10a3df632
commit 69ff114ee2
5 changed files with 69 additions and 24 deletions

View file

@ -4762,10 +4762,18 @@ def _is_default_local_cdp(parsed) -> bool:
def _browser_connect_error(url: str, port: int) -> str:
from hermes_cli.browser_connect import manual_chrome_debug_command
command = manual_chrome_debug_command(port)
if not command:
return (
f"Chrome is not reachable at {url}. "
"No Chrome/Chromium executable was found in this environment; "
f"install one or start Chrome with --remote-debugging-port={port}, then retry /browser connect."
)
return (
f"Chrome is not reachable at {url}. "
"Start Chrome with remote debugging, then retry /browser connect:\n"
f"{manual_chrome_debug_command(port)}"
f"{command}"
)