fix: update browser command connection instructions to prevent session conflicts

- Clarified the usage of the --cdp flag when connecting to an existing Browserbase session.
- Emphasized the importance of not using --session with --cdp to avoid creating a local browser instance in agent-browser >=0.13.
- Updated comments to reflect changes in per-task isolation management with AGENT_BROWSER_SOCKET_DIR.
This commit is contained in:
teknium1
2026-02-21 00:54:01 -08:00
parent 7283b9f6cf
commit a54a27595b

View File

@@ -717,12 +717,13 @@ def _run_browser_command(
except Exception as e:
return {"success": False, "error": f"Failed to create browser session: {str(e)}"}
# Connect via CDP to our pre-created Browserbase session (with proxies)
# Use --cdp flag to connect to existing session instead of creating new one
# Connect via CDP to our pre-created Browserbase session.
# IMPORTANT: Do NOT use --session with --cdp. In agent-browser >=0.13,
# --session creates a local browser instance and silently ignores --cdp.
# Per-task isolation is handled by AGENT_BROWSER_SOCKET_DIR instead.
cmd_parts = browser_cmd.split() + [
"--session", session_info["session_name"],
"--cdp", session_info["cdp_url"], # Connect to our proxied session
"--json", # Always request JSON output
"--cdp", session_info["cdp_url"],
"--json",
command
] + args