Skip to content

fix(tools): report missing element actions as errors - #5456

Open
ump45nose wants to merge 4 commits into
browser-use:mainfrom
ump45nose:fix/action-element-not-found-errors
Open

ump45nose wants to merge 4 commits into
browser-use:mainfrom
ump45nose:fix/action-element-not-found-errors

Conversation

@ump45nose

@ump45nose ump45nose commented Aug 12, 2026 •

Copy link
Copy Markdown

Summary

  • report missing element indices as errors for click, dropdown_options, and select_dropdown
  • preserve structured dropdown guidance while marking failed selections as errors
  • add focused real-browser coverage for stale indices and invalid dropdown options

Fixes #5438

Verification

  • uv run pytest -q tests/ci/test_tools.py::TestToolsIntegration::test_missing_element_actions_return_errors tests/ci/test_tools.py::TestToolsIntegration::test_invalid_dropdown_selection_returns_error
  • uv run pre-commit run --files browser_use/tools/service.py tests/ci/test_tools.py

Summary by cubic

Reports missing-element actions as errors so stale indices no longer masquerade as successful guidance text. click, dropdown_options, and select_dropdown now return ActionResult(error=...) instead of a message in extracted_content; invalid dropdown selections put failure details in error while keeping guidance in extracted_content, and no longer set long_term_memory. Fixes #5438.

Adds browser-backed tests for stale indices and invalid dropdown selections.

Migration

  • Check result.error to detect missing-element and failed-selection cases; do not rely on extracted_content or long_term_memory for failure signaling.

Written for commit 55b14ca. Summary will update on new commits.

View guided diff

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Re-trigger cubic

@ump45nose
ump45nose force-pushed the fix/action-element-not-found-errors branch 2 times, most recently from aebcfe3 to d288cb2 Compare August 20, 2026 02:39
@ump45nose

Copy link
Copy Markdown
Author

@sauravpanda This PR is rebased on current main; all required CI checks are green and the automated review found no issues. It turns missing element tool actions into explicit errors with focused regression coverage. Could you take a look when convenient?

@ump45nose
ump45nose force-pushed the fix/action-element-not-found-errors branch from d6a29ff to c07e3b5 Compare September 6, 2026 01:45
@ump45nose
ump45nose force-pushed the fix/action-element-not-found-errors branch from 89817be to 635f3a7 Compare October 4, 2026 16:30
sun04222 added a commit to sun04222/browser-use that referenced this pull request Oct 23, 2026
@mintlify

mintlify Bot commented Oct 31, 2026

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit 55b14ca.

Approve preview

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: click, dropdown_options, and select_dropdown report 'element not found' as success instead of error

1 participant