Skip to content

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

Log action names

magmuellerdaab09a95d9a
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.py
index 7afb995fd..73a72d678 100644
--- a/browser_use/agent/service.py
+++ b/browser_use/agent/service.py
@@ -200,11 +200,16 @@ class Agent:
self._last_result = result
finally:
+ actions = (
+ [a.model_dump(exclude_unset=True) for a in model_output.action]
+ if model_output
+ else []
+ )
self.telemetry.capture(
AgentStepTelemetryEvent(
agent_id=self.agent_id,
step=self.n_steps,
- actions=model_output.action if model_output else None,
+ actions=actions,
consecutive_failures=self.consecutive_failures,
step_error=[r.error for r in result if r.error] if result else ['No result'],
)
diff --git a/browser_use/telemetry/views.py b/browser_use/telemetry/views.py
index 2b4de4149..eac9d53f2 100644
--- a/browser_use/telemetry/views.py
+++ b/browser_use/telemetry/views.py
@@ -35,7 +35,7 @@ class AgentStepTelemetryEvent(BaseTelemetryEvent):
step: int
step_error: list[str]
consecutive_failures: int
- actions: Optional[list[ActionModel]] = None
+ actions: list[dict]
name: str = 'agent_step'