Skyvern-AI / skyvern

Automate browser-based workflows with LLMs and Computer Vision
https://www.skyvern.com
GNU Affero General Public License v3.0
10.57k stars 725 forks source link

shu/do not raise TargetClosedError in cleanup #1220

Closed wintonzheng closed 3 days ago

wintonzheng commented 3 days ago

[!IMPORTANT] Improve error handling in task cleanup by logging and handling exceptions without raising TargetClosedError in agent.py, browser_factory.py, and browser_manager.py.

  • Error Handling:
    • In agent.py, cleanup_browser_and_create_artifacts() now includes a note to handle exceptions gracefully without raising them.
    • In browser_factory.py, close() method now logs and handles exceptions during browser context and Playwright closure.
    • In browser_manager.py, cleanup_for_task() and cleanup_for_workflow_run() now log errors instead of raising them during cleanup.

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