Skip to content

fix(omnio): scope browser clients to conversations - #54

Merged
ppazosp merged 1 commit into
mainfrom
omnio/browser-session-client
Aug 3, 2026
Merged

fix(omnio): scope browser clients to conversations#54
ppazosp merged 1 commit into
mainfrom
omnio/browser-session-client

Conversation

@ppazosp

@ppazosp ppazosp commented Jul 31, 2026

Copy link
Copy Markdown

This is the Hermes client layer of the conversation-browser isolation work. It makes the stable Hermes session id the browser identity at every CDP, recovery, and cleanup boundary. Omnia-side browser ownership and process isolation land separately; background jobs and file paths are higher layers in this stack.

Conversation-scoped browser client

Hermes consumes an additive BROWSER_CDP_URL_TEMPLATE and expands it with the current API session id. The same identity is sent to Toolbox recovery calls, so delegated tasks remain inside their parent conversation rather than creating another browser owner.

  • tools/browser_tool.py resolves the session-aware endpoint before the legacy static override and scopes recovery headers to HERMES_SESSION_ID.
  • tools/browser_cdp_tool.py attaches page-domain commands only when one unambiguous page exists; callers must provide target_id when several pages exist.
  • tools/browser_camofox.py yields to the Omnio template just as it already yielded to the static CDP override.
  • website/docs/reference/environment-variables.md documents the new template contract.

Safe cleanup and recovery

Provider-owned Chrome processes are no longer closed by an idle agent-browser daemon. Hermes stops only its verified local daemon and leaves Chrome lifecycle ownership with Toolbox or the cloud provider. Snapshot and vision failures use the same scoped recovery contract and return a structured reset result that tells the agent to navigate again.

Backward compatibility

Backward compatible. New Hermes uses BROWSER_CDP_URL_TEMPLATE when new Omnia supplies it and falls back to the existing BROWSER_CDP_URL against old Omnia. Old Hermes continues to use the legacy endpoint exposed by new Omnia. No persisted data or required request field changes.

Dependencies and go-live

The stronger isolation requires the paired Omnia browser-runtime stack. Either side can deploy first: mixed versions remain functional but retain legacy Brand-scoped browser sharing until both sides are present and the Sprite is reprovisioned.

Verification

  • scripts/run_tests.sh tests/tools/test_browser_cdp_override.py tests/tools/test_browser_cdp_tool.py tests/tools/test_browser_cleanup.py tests/tools/test_browser_resilience.py — 82 passed.
  • Ruff passed for every changed Python file in this layer.
  • git diff --check main...HEAD passed.
  • Real Sprite: two conversations for the same Brand received distinct browser contexts and live Chrome processes; force-killing the first conversation's process left the second ready and usable.
  • All required GitHub checks passed on 0fb20d9e67e6ada9beb51af90eda35a600c5e5ce.

Prepared with Codex.

@ppazosp
ppazosp marked this pull request as ready for review August 1, 2026 10:56
@ppazosp
ppazosp merged commit 435ba17 into main Aug 3, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant