Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
Update Laminar span handling to record exceptions and improve variable naming
Cursor Agent72f3b1f7f0a1
diff --git a/browser_use/controller/service.py b/browser_use/controller/service.pyindex 2cb29507a..f6d5934d5 100644--- a/browser_use/controller/service.py+++ b/browser_use/controller/service.py@@ -1685,7 +1685,7 @@ Provide the extracted information in a clear, structured format."""if params is not None:# Use Laminar span if available, otherwise use no-op context managerif Laminar is not None:- span_context = Laminar.start_as_current_span(+ span = Laminar.start_as_current_span(name=action_name,input={'action': action_name,@@ -1697,9 +1697,9 @@ Provide the extracted information in a clear, structured format."""# No-op context manager when lmnr is not availablefrom contextlib import nullcontext- span_context = nullcontext()+ span = nullcontext()- with span_context:+ with span:try:result = await self.registry.execute_action(action_name=action_name,@@ -1712,6 +1712,8 @@ Provide the extracted information in a clear, structured format."""context=context,)except Exception as e:+ if Laminar is not None:+ span.record_exception(e)result = ActionResult(error=str(e))if Laminar is not None: