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
add the captcha and impossible flag in AgentEvent
Alezander9e62129ba93a3
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.pyindex 1214bdf15..010e2da43 100644--- a/browser_use/agent/service.py+++ b/browser_use/agent/service.py@@ -1523,6 +1523,8 @@ class Agent(Generic[Context, AgentStructuredOutput]):judge_verdict = judgement_data.get('verdict') if judgement_data else Nonejudge_reasoning = judgement_data.get('reasoning') if judgement_data else Nonejudge_failure_reason = judgement_data.get('failure_reason') if judgement_data else None+ judge_reached_captcha = judgement_data.get('reached_captcha') if judgement_data else None+ judge_impossible_task = judgement_data.get('impossible_task') if judgement_data else Noneself.telemetry.capture(AgentTelemetryEvent(@@ -1553,6 +1555,8 @@ class Agent(Generic[Context, AgentStructuredOutput]):judge_verdict=judge_verdict,judge_reasoning=judge_reasoning,judge_failure_reason=judge_failure_reason,+ judge_reached_captcha=judge_reached_captcha,+ judge_impossible_task=judge_impossible_task,))diff --git a/browser_use/telemetry/views.py b/browser_use/telemetry/views.pyindex 13bcd7f10..00283b764 100644--- a/browser_use/telemetry/views.py+++ b/browser_use/telemetry/views.py@@ -52,6 +52,8 @@ class AgentTelemetryEvent(BaseTelemetryEvent):judge_verdict: bool | None = Nonejudge_reasoning: str | None = Nonejudge_failure_reason: str | None = None+ judge_reached_captcha: bool | None = None+ judge_impossible_task: bool | None = Nonename: str = 'agent_event'diff --git a/examples/features/judge_trace.py b/examples/features/judge_trace.pyindex 9baec44a0..0964253fb 100644--- a/examples/features/judge_trace.py+++ b/examples/features/judge_trace.py@@ -16,7 +16,7 @@ from dotenv import load_dotenvload_dotenv()from browser_use import Agent-from browser_use.llm.google.chat import ChatGoogle+from browser_use.llm.browser_use.chat import ChatBrowserUse# task from GAIAtask = """@@ -27,7 +27,7 @@ Round your result to the nearest 1000 hours and do not use any comma separatorsasync def main():- llm = ChatGoogle(model='gemini-2.5-flash', temperature=1.0)+ llm = ChatBrowserUse(base_url='http://localhost:8080')agent = Agent(task=task,llm=llm,@@ -37,6 +37,11 @@ async def main():)history = await agent.run()+ # Get the judgement result+ if history.is_judged():+ judgement = history.judgement()+ print(f'Agent history judgement: {judgement}')+if __name__ == '__main__':asyncio.run(main())