Skip to content

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

Update browser_use/controller/service.py

Mert Unsale655986bab16
diff --git a/browser_use/controller/service.py b/browser_use/controller/service.py
index 6b70db342..489a130ee 100644
--- a/browser_use/controller/service.py
+++ b/browser_use/controller/service.py
@@ -137,7 +137,7 @@ class Controller(Generic[Context]):
@self.registry.action('Wait for x seconds default 3 (max 10 seconds)')
async def wait(seconds: int = 3):
# Cap wait time at maximum 10 seconds
- actual_seconds = min(seconds, 10)
+ actual_seconds = min(max(seconds, 0), 10)
if actual_seconds != seconds:
msg = f'🕒 Waiting for {actual_seconds} seconds (capped from {seconds} seconds, max 10 seconds)'
else: