Skip to content

Conversation

@recursix
Copy link
Collaborator

@recursix recursix commented Jul 15, 2025

  • Modify the behavior of fill to trigger auto-complete menus
  • add more time profiling
  • add default values for tool description

Description by Korbit AI

What change is being made?

Enhance the fill function to optionally trigger an autocomplete menu by typing the last character and introduce a configurable delay (pre_observation_delay) in the environment to account for autocomplete menus before extracting observations. Update the test case to reflect the demo mode timing adjustments.

Why are these changes being made?

The changes facilitate interaction with autocomplete fields during typing by simulating user input that triggers autocomplete menus, making automated testing and interaction more realistic. The pre_observation_delay ensures that there is a sufficient pause to allow for these menus to appear, which improves the robustness of observation extraction. These modifications reflect a need for more responsive and adaptable interaction timing in user input simulations.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Performance Inefficient Event Synchronization ▹ view ✅ Fix detected
Error Handling Silent Error Swallowing ▹ view ✅ Fix detected
Files scanned
File Path Reviewed
browsergym/core/src/browsergym/core/env.py

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Comment on lines 569 to 572
try:
self.page.wait_for_load_state("domcontentloaded", timeout=1500)
except playwright.sync_api.Error:
pass

This comment was marked as resolved.

Comment on lines +489 to 490
time.sleep(self.pre_observation_delay) # wait for JS events to be fired
self.context.cookies() # trigger all waiting Playwright callbacks on the stack (hack, see https://playwright.dev/java/docs/multithreading)

This comment was marked as resolved.

@recursix recursix changed the title improve dom_wait Fill->type to trigger drop down Jul 17, 2025
Copy link
Collaborator

@gasse gasse left a comment

Choose a reason for hiding this comment

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

LGTM


# https://playwright.dev/docs/input#text-input
def fill(bid: str, value: str):
def fill(bid: str, value: str, enable_autocomplete_menu: bool = False):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe trigger_autocomplete: bool would be more explicit?

Copy link
Collaborator

@gasse gasse left a comment

Choose a reason for hiding this comment

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

Maybe add a test to make sure the autocomplete stuff works as intended?

@amanjaiswal73892 amanjaiswal73892 merged commit d9d2dd4 into main Jul 22, 2025
13 checks passed
@amanjaiswal73892 amanjaiswal73892 deleted the fix_bbox_scale branch July 22, 2025 15:00
layahaasini pushed a commit to layahaasini/BrowserGym that referenced this pull request Nov 21, 2025
* fix bbox scale in extra_properties and prevent extract_screenshot from clearing CDP

* add the n_repeats argument to benchmark creation

* in prep of modifying dom_wait

* fill function "types" the last character to trigger autocomplete in ui

* reverting to old dom_wait temporarily

* Revert to old behaviour as default

* sneaking in this little change
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.

4 participants