-
Notifications
You must be signed in to change notification settings - Fork 811
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
Ensure Task Clenup - add timeout to browser context close #714
Conversation
<!-- ELLIPSIS_HIDDEN --> | 🚀 | This description was created by [Ellipsis](https://www.ellipsis.dev) for commit 938bc7e21ccda1f5ba8f10f7e290372aa17ed4e6 | |--------|--------| ### Summary: Introduced `task_cleanup` methods and browser context timeout for efficient Chrome process and browser state management, with updates across multiple files. **Key points**: - Introduced `task_cleanup` methods for Chrome process and browser state management. - Added `task_cleanup` in `cloud/agent_functions.py` to terminate Chrome processes. - Implemented `task_cleanup` in `skyvern/forge/agent_functions.py` for browser state handling. - Updated `skyvern/forge/agent.py` to call `task_cleanup` during `send_task_response`. - Enhanced `skyvern/webeye/browser_manager.py` to handle `TimeoutError` during task cleanup. - Added `BROWSER_CLOSE_TIMEOUT` constant in `skyvern/constants.py`. - Updated `BrowserManager.cleanup_for_task` to use `asyncio.timeout` for closing browser contexts. - Integrated `cleanup_browser_and_create_artifacts` into `task_cleanup`. - Moved Chrome process termination to `workers/temporal_workflows.py`. ---- Generated with ❤️ by [ellipsis.dev](https://www.ellipsis.dev) <!-- ELLIPSIS_HIDDEN -->
There was a problem hiding this 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 b8dc27d in 10 seconds
More details
- Looked at
58
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_KNZvZepQpCtAo18D
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.
LOG.info("Task is cleaned up") | ||
try: | ||
if browser_state_to_close: | ||
async with asyncio.timeout(BROWSER_CLOSE_TIMEOUT): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asyncio.timeout
is incorrect; use asyncio.wait_for
instead. This issue is also present in other parts of the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Incremental review on b8dc27d in 21 seconds
More details
- Looked at
57
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
0
drafted comments based on config settings.
Workflow ID: wflow_XWlyfhPDqJEUmg5R
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.
LOG.info("Task is cleaned up") | ||
try: | ||
if browser_state_to_close: | ||
async with asyncio.timeout(BROWSER_CLOSE_TIMEOUT): |
There was a problem hiding this comment.
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 valid function. Use asyncio.wait_for
to apply a timeout to an async operation.
async with asyncio.timeout(BROWSER_CLOSE_TIMEOUT): | |
async with asyncio.wait_for(BROWSER_CLOSE_TIMEOUT): |
Summary:
Introduced
task_cleanup
methods and browser context timeout for efficient Chrome process and browser state management, with enhanced error handling and updates across multiple files.Key points:
task_cleanup
methods for Chrome process and browser state management.task_cleanup
incloud/agent_functions.py
to terminate Chrome processes.task_cleanup
inskyvern/forge/agent_functions.py
for browser state handling.skyvern/forge/agent.py
to calltask_cleanup
duringsend_task_response
.skyvern/webeye/browser_manager.py
to handleTimeoutError
during task cleanup.BROWSER_CLOSE_TIMEOUT
constant inskyvern/constants.py
for browser context close timeout.BrowserManager.cleanup_for_task
to useasyncio.timeout
for closing browser contexts.TimeoutError
incleanup_for_task
to log a warning if timeout occurs.cleanup_browser_and_create_artifacts
intotask_cleanup
.workers/temporal_workflows.py
.Generated with ❤️ by ellipsis.dev