feat(config): add browser.headed toggle with dashboard UI and AGENT_BROWSER_HEADED wiring - #25653
feat(config): add browser.headed toggle with dashboard UI and AGENT_BROWSER_HEADED wiring#25653Black0Fox0 wants to merge 1 commit into
Conversation
|
Overlaps with existing #13433 (feat(browser): add headed mode config for local browser visibility). Both add a headed/headless config toggle for the local browser. This PR additionally wires the dashboard UI and |
…ROWSER_HEADED wiring Add a `browser.headed` config option (default: false) that controls whether the local Chromium runs in headed (visible) or headless mode. Changes: - hermes_cli/config.py: Add "headed": False to the browser section of DEFAULT_CONFIG — the dashboard auto-discovers it from the schema. - hermes_cli/web_server.py: Add schema override so the toggle renders with a proper description in the dashboard browser config section. - tools/browser_tool.py: When headed=true in local (non-CDP/non-Camofox) mode, set AGENT_BROWSER_HEADED=true so agent-browser launches a visible browser window. The toggle appears at /config in the Browser section (now 11 fields). Aligns with PR NousResearch#13433 naming convention (headed config key).
e6b229d to
83b369a
Compare
teknium1
left a comment
There was a problem hiding this comment.
Thanks for carrying the headed-mode configuration through the dashboard and local subprocess path. The feature remains needed on current main: hermes_cli/config.py:1267-1305 has no browser.headed option, while tools/browser_tool.py:2381-2450 is the live environment/spawn path.
Problems
- The PR changes no tests, although its behavior is an environment mutation immediately before
subprocess.Popen; existing runner-path tests are undertests/tools/test_browser_lightpanda.py. website/docs/user-guide/configuration.md:1772-1789documents the browser config block but would not document the new setting.- The new raw-config condition uses Python truthiness.
read_raw_config()intentionally returns raw YAML (hermes_cli/config.py:6642-6648), soheaded: "false"would be truthy. Existing boolean-like browser config usesis_truthy_valueattools/browser_tool.py:3457-3460.
Suggested changes
- Add local/CDP/Camofox environment-wiring tests.
- Normalize the raw value with
is_truthy_value. - Document the setting and its local-only scope.
Automated hermes-sweeper review.
| try: | ||
| from hermes_cli.config import read_raw_config | ||
| _cfg = read_raw_config() | ||
| if _cfg.get("browser", {}).get("headed", False): |
There was a problem hiding this comment.
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.
|
Partially merged, remainder in flight — closing this PR in favor of the two pieces:
Thanks — the dashboard toggle was the piece nobody else in this cluster thought of. |
Salvaged from PR #25653 by @Black0Fox0 — the config-key and env-wiring halves of that PR landed via #67018; this carries the surviving dashboard schema override so browser.headed renders as a labeled boolean toggle. Description updated to reflect the merged cleanup-skip behavior.
Salvaged from PR NousResearch#25653 by @Black0Fox0 — the config-key and env-wiring halves of that PR landed via NousResearch#67018; this carries the surviving dashboard schema override so browser.headed renders as a labeled boolean toggle. Description updated to reflect the merged cleanup-skip behavior.
Summary
Add a
browser.headedconfig option (default:false) that controls whether the local Chromium runs in headed (visible window) or headless mode.Aligns with naming from PR #13433 (
headedconfig key).Changes
hermes_cli/config.py— Added"headed": Falseto thebrowsersection ofDEFAULT_CONFIG. The dashboard auto-discovers it from the schema.hermes_cli/web_server.py— Added a schema override with a proper description so the toggle renders correctly in the dashboard browser config section.tools/browser_tool.py— Whenheaded: truein local (non-CDP/non-Camofox) mode, setsAGENT_BROWSER_HEADED=truein the subprocess environment so agent-browser launches a visible browser window.Key difference from PR #13433
AGENT_BROWSER_HEADEDenv var (the canonical agent-browser env var) instead of the--headedCLI flagTesting
browser.headedfield with a switch toggle.headed: trueto~/.hermes/config.yaml.AGENT_BROWSER_HEADED=trueon the next browser command (local mode only, not CDP/Camofox).