hermes-agent/website/docs/reference
Teknium 4b8272f549
feat(browser): add browser_dialog for native JS dialog handling
Ergonomic wrapper over CDP's Page.handleJavaScriptDialog that accepts
or dismisses alert/confirm/prompt/beforeunload dialogs blocking a page.
Unsticks pages whose JS thread is frozen by an unhandled dialog —
symptom is that browser_snapshot, browser_console, browser_click etc.
start hanging or erroring.

- action='accept'|'dismiss' required; prompt_text optional for prompt()
- target_id auto-resolves when exactly one page tab is open; with
  multiple page tabs, errors with the tab list so the agent picks one
- Shares browser_cdp's check_fn gate — only appears when CDP is
  reachable (/browser connect or browser.cdp_url in config). Hidden
  otherwise so backends that can't use it don't see it.
- Safe as a probe: CDP returns a clean 'No dialog is showing' error
  when nothing's pending, which we pass through verbatim

Dialog detection (knowing a dialog is open without being told) is NOT
included — it requires persistent CDP subscriptions per session, a
larger architectural change. Documented as a follow-up; agents infer
from symptoms and use this tool to recover.

Tests: 11 new unit tests against mock CDP server covering the wrapper
(action validation, auto-resolve with 0/1/multiple page targets,
explicit target_id accept/dismiss flow, prompt_text passthrough, shared
gate with browser_cdp, registry dispatch). E2E probe case against real
headless Chrome passes. Positive-case real-Chrome E2E is blocked by
Chromium's headless auto-dismiss behavior when no persistent listener
is attached — unit tests exercise the exact CDP protocol we send, so
the handling path is protocol-verified; headful real-browser usage
(the actual /browser connect case) keeps dialogs alive via the Chrome
UI.
2026-04-19 05:20:51 -07:00
..
_category_.json feat: add documentation website (Docusaurus) 2026-03-05 05:24:55 -08:00
cli-commands.md docs: correctness audit — fix wrong values, add missing coverage (#11972) 2026-04-18 01:45:48 -07:00
environment-variables.md docs: correctness audit — fix wrong values, add missing coverage (#11972) 2026-04-18 01:45:48 -07:00
faq.md docs: correctness audit — fix wrong values, add missing coverage (#11972) 2026-04-18 01:45:48 -07:00
mcp-config-reference.md docs: comprehensive documentation audit — fix 9 HIGH, 20+ MEDIUM gaps (#4087) 2026-03-30 17:15:21 -07:00
optional-skills-catalog.md chore(skills): touchdesigner-mcp follow-ups 2026-04-18 17:43:42 -07:00
profile-commands.md docs: fix 30+ inaccuracies across documentation (#9023) 2026-04-13 10:53:10 -07:00
skills-catalog.md chore(skills): touchdesigner-mcp follow-ups 2026-04-18 17:43:42 -07:00
slash-commands.md docs: correctness audit — fix wrong values, add missing coverage (#11972) 2026-04-18 01:45:48 -07:00
tools-reference.md feat(browser): add browser_dialog for native JS dialog handling 2026-04-19 05:20:51 -07:00
toolsets-reference.md feat(browser): add browser_dialog for native JS dialog handling 2026-04-19 05:20:51 -07:00