streaming: switch to stream_async + iter_chunks response drain

This commit is contained in:
daniel
2026-05-07 16:27:26 -05:00
parent 7f7f555983
commit 40a942b506
2 changed files with 32 additions and 32 deletions

View File

@@ -187,8 +187,10 @@ def handler(event, context):
payload=json.dumps(payload).encode(),
)
# Consume streaming response (agent delivers to Telegram via send_message tool)
for chunk in response.get('response', []):
pass # intentional no-op — agent handles delivery internally
# Drain streaming response body (agent delivers to Telegram via send_message tool)
body = response.get('response')
if body is not None:
for _ in body.iter_chunks():
pass
print(f"[agent-runner] Completed session={session_id} actor={actor_id}")