Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions hermes_cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,10 @@ def _ensure_hermes_home_managed(home: Path):
"command_timeout": 30, # Timeout for browser commands in seconds (screenshot, navigate, etc.)
"record_sessions": False, # Auto-record browser sessions as WebM videos
"allow_private_urls": False, # Allow navigating to private/internal IPs (localhost, 192.168.x.x, etc.)
# Run browser in headed mode (visible window). When disabled,
# the browser runs headless (no visible window).
# This directly sets AGENT_BROWSER_HEADED env var.
"headed": False,
# Browser engine for local mode. Passed as ``--engine <value>`` to
# agent-browser v0.25.3+.
# "auto" — use Chrome (default, don't pass --engine at all)
Expand Down
4 changes: 4 additions & 0 deletions hermes_cli/web_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,10 @@ async def auth_middleware(request: Request, call_next):
"description": "Reasoning effort for delegated subagents",
"options": ["", "low", "medium", "high"],
},
"browser.headed": {
"type": "boolean",
"description": "Run browser in headed mode (visible window). Enable to show a visible browser window via AGENT_BROWSER_HEADED.",
},
}

# Categories with fewer fields get merged into "general" to avoid tab sprawl.
Expand Down
11 changes: 11 additions & 0 deletions tools/browser_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1859,6 +1859,17 @@ def _run_browser_command(
browser_env["PATH"] = _merge_browser_path(browser_env.get("PATH", ""))
browser_env["AGENT_BROWSER_SOCKET_DIR"] = task_socket_dir

# Honor browser.headed config — when enabled, show a visible
# browser window so the user can watch what the agent is doing.
if not session_info.get("cdp_url") and not _is_camofox_mode():
try:
from hermes_cli.config import read_raw_config
_cfg = read_raw_config()
if _cfg.get("browser", {}).get("headed", False):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

read_raw_config() returns unvalidated YAML, so a manually written headed: "false" is truthy and enables headed mode. Please use the existing is_truthy_value helper (as in the browser unsafe-evaluate setting) and add a regression test.

browser_env["AGENT_BROWSER_HEADED"] = "true"
except Exception:
pass

# Tell the agent-browser daemon to self-terminate after being idle
# for our configured inactivity timeout. This is the daemon-side
# counterpart to our Python-side _cleanup_inactive_browser_sessions
Expand Down