Skip to content

feat(browser): --auditable session + inspect command (CDP bridge)#1

Open
dgouvea wants to merge 1 commit into
mainfrom
conductor/BRW-cdp
Open

feat(browser): --auditable session + inspect command (CDP bridge)#1
dgouvea wants to merge 1 commit into
mainfrom
conductor/BRW-cdp

Conversation

@dgouvea

@dgouvea dgouvea commented Jun 21, 2026

Copy link
Copy Markdown
Member

What

Adds a CDP bridge so an external tool can audit an authenticated browser session.

  • aux4 browser open --auditable true — launches the session as a Playwright persistent context exposing a Chrome remote-debugging port (instead of the normal isolated context). Normal sessions are unchanged.
  • aux4 browser inspect --session <id> — prints a one-line handshake {"url":"...","port":<n>} to stdout.

Why

Normal sessions run in an isolated context, so an external Chrome tool (e.g. Lighthouse) attaching via CDP would land in the default context and only ever see a logged-out page. A persistent context shares one profile, so an attaching tool inherits the session's cookies and localStorage.

Pairs with (no dependency)

aux4/lighthouse gains --fromBrowser, which consumes this handshake:

SID=$(aux4 browser open --auditable true --url https://app/login)
# ...log in...
aux4 browser inspect --session $SID | aux4 lighthouse audit --fromBrowser true

The two packages share no .aux4 dependency — they only meet at the shell pipe.

Verification

  • aux4 lint run passes (one pre-existing playbook:actions warning, unrelated).
  • inspect 3/3 and open 3/3 .test.md pass.
  • Verified live end-to-end against an auth-gated server: Lighthouse's request to the gated page carried the session's auth cookie (authCookie=PRESENT, no /login bounce), confirming auth carries through the bridge.

🤖 Generated with Claude Code

Opening a session with --auditable true launches it as a persistent
context exposing a Chrome remote-debugging port. The new 'inspect'
command prints a {url,port} handshake so an external CDP tool (e.g.
aux4 lighthouse --fromBrowser) can attach to the authenticated session
and inherit its cookies and localStorage. Normal isolated sessions are
unchanged.
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