Skip to content

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

Remove brief delay in agent session initialization to streamline task dispatching

Magnus Müller1f1df8b9bb99
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.py
index 583d01647..25442d0e5 100644
--- a/browser_use/agent/service.py
+++ b/browser_use/agent/service.py
@@ -1461,9 +1461,6 @@ class Agent(Generic[Context, AgentStructuredOutput]):
# Emit CreateAgentSessionEvent at the START of run()
self.eventbus.dispatch(CreateAgentSessionEvent.from_agent(self))
- # Brief delay to ensure session is created in backend before sending task
- await asyncio.sleep(0.2)
-
self.state.session_initialized = True
self.logger.debug('📡 Dispatching CreateAgentTaskEvent...')