Skip to content

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

fix linter

Nick Sweetinga1ce6ed5c22b
diff --git a/browser_use/sync/service.py b/browser_use/sync/service.py
index 2d0b99a1f..df989df91 100644
--- a/browser_use/sync/service.py
+++ b/browser_use/sync/service.py
@@ -36,10 +36,11 @@ class CloudSync:
self.session_id = str(event.id) # type: ignore
# Start authentication flow on first step (after first LLM response)
- if event.event_type == 'CreateAgentStepEvent' and hasattr(event, 'step'):
- logger.debug(f'Got CreateAgentStepEvent with step={event.step}')
+ if event.event_type == 'CreateAgentStepEvent' and 'step' in dict(event):
+ step = dict(event)['step']
+ logger.debug(f'Got CreateAgentStepEvent with step={step}')
# Only trigger on the first step (step=2 because n_steps is incremented before actions)
- if event.step == 2 and self.enable_auth and self.auth_client and not self.auth_client.is_authenticated:
+ if step == 2 and self.enable_auth and self.auth_client and not self.auth_client.is_authenticated:
if not hasattr(self, 'auth_task') or self.auth_task is None:
# Start auth in background
if self.session_id: