@@ -1592,14 +1592,21 @@ async def _run_single_turn_streamed(
15921592
15931593 import dataclasses as _dc
15941594
1595- # Filter out items that have already been sent to avoid duplicates
1596- items_to_filter = single_step_result .new_step_items
1595+ # Stream session items (unfiltered) when available for observability.
1596+ streaming_items = (
1597+ single_step_result .session_step_items
1598+ if single_step_result .session_step_items is not None
1599+ else single_step_result .new_step_items
1600+ )
1601+
1602+ # Filter out items that have already been sent to avoid duplicates.
1603+ items_to_stream = streaming_items
15971604
15981605 if emitted_tool_call_ids :
15991606 # Filter out tool call items that were already emitted during streaming
1600- items_to_filter = [
1607+ items_to_stream = [
16011608 item
1602- for item in items_to_filter
1609+ for item in items_to_stream
16031610 if not (
16041611 isinstance (item , ToolCallItem )
16051612 and (
@@ -1613,9 +1620,9 @@ async def _run_single_turn_streamed(
16131620
16141621 if emitted_reasoning_item_ids :
16151622 # Filter out reasoning items that were already emitted during streaming
1616- items_to_filter = [
1623+ items_to_stream = [
16171624 item
1618- for item in items_to_filter
1625+ for item in items_to_stream
16191626 if not (
16201627 isinstance (item , ReasoningItem )
16211628 and (reasoning_id := getattr (item .raw_item , "id" , None ))
@@ -1624,12 +1631,12 @@ async def _run_single_turn_streamed(
16241631 ]
16251632
16261633 # Filter out HandoffCallItem to avoid duplicates (already sent earlier)
1627- items_to_filter = [
1628- item for item in items_to_filter if not isinstance (item , HandoffCallItem )
1634+ items_to_stream = [
1635+ item for item in items_to_stream if not isinstance (item , HandoffCallItem )
16291636 ]
16301637
16311638 # Create filtered result and send to queue
1632- filtered_result = _dc .replace (single_step_result , new_step_items = items_to_filter )
1639+ filtered_result = _dc .replace (single_step_result , new_step_items = items_to_stream )
16331640 RunImpl .stream_step_result_to_queue (filtered_result , streamed_result ._event_queue )
16341641 return single_step_result
16351642
0 commit comments