Skip to content

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

Increase multi act timeouts

Magnus Müllerda22746577a7
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.py
index 31bf8264d..191ecbbb9 100644
--- a/browser_use/agent/service.py
+++ b/browser_use/agent/service.py
@@ -777,10 +777,8 @@ class Agent(Generic[Context, AgentStructuredOutput]):
raise e
self.logger.debug(f'⚡ Step {self.state.n_steps}: Executing {len(model_output.action)} actions...')
- result: list[ActionResult] = await asyncio.wait_for(
- self.multi_act(model_output.action),
- timeout=60, # 60 second timeout for actions
- )
+ result: list[ActionResult] = await self.multi_act(model_output.action)
+
# result: list[ActionResult] = await self.multi_act(model_output.action)
self.logger.debug(f'✅ Step {self.state.n_steps}: Actions completed')
diff --git a/browser_use/controller/service.py b/browser_use/controller/service.py
index 4a9d390da..96af56a47 100644
--- a/browser_use/controller/service.py
+++ b/browser_use/controller/service.py
@@ -366,7 +366,7 @@ Only use this for specific queries for information retrieval from the page. Don'
# Aggressive timeout for page content
try:
- page_html_result = await asyncio.wait_for(page.content(), timeout=5.0) # 5 second aggressive timeout
+ page_html_result = await asyncio.wait_for(page.content(), timeout=10.0) # 5 second aggressive timeout
except TimeoutError:
raise RuntimeError('Page content extraction timed out after 5 seconds')
except Exception as e:
@@ -427,7 +427,7 @@ Explain the content of the page and that the requested information is not availa
# Aggressive timeout for LLM call
response = await asyncio.wait_for(
page_extraction_llm.ainvoke([UserMessage(content=formatted_prompt)]),
- timeout=30.0, # 30 second aggressive timeout for LLM call
+ timeout=60.0, # 30 second aggressive timeout for LLM call
)
extracted_content = f'Page Link: {page.url}\nQuery: {query}\nExtracted Content:\n{response.completion}'