Skip to content

Conversation

@ommistry2914
Copy link

Summary

  • Add synchronous and asynchronous helpers to AgentsResource and AsyncAgentsResource :

          - wait_for_deployment(uuid, *, timeout=120.0, interval=2.0, raise_on_failed=True)
          - async def wait_for_deployment(...)
    
  • These poll retrieve() until the agent deployment reaches STATUS_RUNNING, returns the AgentRetrieveResponse on success, and optionally raises on terminal failure states.

Details

  • Polling defaults: timeout = 120s, interval = 2s.

  • Terminal failure states treated as errors: STATUS_FAILED, STATUS_UNDEPLOYMENT_FAILED, STATUS_DELETED.

  • If raise_on_failed=True (default), a RuntimeError is raised when a terminal failure state is observed.

  • If raise_on_failed=False, the final AgentRetrieveResponse is returned so callers can inspect the state themselves.

  • Returns the same AgentRetrieveResponse object produced by retrieve() for consistency.

fixes #40

@bbatha
Copy link
Collaborator

bbatha commented Oct 20, 2025

Thank you for your contribution, however this is a dupe of #56

@bbatha bbatha closed this Oct 20, 2025
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.

Create a helper function to poll for agent deployment readiness

2 participants