Skip to content

add timeout for js click #883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 14, 2025
Merged

Conversation

seanmcguire12
Copy link
Member

why

  • we have a timeout for playwright click events, we should also have one for the JS click event attempt

what changed

  • added a 3.5 second timeout for the JS click event attempt in actHandlerUtils.ts

test plan

  • act evals
  • combination evals

@seanmcguire12 seanmcguire12 added act These changes pertain to the act function combination These changes affect multiple Stagehand functions labels Jul 14, 2025
Copy link

changeset-bot bot commented Jul 14, 2025

🦋 Changeset detected

Latest commit: 691b451

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR adds a crucial timeout of 3,500ms to JavaScript click events in actHandlerUtils.ts. Previously, while Playwright click events had a timeout, the JavaScript fallback click mechanism did not, which could potentially cause indefinite hangs. This change brings consistency between both click mechanisms and improves the overall reliability of the click operations.

The change is particularly relevant as it affects the fallback behavior when Playwright clicks fail, ensuring that the system won't hang indefinitely in such scenarios. The timeout duration (3.5 seconds) matches the existing Playwright click timeout, maintaining consistency across both approaches.

Confidence score: 5/5

  1. This PR is extremely safe to merge as it adds a protective measure without changing core functionality
  2. The change is simple, well-isolated, and includes a sensible timeout value that matches existing behavior
  3. Files needing attention: None - the change is straightforward and well-tested

1 file reviewed, no comments
Edit PR Review Bot Settings | Greptile

@seanmcguire12 seanmcguire12 merged commit 98704c9 into main Jul 14, 2025
19 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
act These changes pertain to the act function combination These changes affect multiple Stagehand functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants