tools icon indicating copy to clipboard operation
tools copied to clipboard

fix(browser): make navigation wait strategy configurable

Open TheDerbiedOne opened this issue 6 months ago • 0 comments

Summary

  • Add a wait_until option to browser navigation-style actions (navigate, refresh, back, forward).
  • Default to Playwright's regular load behavior instead of forcing networkidle after every navigation.
  • Cover the default behavior and ensure navigation does not add an extra unconditional wait_for_load_state("networkidle") call.

Why

Fixes #287.

The browser tool currently waits for networkidle after navigation, which can hang on modern pages with long-lived requests. This keeps the default conservative while allowing callers to opt into domcontentloaded, networkidle, or commit when needed.

Validation

  • python3 -m py_compile src/strands_tools/browser/browser.py src/strands_tools/browser/models.py tests/browser/test_wait_until.py

Full pytest was not run locally because this checkout does not have the required Python test dependencies installed.

TheDerbiedOne avatar May 27 '26 03:05 TheDerbiedOne