mirror of
https://github.com/browser-use/browser-use.git
synced 2026-09-14 19:59:47 +08:00
7cbb1839c6
The loop detector only nudges: it appends a context message and lets the agent repeat regardless. That is right for a model that self-corrects. Traces from qwen3.5-9b on bu-bench show it does not - up to 38 consecutive identical actions, averaging 10.5 against the 27b's 5.8, with 54% of all actions being clicks against the 27b's 42%. It exhausts its step budget wandering rather than answering wrongly: it makes fewer action errors than the 27b, not more. should_block refuses an action only when the identical action hash has already repeated threshold times AND the page fingerprint is unchanged since. Either condition alone is a false positive: repetition on a changing page is progress, and a stagnant page may just mean the agent is reading. done is never blockable, or a blocked agent has no way to terminate and a loop becomes a hang. The refusal text names direct navigation first, since the 27b reaches URLs directly 25% of the time against the 9B's 12% - the behaviour worth steering to. Off by default (loop_block_threshold=0), so no existing run changes. The detector docstring claimed it never blocks; that is no longer true and a stale docstring on a safety-relevant component is how people get surprised.