From 326379adb9bd75fd82ad867a11f5f285113be88a Mon Sep 17 00:00:00 2001 From: Saeed Kasmani Date: Sun, 9 Aug 2026 21:09:20 +1000 Subject: [PATCH] Wait for the final WebSocket result --- deployment/runtime/agent/main-websocket.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deployment/runtime/agent/main-websocket.py b/deployment/runtime/agent/main-websocket.py index 2882280..eb2029a 100644 --- a/deployment/runtime/agent/main-websocket.py +++ b/deployment/runtime/agent/main-websocket.py @@ -599,7 +599,9 @@ async def stream_agent_events( yield {"start": True} continue if event_data.get("complete"): - yield {"complete": True, "response": final_response} + # Strands emits this lifecycle marker before its AgentResult. + # The client treats completion as terminal, so wait for the + # result event below instead of closing the stream early. continue if event_data.get("force_stop"): yield {