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
Improve judge result console output to reduce noise
Cursor Agent6f392b67751c
diff --git a/browser_use/agent/service.py b/browser_use/agent/service.pyindex b01abfb52..12fd57303 100644--- a/browser_use/agent/service.py+++ b/browser_use/agent/service.py@@ -951,10 +951,27 @@ class Agent(Generic[Context, AgentStructuredOutput]):# Attach judgement to last action resultif self.history.history[-1].result[-1].is_done:- self.history.history[-1].result[-1].judgement = judgement+ last_result = self.history.history[-1].result[-1]+ last_result.judgement = judgement- # Log the verdict+ # Get self-reported success+ self_reported_success = last_result.success++ # Log the verdict based on self-reported success and judge verdictif judgement:+ # If both self-reported and judge agree on success, don't log+ if self_reported_success is True and judgement.verdict is True:+ return++ # If agent reported success but judge thinks it failed, show warning+ if self_reported_success is True and judgement.verdict is False:+ judge_log = '\n⚠️ \033[33mAgent reported success but judge thinks task failed\033[0m\n'+ if judgement.failure_reason:+ judge_log += f' Reason: {judgement.failure_reason}\n'+ self.logger.info(judge_log)+ return++ # Otherwise, show full judge resultverdict_color = '\033[32m' if judgement.verdict else '\033[31m'verdict_text = '✅ PASS' if judgement.verdict else '❌ FAIL'judge_log = f'\n⚖️ {verdict_color}Judge Verdict: {verdict_text}\033[0m\n'