Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

fix: sessions shows CDP URL for cloud sessions too

ShawnPanab1522b5e23d6
diff --git a/browser_use/skill_cli/daemon.py b/browser_use/skill_cli/daemon.py
index 6436dc6ac..f7db498e3 100644
--- a/browser_use/skill_cli/daemon.py
+++ b/browser_use/skill_cli/daemon.py
@@ -264,6 +264,10 @@ class Daemon:
# Handle ping — returns daemon config for mismatch detection
if action == 'ping':
+ # Return live CDP URL (may differ from constructor arg for cloud sessions)
+ live_cdp_url = self.cdp_url
+ if self._session and self._session.browser_session.cdp_url:
+ live_cdp_url = self._session.browser_session.cdp_url
return {
'id': req_id,
'success': True,
@@ -272,7 +276,7 @@ class Daemon:
'pid': os.getpid(),
'headed': self.headed,
'profile': self.profile,
- 'cdp_url': self.cdp_url,
+ 'cdp_url': live_cdp_url,
'use_cloud': self.use_cloud,
},
}
diff --git a/browser_use/skill_cli/main.py b/browser_use/skill_cli/main.py
index 72ae4389e..ebc11322d 100755
--- a/browser_use/skill_cli/main.py
+++ b/browser_use/skill_cli/main.py
@@ -1006,8 +1006,9 @@ def _handle_sessions(args: argparse.Namespace) -> int:
if data.get('profile'):
config_parts.append(f'profile={data["profile"]}')
if data.get('cdp_url'):
- config_parts.append('cdp')
entry['cdp_url'] = data['cdp_url']
+ if not data.get('use_cloud'):
+ config_parts.append('cdp')
if data.get('use_cloud'):
config_parts.append('cloud')
entry['config'] = ', '.join(config_parts) if config_parts else 'headless'