diff --git a/surfsense_backend/app/tasks/chat/streaming/handlers/custom_event_dispatch.py b/surfsense_backend/app/tasks/chat/streaming/handlers/custom_event_dispatch.py index b373919cf..69f4b8a24 100644 --- a/surfsense_backend/app/tasks/chat/streaming/handlers/custom_event_dispatch.py +++ b/surfsense_backend/app/tasks/chat/streaming/handlers/custom_event_dispatch.py @@ -33,6 +33,7 @@ def iter_custom_event_frames( last_active_step_items=state.last_active_step_items, streaming_service=streaming_service, content_builder=content_builder, + thinking_metadata=state.span_metadata_if_active(), ) if frame: yield frame diff --git a/surfsense_backend/app/tasks/chat/streaming/handlers/custom_events.py b/surfsense_backend/app/tasks/chat/streaming/handlers/custom_events.py index 765f1d790..e48e2c493 100644 --- a/surfsense_backend/app/tasks/chat/streaming/handlers/custom_events.py +++ b/surfsense_backend/app/tasks/chat/streaming/handlers/custom_events.py @@ -15,6 +15,7 @@ def handle_report_progress( last_active_step_items: list[str], streaming_service: Any, content_builder: Any | None, + thinking_metadata: dict[str, Any] | None = None, ) -> tuple[str | None, list[str]]: """Update report step items; may emit one thinking SSE frame. @@ -50,6 +51,7 @@ def handle_report_progress( title=last_active_step_title, status="in_progress", items=new_items, + metadata=thinking_metadata, ) return frame, new_items