mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-08 08:11:38 +00:00
feat: auto-launch Chromium-family browser for CDP
Add browser CDP launch candidates for Chrome, Chromium, Brave, and Edge while preserving Chrome-first selection. Retry candidate launch failures instead of giving up after the first executable. Update /browser CLI and TUI messaging, docs, and tool descriptions from Chrome-only wording to Chromium-family browser support. Add regression coverage for Brave/Edge paths, Chrome-first precedence, fallback launches, and CDP endpoint probing.
This commit is contained in:
parent
340d2b6de0
commit
697d38a3f4
19 changed files with 373 additions and 149 deletions
|
|
@ -6087,17 +6087,17 @@ def _failure_messages(url: str, port: int, system: str) -> list[str]:
|
|||
|
||||
command = manual_chrome_debug_command(port, system)
|
||||
hint = (
|
||||
["Start Chrome with remote debugging, then retry /browser connect:", command]
|
||||
["Start a Chromium-family browser with remote debugging, then retry /browser connect:", command]
|
||||
if command
|
||||
else [
|
||||
"No Chrome/Chromium executable was found in this environment.",
|
||||
f"Install one or start Chrome with --remote-debugging-port={port}, then retry /browser connect.",
|
||||
"No supported Chromium-family browser executable was found in this environment.",
|
||||
f"Install one or start a Chromium-family browser with --remote-debugging-port={port}, then retry /browser connect.",
|
||||
]
|
||||
)
|
||||
return [
|
||||
f"Chrome is not reachable at {url}.",
|
||||
f"Browser CDP is not reachable at {url}.",
|
||||
*hint,
|
||||
"Browser not connected — start Chrome with remote debugging and retry /browser connect",
|
||||
"Browser not connected — start a Chromium-family browser with remote debugging and retry /browser connect",
|
||||
]
|
||||
|
||||
|
||||
|
|
@ -6183,7 +6183,7 @@ def _browser_connect(rid, params: dict) -> dict:
|
|||
from hermes_cli.browser_connect import try_launch_chrome_debug
|
||||
|
||||
announce(
|
||||
"Chrome isn't running with remote debugging — attempting to launch..."
|
||||
"Chromium-family browser isn't running with remote debugging — attempting to launch..."
|
||||
)
|
||||
|
||||
if try_launch_chrome_debug(port, system):
|
||||
|
|
@ -6194,7 +6194,7 @@ def _browser_connect(rid, params: dict) -> dict:
|
|||
break
|
||||
|
||||
if ok:
|
||||
announce(f"Chrome launched and listening on port {port}")
|
||||
announce(f"Chromium-family browser launched and listening on port {port}")
|
||||
else:
|
||||
for line in _failure_messages(url, port, system)[1:]:
|
||||
announce(line, level="error")
|
||||
|
|
@ -6204,7 +6204,7 @@ def _browser_connect(rid, params: dict) -> dict:
|
|||
elif not ok:
|
||||
return _err(rid, 5031, f"could not reach browser CDP at {url}")
|
||||
elif _is_default_local_cdp(parsed):
|
||||
announce(f"Chrome is already listening on port {port}")
|
||||
announce(f"Chromium-family browser is already listening on port {port}")
|
||||
|
||||
normalized = _normalize_cdp_url(parsed)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue