From 080eeae62a40147ef491d66bd2bd22524c099b9f Mon Sep 17 00:00:00 2001 From: ShawnPana Date: Wed, 1 Apr 2026 21:39:51 -0700 Subject: [PATCH] fix: CI type errors and test compatibility - type: ignore on each param line in sessions.py (pyright per-line) - Remove ActionHandler assert in browser.py (breaks pre-existing tests) - Ruff format --- browser_use/skill_cli/commands/browser.py | 1 - browser_use/skill_cli/python_session.py | 4 +--- browser_use/skill_cli/sessions.py | 7 +++++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/browser_use/skill_cli/commands/browser.py b/browser_use/skill_cli/commands/browser.py index 781b2ccdd..380f41197 100644 --- a/browser_use/skill_cli/commands/browser.py +++ b/browser_use/skill_cli/commands/browser.py @@ -82,7 +82,6 @@ async def handle(action: str, session: SessionInfo, params: dict[str, Any]) -> A """Handle browser control command.""" bs = session.browser_session actions = session.actions - assert actions is not None, 'ActionHandler must be set on SessionInfo' if action == 'open': url = params['url'] diff --git a/browser_use/skill_cli/python_session.py b/browser_use/skill_cli/python_session.py index 09b5fc513..e96cc0b96 100644 --- a/browser_use/skill_cli/python_session.py +++ b/browser_use/skill_cli/python_session.py @@ -121,9 +121,7 @@ class BrowserWrapper: Runs coroutines on the server's event loop using run_coroutine_threadsafe. """ - def __init__( - self, session: 'BrowserSession', loop: asyncio.AbstractEventLoop, actions: 'ActionHandler' - ) -> None: + def __init__(self, session: 'BrowserSession', loop: asyncio.AbstractEventLoop, actions: 'ActionHandler') -> None: self._session = session self._loop = loop self._actions = actions diff --git a/browser_use/skill_cli/sessions.py b/browser_use/skill_cli/sessions.py index eb8825fc3..c41020980 100644 --- a/browser_use/skill_cli/sessions.py +++ b/browser_use/skill_cli/sessions.py @@ -101,5 +101,8 @@ async def create_browser_session( raise RuntimeError('\n'.join(lines)) return CLIBrowserSession( - executable_path=chrome_path, user_data_dir=user_data_dir, profile_directory=profile_directory, headless=not headed - ) # type: ignore[call-arg] + executable_path=chrome_path, # type: ignore[call-arg] + user_data_dir=user_data_dir, # type: ignore[call-arg] + profile_directory=profile_directory, # type: ignore[call-arg] + headless=not headed, # type: ignore[call-arg] + )