Description
The AGENT_BROWSER_CDP environment variable is supported by the native Rust daemon's auto_launch function (cli/src/native/actions.rs:731), but the Node.js daemon's auto-launch path in daemon.ts ignores it entirely.
Reproduction
- Start Chrome with
--remote-debugging-port=9222
- Run
AGENT_BROWSER_CDP=9222 agent-browser snapshot -i
- Expected: agent-browser connects to existing Chrome and snapshots the current tab
- Actual: agent-browser launches a new Chromium with
about:blank
Root Cause
In src/daemon.ts, the auto-launch code path (when no explicit launch command has been sent) doesn't check process.env.AGENT_BROWSER_CDP. The native Rust daemon handles this correctly at cli/src/native/actions.rs:731.
Environment
- agent-browser v0.16.1
- Node.js daemon (default)
- Linux