From df5aff5a79a22716a6fef02fefc0d0e1971eae6f Mon Sep 17 00:00:00 2001 From: Vasco Schiavo <115561717+VascoSch92@users.noreply.github.com> Date: Thu, 18 Jun 2026 16:55:28 +0200 Subject: [PATCH] Fix deferred-init example to poll on real execution-status values The 16_deferred_init.py example checked for a non-existent "stopped" status and never included the real terminal "finished" state, so the poll loop spun the full max_wait (120s) and the final assert raised AssertionError (exit 1) even though the conversation finished in ~2s. Use the actual ConversationExecutionStatus terminal values (finished/error/stuck) for the break, and assert on "finished". --- examples/02_remote_agent_server/16_deferred_init.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/02_remote_agent_server/16_deferred_init.py b/examples/02_remote_agent_server/16_deferred_init.py index c1cc9376eb..bcc3016058 100644 --- a/examples/02_remote_agent_server/16_deferred_init.py +++ b/examples/02_remote_agent_server/16_deferred_init.py @@ -153,14 +153,15 @@ assert resp.status_code == 200 data = resp.json() execution_status = data.get("execution_status", "unknown") - if execution_status in ("stopped", "paused", "error"): + # Terminal states per ConversationExecutionStatus.is_terminal(). + if execution_status in ("finished", "error", "stuck"): break logger.info(f" status: {execution_status} ({elapsed}s elapsed)") time.sleep(2) elapsed += 2 logger.info(f"✅ Conversation finished — status: {execution_status}") - assert execution_status in ("stopped", "paused"), ( + assert execution_status == "finished", ( f"Unexpected final status: {execution_status}" )