Repository navigation
v4.4.0 - A run its own judge failed is not a win
4.3.1 stopped the render tier handing back a bot wall as a win. This is the same shape one tier up, plus the two reads that let it stay invisible for four months.
The bug
E2 decided blocked from step errors alone. A Cloudflare Turnstile wall produces none: it serves HTTP 200, the agent navigates cleanly, looks at ten screenshots of a "Verify you are human" page, and finishes by declaring failure. errors() is empty, so:
pattern_used = e2
blocked = False <- says "not blocked"
challenge_detected = cloudflare <- says "cloudflare blocked us"
28,937 bytes, <title>Just a moment...</title>, 0 rows
while the sidecar's own log for that step read:
[Agent] Agent was blocked by a captcha.
[Agent] Judge Verdict: FAIL
...every one of the 10 screenshots shows only the Cloudflare page
[scrapper_tool.recipe.policy] policy.recorded best_tier='e2' e2_wins=1
The agent said it failed, the judge said FAIL, and the step was recorded as a win.
The damage is in that last line. _record_policy gates on blocked, so it learned best_tier=e2 — and every later request to the domain was pre-routed to a nine-minute tier that returns the wall, skipping the sub-second tiers that would have said "blocked" immediately. One false win poisons the routing permanently. Measured on amayama.com: 533.6s.
browser-use has exposed judgement(), is_validated() and is_successful() the whole time. None were read.
The fix, and the line it holds
A judge FAIL that names a wall is blocked — 422, chargeable to the vendor. A judge FAIL that names none is a no_signal failure — ours, not theirs. That distinction is the whole taxonomy and it would have been easy to lose here.
Reading a run's own words for evidence is confined to runs that have already declared themselves failed. On a successful extraction the same scan condemns any page carrying an ordinary reCAPTCHA footer — the regression that once cost a downstream integration two days — so the guard is structural, and it is now pinned from both sides.
Two reads that kept it invisible
_final_url named attributes that do not exist. It read .url / .final_url on the history item; browser-use keeps the location on .state.url and AgentHistory has never had either. So it returned None on every run and the caller fell back to the requested URL — meaning a caller checking requested_url != url to spot a redirect onto a challenge page could never see one. The read was correct when written against browser-use 0.5.9; the 0.13 port rewrote 70 lines of this file and 155 lines of its tests without touching it.
The E2 escalation-log row was hardcoded won / ok on every non-raising return, so it could contradict the policy write three lines above it, and did.
Why the suite stayed green through all of it
Every E2 test fabricates browser_use as a types.ModuleType, so the fake is the specification — and it supplied whatever the code asked for. It had already carried total_input_tokens, an attribute browser-use never had, which is how every E2 run reported 0 tokens. It carried a top-level url for the same reason.
There was a test asserting against the installed library, and its docstring says it is "the only test here that would have caught the 0.5 -> 0.13 break". But it pins the call surface — the kwargs passed to Agent — and nothing pinned the return surface, which is where all three of these bugs live. 4.4.0 adds that test. It earned its place immediately: the first version of it asserted hasattr(AgentHistoryList, "usage") and failed, because usage is a Pydantic field rather than a method.
Also in this release
- A tier that returned no content can no longer be learned as the best route.
_record_policygated onblockedalone; it now also declines an unstructured payload, as its own docstring ("remember which tier reached content") already implied. A/B/C and D are unaffected — they return only after their classifier has accepted the page. block_evidencenames the vendor when a message names it. The signature table is built for scanning documents, where a bare "cloudflare" is footer furniture rather than evidence; in prose it is the most useful word in the sentence, and the answer was degrading to the generic"challenge". Messages only — document scanning is unchanged and pinned against leakage.AgentResult.succeeded(bool | None): did the run accomplish its task, as distinct from whether the vendor stopped us.Nonemeans nothing reported either way. Schema-valid JSON from a run withsucceeded=Falsenow reportsis_structured=false— it is a well-formed guess, not a payload.- The
blocked/challenge_detectedcontract is documented in both directions.blocked=truestill guarantees a non-nullchallenge_detected. The reverse does not hold and is not a contradiction: a cheap tier walled and a later tier clearing it is a successful escalation. Key onblockedfor "did I get the page", onchallenge_detectedfor "who guards this domain".
Housekeeping
pip-audit in CI now also installs the [http] extra. full is hostile + llm-agent + turnstile-solver and does not include it, so FastAPI, uvicorn, PyYAML and prometheus-client — the packages that ship in this image and the only ones that bind a port — had never been audited.
+14 tests, each proven red against the pre-fix code. Full suite: 1,694 passing, 87.7% coverage, on Python 3.12 / 3.13 / 3.14.