Skip to content

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

chore: remove more dead code (second codex pass)

ShawnPanae09f55eedc7c
diff --git a/browser_use/skill_cli/commands/setup.py b/browser_use/skill_cli/commands/setup.py
index 2fcc8e7b4..aeea82173 100644
--- a/browser_use/skill_cli/commands/setup.py
+++ b/browser_use/skill_cli/commands/setup.py
@@ -24,7 +24,7 @@ def _prompt(message: str, yes: bool) -> bool:
return False
-def handle(yes: bool = False, json_output: bool = False) -> dict:
+def handle(yes: bool = False) -> dict:
"""Run interactive setup."""
from browser_use.skill_cli.utils import get_home_dir
diff --git a/browser_use/skill_cli/main.py b/browser_use/skill_cli/main.py
index 90a5d22a8..99857004b 100755
--- a/browser_use/skill_cli/main.py
+++ b/browser_use/skill_cli/main.py
@@ -1182,10 +1182,7 @@ def main() -> int:
if args.command == 'setup':
from browser_use.skill_cli.commands import setup
- result = setup.handle(
- yes=getattr(args, 'yes', False),
- json_output=args.json,
- )
+ result = setup.handle(yes=getattr(args, 'yes', False))
if args.json:
print(json.dumps(result))
diff --git a/browser_use/skill_cli/tunnel.py b/browser_use/skill_cli/tunnel.py
index dd4fe0cfa..0f77fe34f 100644
--- a/browser_use/skill_cli/tunnel.py
+++ b/browser_use/skill_cli/tunnel.py
@@ -73,12 +73,6 @@ class TunnelManager:
'Then retry: browser-use tunnel <port>'
)
- def is_available(self) -> bool:
- """Check if cloudflared is available."""
- if self._binary_path:
- return True
- return shutil.which('cloudflared') is not None
-
def get_status(self) -> dict[str, Any]:
"""Get tunnel capability status for doctor command."""
system_binary = shutil.which('cloudflared')
diff --git a/browser_use/skill_cli/utils.py b/browser_use/skill_cli/utils.py
index d91d16ebd..6bc8f77fa 100644
--- a/browser_use/skill_cli/utils.py
+++ b/browser_use/skill_cli/utils.py
@@ -75,48 +75,6 @@ def get_pid_path(session: str = 'default') -> Path:
return get_home_dir() / f'{session}.pid'
-def is_daemon_alive(session: str = 'default') -> bool:
- """Check daemon liveness by attempting socket connect.
-
- If socket file exists but nobody is listening, removes the stale file.
- """
- import socket
-
- sock_path = get_socket_path(session)
-
- if sock_path.startswith('tcp://'):
- _, hostport = sock_path.split('://', 1)
- host, port_str = hostport.split(':')
- s = None
- try:
- s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- s.settimeout(0.5)
- s.connect((host, int(port_str)))
- return True
- except OSError:
- return False
- finally:
- if s:
- s.close()
- else:
- sock_file = Path(sock_path)
- if not sock_file.exists():
- return False
- s = None
- try:
- s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
- s.settimeout(0.5)
- s.connect(sock_path)
- return True
- except OSError:
- # Stale socket file — remove it
- sock_file.unlink(missing_ok=True)
- return False
- finally:
- if s:
- s.close()
-
-
def find_chrome_executable() -> str | None:
"""Find Chrome/Chromium executable on the system."""
system = platform.system()