Repository navigation
Description
Browser Use Version
0.13.7 (commit 3260188)
Bug Description
Three actions in browser_use/tools/service.py return "element not found" as a non-error ActionResult when the element index is missing from the selector map. This is the same class of bug as #5361 (which covers scroll, input, and find_text), but in three additional actions that were not mentioned in that issue.
Affected actions
| Action | File location | Line |
|---|---|---|
_click_by_index |
tools/service.py |
~715-718 |
dropdown_options |
tools/service.py |
~1679-1682 |
select_dropdown |
tools/service.py |
~1707-1710 |
All three have the identical pattern:
node = await browser_session.get_element_by_index(params.index)
if node is None:
msg = f'Element index {params.index} not available - page may have changed.'
logger.warning(f'⚠️ {msg}')
return ActionResult(extracted_content=msg) # <-- missing error=Why this matters
-
Agent.multi_act()checksresults[-1].errorto decide whether to abort remaining queued actions. Witherror=None, follow-up actions (e.g. a submit button click after a failed text input) keep executing against a stale or wrong page. -
Agent._post_process()incrementsconsecutive_failuresonly whenlast_result[-1].erroris set. These false successes never count towardmax_failures, so the agent never triggers its failure recovery. -
The LLM is told the action succeeded via
evaluation_previous_goal, so it reasons from a false premise on the next step.
Additional issue in select_dropdown
When selection_data.get('success') != 'true' and the response contains short_term_memory/long_term_memory keys, the function returns a non-error ActionResult (lines ~1733-1737). There is already a # TODO comment noting this should raise BrowserError. The failed selection is reported as a success to the agent.
Steps to Reproduce
- Start an agent task that involves clicking an element
- Between the DOM snapshot and the click execution, let the page change (element disappears)
- The click returns
ActionResult(extracted_content="Element index X not available...")with no.error - The agent treats this as success and proceeds with follow-up actions
Expected Behavior
All three actions should return ActionResult(error=msg) when the element is not found, consistent with how scroll handles the same condition at line ~1380.
Proposed Fix
Change ActionResult(extracted_content=msg) to ActionResult(error=msg) in all three locations. For the select_dropdown structured error path, add error= to the ActionResult.
Related
- Bug: scroll/input/scroll_to_text report failed actions as successes, so multi_act never aborts and consecutive_failures never increments #5361 covers
scroll,input, andfind_text— same bug class, different actions - PR fix: ensure failed actions return errors instead of successes #5390 fixes the three actions in Bug: scroll/input/scroll_to_text report failed actions as successes, so multi_act never aborts and consecutive_failures never increments #5361 but not these three
Activity
hansu650 commentedon Aug 12, 2026
I’m working on this. I’ll update the missing-element paths for click, dropdown_options, and select_dropdown to return ActionResult(error=...), cover the structured select failure path, and add focused regression tests before opening a PR.
hansu650 commentedon Aug 13, 2026
@yun520-1 Thanks — agreed on the status-inversion framing. The linked PR already makes that invariant explicit in both implementation and coverage: it returns
ActionResult(error=...)for missing indexes inclick,dropdown_options, andselect_dropdown, and the parametrized regression invokes each action separately with an absent selector index, asserting the exact error andextracted_content is None. It also covers the structuredselect_dropdownfailure path so useful options remain available while the action is still marked as an error.MilkyWay008 commentedon Aug 14, 2026
For anyone stuck on this before the fix lands: you can patch it yourself in the installed copy, three spots in
browser_use/tools/service.py—_click_by_index(~715),dropdown_options(~1679),select_dropdown(~1707) — changeActionResult(extracted_content=msg)toActionResult(error=msg), plus the structured select path around ~1733. Witherror=set,_post_process()actually counts the misses towardmax_failuresso recovery kicks in. hansu650's PR covers it properly, so tracking that beats re-reporting.jinngimk-lang commentedon Aug 17, 2026
This is a perfect AgentCI breaker shape: the browser action objectively did not happen, but the agent loop records success and keeps executing queued effects. That is exactly the kind of false-PASS we want external developers/agents to help us freeze into regression fixtures.
If you can keep this repro minimal, AgentCI can turn it into a portable case: stale/missing element → action result → downstream queue behavior → terminal verdict. The accepted reproducer gets durable public credit in our Breaker Hall of Fame, a backlink to this issue, and priority conversion help so the bug becomes an executable proof instead of disappearing after the fix.
AgentCI: https://github.com/jinngimk-lang/agentci
Challenge/credit rules: https://github.com/jinngimk-lang/agentci/blob/main/COMMUNITY.md
We’re affiliated with AgentCI and we’re not claiming to certify Browser Use — we’re recruiting real false-success cases like this because they generalize across agent runtimes.
solozerolabs commentedon Sep 20, 2026
Element not found reported as success is the silent no-op case, and it is the one that hurts later.
Patching each action helps, but a wholesale check catches these no matter which action regresses. Read the page state after the action and confirm something actually changed.
truefact returns landed / did-not-land / inconclusive from the DOM and network, so a click that found nothing comes back did-not-land.
https://github.com/solozerolabs/TrueFact
github-actions commentedon Nov 19, 2026
👋 This issue has been automatically marked as stale because it hasn't had activity for 60 days.
⚡ We've made significant progress recently! Please test with the latest version of browser-use to see if this issue has been resolved. If the issue persists, please let us know by commenting below.
To keep this issue open:
pinnedlabel if this is an important long-term issueThis will be automatically closed in 14 days if no further activity occurs.
Thanks for contributing to browser-use! 🤖 If you have questions, join our Discord.