From a54a27595bf4223c63e95bbd64e2083c5f34ec34 Mon Sep 17 00:00:00 2001 From: teknium1 Date: Sat, 21 Feb 2026 00:54:01 -0800 Subject: [PATCH] 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. --- tools/browser_tool.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/browser_tool.py b/tools/browser_tool.py index 63a93a509..63a8d6b83 100644 --- a/tools/browser_tool.py +++ b/tools/browser_tool.py @@ -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