Skip to content

fix(tools): report missing elements as errors - #5457

Open
hansu650 wants to merge 2 commits into
browser-use:0.xfrom
hansu650:fix-action-element-errors
Open

hansu650 wants to merge 2 commits into
browser-use:0.xfrom
hansu650:fix-action-element-errors

Conversation

@hansu650

@hansu650 hansu650 commented Aug 12, 2026 •

Copy link
Copy Markdown

Fixes #5438 for the legacy Python runtime on 0.x.

Missing selector indexes currently return an ActionResult with only extracted_content. This makes click, dropdown_options and select_dropdown look successful to multi-action execution even though no browser action occurred.

Return the missing-element messages through ActionResult.error. Structured dropdown-selection failures also populate error while keeping the available options in short-term extracted content. Focused real-browser regressions cover stale indexes and unavailable dropdown options.

Before: error=None, extracted_content="Element index 999999 not available ..."
After:  error="Element index 999999 not available ...", extracted_content=None

The PR targets 0.x because the 1.0 migration removed the affected Python engine and its tests from main. It is synchronized with 0.x at b49a68e4; the diff against that branch remains limited to the two original files.

Validation — 2026-11-13

Dedicated local Conda environment on Windows:

  • pytest -q tests/ci/test_tools.py: 19 passed with a real headless browser.
  • Repository pre-commit hooks for the two changed files: passed. Pyright passed after retrying a transient npm TLS connection reset.
  • git diff --check: passed.

The first browser-test attempt timed out while downloading extensions; after the downloads completed, all 19 tests passed without changing the tests or timeouts. The full CI suite and other platforms were not rerun for this synchronization. This changes action-result semantics and has no visual UI change to screenshot.

AI assistance: prepared and validated with OpenAI Codex.

@CLAassistant

CLAassistant commented Aug 12, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@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

@github-actions

Copy link
Copy Markdown

👋 This PR has been automatically marked as stale because it hasn't had activity for 45 days.

To keep this PR open:

  • Rebase against the latest main branch
  • Address any review feedback or merge conflicts
  • Add a comment explaining the current status
  • Add the work-in-progress label if you're still actively working on this

This will be automatically closed in 14 days if no further activity occurs.

Thanks for contributing to browser-use! 🤖

@github-actions github-actions Bot added the stale label Sep 28, 2026

Copy link
Copy Markdown
Author

Status update: this contribution is still being maintained. The current head remains mergeable, and I found no new requested code changes in the review timeline. The Contributor License Agreement is still pending and must be handled by the account holder personally; this update is not a CLA signature or acceptance. Please keep the PR open while that prerequisite is resolved.

Assisted by OpenAI Codex under the submitting account's authorization.

@github-actions github-actions Bot removed the stale label Sep 29, 2026
@hansu650
hansu650 changed the base branch from main to 0.x November 13, 2026 08:38

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

2 participants