Skip to content

Commit 0a9a739

Browse files
debug: add print diagnostics to stream_lifecycle_content activity
1 parent be15910 commit 0a9a739

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • src/agentex/lib/core/temporal/plugins/openai_agents/hooks

src/agentex/lib/core/temporal/plugins/openai_agents/hooks/activities.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ async def stream_lifecycle_content(
6161
that streaming failures don't break the agent execution.
6262
"""
6363
try:
64+
print(f"[stream_lifecycle_content] Creating message for task {task_id}, content_type={getattr(content, 'type', 'unknown')}", flush=True)
6465
async with adk.streaming.streaming_task_message_context(
6566
task_id=task_id,
6667
initial_content=content,
6768
) as streaming_context:
69+
print(f"[stream_lifecycle_content] Context opened, message_id={streaming_context.task_message.id if streaming_context.task_message else 'None'}", flush=True)
6870
# Send the content as a full message update
6971
await streaming_context.stream_update(
7072
StreamTaskMessageFull(
@@ -73,6 +75,8 @@ async def stream_lifecycle_content(
7375
type="full",
7476
)
7577
)
78+
print(f"[stream_lifecycle_content] Full update sent for content_type={getattr(content, 'type', 'unknown')}", flush=True)
7679
except Exception as e:
7780
# Log error but don't fail the activity - streaming failures shouldn't break execution
81+
print(f"[stream_lifecycle_content] FAILED for task {task_id}: {e}", flush=True)
7882
activity.logger.warning(f"Failed to stream content to task {task_id}: {e}")

0 commit comments

Comments
 (0)