fix(browser): keep CDP target stable across commands - #83274
Open
brandonwadepackard-cell wants to merge 1 commit into
Open
fix(browser): keep CDP target stable across commands#83274brandonwadepackard-cell wants to merge 1 commit into
brandonwadepackard-cell wants to merge 1 commit into
Conversation
brandonwadepackard-cell
marked this pull request as ready for review
August 10, 2026 15:32
This was referenced Aug 15, 2026
Contributor
fix(browser): keep CDP target stable across commands
|
7 tasks
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
--cdpsessions now run through a named agent-browser daemon: the daemon isconnected once, and every subsequent command addresses it with--session NAMEinstead of re-attaching one-shot with--cdp <url>per command.tab new --label …) and re-selects it before every command, so Hermes commands stop following whatever Chrome target happens to be active externally.Why
With one-shot
--cdpattachment, agent-browser (>=0.13, observed through 0.26) can attach to the externally-active Chrome target at command time. A long-idle session — or a user switching tabs mid-task — makes consecutive Hermes browser commands land on different targets. Pinning a named daemon plus a dedicated labeled tab keeps the target stable across the whole command sequence.Verification
Behavior-level tests cover: connect-once-then-command, live-daemon detection (no reconnect on reuse), dedicated-tab creation/reselection/close, and secret redaction in timeout/start-error paths.
Notes for review
If a Hermes process restarts while the named daemon survives, the dedicated-tab bookkeeping resets and the code issues a fresh
tab new --label <name>; behavior with a pre-existing identical label follows agent-browser's label semantics. Flagging in case reviewers prefer an explicit select-then-create fallback there.🤖 Generated with Claude Code