Skip to content
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

wrap page evaluate with timeout #1133

Merged
merged 1 commit into from
Nov 5, 2024
Merged

wrap page evaluate with timeout #1133

merged 1 commit into from
Nov 5, 2024

Conversation

LawyZheng
Copy link
Collaborator

@LawyZheng LawyZheng commented Nov 5, 2024

Important

Wraps page evaluations with a timeout using SkyvernFrame.evaluate() and removes deprecated JavaScript-triggered handling.

  • Behavior:
    • Wraps page evaluations with a timeout using SkyvernFrame.evaluate() in agent.py, handler.py, scraper.py, and browser_factory.py.
    • Removes handling of javascript_triggered in agent.py and handler.py.
  • Functions:
    • Adds SkyvernFrame.evaluate() to handle timeouts for page evaluations.
    • Removes is_javascript_triggered() and related logic.
  • Misc:
    • Removes javascript_triggered attribute from ActionResult and related classes in responses.py.

This description was created by Ellipsis for ba3fc14. It will automatically update as commits are pushed.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to ba3fc14 in 1 minute and 8 seconds

More details
  • Looked at 492 lines of code in 7 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_fLJusmYOh5YYiJz2


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

timeout_ms: float = SettingsManager.get_settings().BROWSER_ACTION_TIMEOUT_MS,
) -> Any:
try:
async with asyncio.timeout(timeout_ms / 1000):
Copy link
Contributor

Choose a reason for hiding this comment

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

asyncio.timeout is not a standard method. Use asyncio.wait_for for timeout functionality.

Suggested change
async with asyncio.timeout(timeout_ms / 1000):
async with asyncio.wait_for(frame.evaluate(expression=expression, arg=arg), timeout=timeout_ms / 1000):

@LawyZheng LawyZheng merged commit 8b53bc4 into main Nov 5, 2024
2 checks passed
@LawyZheng LawyZheng deleted the lawy/wrap-evalutate branch November 5, 2024 03:11
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.

1 participant