Skyvern-AI / skyvern

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

fix task workflow cancel issue #1111

Closed wintonzheng closed 4 weeks ago

wintonzheng commented 4 weeks ago

[!IMPORTANT] Refactor task and workflow cleanup processes, introduce clean_up_task and clean_up_workflow methods, and switch to httpx for async requests.

  • Behavior:
    • Introduces clean_up_task in agent.py to replace send_task_response, handling task cleanup and webhook calls.
    • Modifies execute_step in agent.py to use clean_up_task for task cancellation and failure scenarios.
    • Updates execute_workflow in service.py to use clean_up_workflow for workflow cleanup.
  • Exceptions:
    • Updates MissingBrowserState in exceptions.py to include workflow_run_id.
  • Browser Management:
    • Refactors get_or_create_for_task and get_or_create_for_workflow_run in browser_manager.py to improve browser state handling.
    • Adds get_for_task and get_for_workflow_run methods in browser_manager.py for retrieving existing browser states.
  • Misc:
    • Replaces requests with httpx for async HTTP requests in agent.py and service.py.
    • Updates logging and error handling in agent.py and service.py for better clarity and debugging.

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