Skip to content

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

refactor: adjust timeouts for step execution and retry logic

Magnus Müllerdccff73b1713
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.py
index cfe550e3a..125584af2 100644
--- a/browser_use/agent/service.py
+++ b/browser_use/agent/service.py
@@ -1251,7 +1251,7 @@ class Agent(Generic[Context, AgentStructuredOutput]):
step_info = AgentStepInfo(step_number=step, max_steps=max_steps)
await asyncio.wait_for(
self.step(step_info),
- timeout=60, # 2 minute step timeout - less aggressive
+ timeout=120, # 2 minute step timeout - less aggressive
)
self.logger.debug(f'✅ Completed step {step + 1}/{max_steps}')
diff --git a/browser_use/browser/session.py b/browser_use/browser/session.py
index 4c0815cfb..1e7a7f901 100644
--- a/browser_use/browser/session.py
+++ b/browser_use/browser/session.py
@@ -699,7 +699,7 @@ class BrowserSession(BaseModel):
@retry(
wait=1, # wait 1s between attempts
- retries=3, # 3 attempts
+ retries=2, # 3 attempts
timeout=15, # 15 second reasonable timeout
semaphore_name='screenshot_global',
semaphore_limit=3, # only 3 concurrent screenshots at a time total on the entire machine (ideally)