julep-ai / julep

Build AI agents and workflows with a simple API. Supabase for AI agents
https://julep.ai
Apache License 2.0
883 stars 69 forks source link

fix(agents-api): Fix updating task execution #542

Closed HamadaSalhab closed 2 days ago

HamadaSalhab commented 2 days ago

[!IMPORTANT] Improves task execution updates by encoding task tokens with metadata and enhancing error handling in raise_complete_async.py and update_execution.py.

  • Behavior:
    • In raise_complete_async.py, task tokens are now base64 encoded and include metadata with activity, run, and workflow IDs.
    • In update_execution.py, added error handling for stopping and resuming executions, using metadata for async activity handle retrieval.
  • Database Queries:
    • In get_paused_execution_token.py, query updated to include metadata and sort by created_at with a limit of 1.
  • Error Handling:
    • Added try-except blocks in update_execution.py to handle exceptions when stopping or resuming executions.

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