Skip to content

fix(dom): preserve omitted select option counts - #6212

Closed
Arham-Begani wants to merge 1 commit into
browser-use:mainfrom
Arham-Begani:fix/select-option-omission-hint
Closed

Arham-Begani wants to merge 1 commit into
browser-use:mainfrom
Arham-Begani:fix/select-option-omission-hint

Conversation

@Arham-Begani

@Arham-Begani Arham-Begani commented Oct 26, 2026 •

Copy link
Copy Markdown

Fixes #5195.

_extract_select_options already limits the preview to four labels and appends an omission count. The serializer slices that prepared list to four entries again, dropping the count. Preserve the prepared preview instead. Option labels remain limited to four, with the existing 30-character label truncation.

Example for a six-option dropdown:

Before: count=6,options=Apple|Banana|Cherry|Date
After:  count=6,options=Apple|Banana|Cherry|Date|... 2 more options...

The regression tests build real DOM/AX/snapshot objects and exercise serialize_accessible_elements() through llm_representation(). They cover the four/five-option boundary, six options and an optgroup. They do not seed _compound_children, mock serializer behavior or call an LLM.

Validation at 12c341c

  • Unchanged parent: three new cases fail on the missing omission hint; the four-option control passes.
  • Windows / Python 3.12: all 34 focused serializer tests pass. All applicable unmodified pre-commit hooks pass, including Ruff and Pyright. git diff --check passes.
  • Upstream test workflow and lint workflow pass for this PR head. The new regression job passes all four cases; the existing real-browser serializer job also passes. Standard upstream PR CI checked the synthetic merge of 12c341c into 3df5806.
  • Separate hosted Ubuntu / Python 3.11 probes reproduce the three failures on the parent and pass all 34 focused cases with the fix. Both standalone validation jobs timed out later (first during browser setup/coverage, second during hook installation); they are not claimed green. The completed upstream workflows above provide the broader CI results.
  • The full Windows suite is not green. Its initial attempt stopped on console encoding. A UTF-8 parallel attempt encountered subprocess/browser/registry failures and resource exhaustion and was stopped. Two POSIX bash failures also reproduce on unchanged parent 3df5806; the other broader failures have not been classified as pre-existing.

Keeping this draft while the contributor completes the repository's CLA. Upstream code validation passes; maintainer review is still pending.

AI assistance

The investigation, implementation, regression tests and PR text were prepared with AI assistance.

@mintlify

mintlify Bot commented Oct 26, 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 12c341c.

Approve preview

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Copy Markdown
Author

The contributor tried the CLA link in the bot comment, but no agreement or signing control appeared. I independently opened the same link and saw a page headed “Please agree to the CLA for multiple repositories or organizations”, with an empty Version field and no agreement text or signing button.

Could a maintainer check the repository's CLA Assistant setup or provide an approved alternative signing route? No CLA signature is being claimed. The current contribution head remains 12c341c; upstream test and lint workflows pass.

This diagnostic follow-up was prepared with AI assistance.

Copy link
Copy Markdown
Author

Closing this: the 1.0 rewrite removed the DOM serializer this patched, and ax.py already keeps the omitted-option count (… N more). Thanks!

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: <select> with more than 4 options drops the "... N more options..." indicator in serialized DOM

2 participants