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

wait for downloads to be done #1328

Merged
merged 1 commit into from
Dec 5, 2024
Merged

Conversation

LawyZheng
Copy link
Collaborator

@LawyZheng LawyZheng commented Dec 5, 2024

Important

Enhance download handling by waiting for completion and checking for incomplete downloads in agent.py and handler.py.

  • Behavior:
    • Adds NoFileDownloadTriggered exception in exceptions.py to handle cases where a click does not trigger a download.
    • In agent.py, skips renaming files with .crdownload extension, indicating incomplete downloads.
    • In handler.py, handle_click_to_download_file_action() now waits for downloads to complete, checking for .crdownload files and waiting up to BROWSER_DOWNLOAD_TIMEOUT.
  • Logging:
    • Adds logging in agent.py and handler.py to track download status before and after click actions.
    • Logs warnings for incomplete downloads and potential download issues.
  • Misc:
    • Updates import statements in handler.py to include Path from pathlib and BROWSER_DOWNLOAD_TIMEOUT from constants.

This description was created by Ellipsis for 1222615. 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.

👍 Looks good to me! Reviewed everything up to 1222615 in 50 seconds

More details
  • Looked at 230 lines of code in 3 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. skyvern/forge/agent.py:334
  • Draft comment:
    The logic for handling incomplete downloads is repeated here and in handle_click_to_download_file_action in handler.py. Consider refactoring this into a separate function to avoid code duplication and improve maintainability.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The comment suggests a refactor to improve code maintainability by reducing duplication. This is a valid suggestion if the logic is indeed duplicated across files. However, the comment does not provide strong evidence of duplication within the same file, and cross-file issues are not to be considered according to the rules.
    The comment assumes duplication without providing evidence within the same file. It relies on cross-file context, which is not allowed by the rules.
    The suggestion for refactoring is generally good for maintainability, but without evidence of duplication in the same file, it doesn't meet the criteria for a necessary code change.
    Delete the comment as it relies on cross-file context, which is not allowed by the rules.

Workflow ID: wflow_ndoP8Q6ECduHigqr


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

@LawyZheng LawyZheng merged commit df4d5df into main Dec 5, 2024
2 checks passed
@LawyZheng LawyZheng deleted the lawy/wait-for-downloads-to-be-done branch December 5, 2024 18:25
satansdeer pushed a commit to satansdeer/skyvern that referenced this pull request Dec 12, 2024
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