Skip to content

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

Number of actions

Magnus Müller150e1e7a6565
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.py
index 5d8a8b7eb..94aef79fb 100644
--- a/browser_use/agent/service.py
+++ b/browser_use/agent/service.py
@@ -1749,7 +1749,10 @@ class Agent(Generic[Context, AgentStructuredOutput]):
reset = '\033[0m'
# Format action number and name
- action_header = f'🦾 [ACTION {action_num}/{total_actions}] {blue}{action_name}{reset}:'
+ if total_actions > 1:
+ action_header = f'🦾 [{action_num}/{total_actions}] {blue}{action_name}{reset}:'
+ else:
+ action_header = f'🦾 {blue}{action_name}{reset}:'
# Get action parameters
action_data = action.model_dump(exclude_unset=True)