From 7ddc7b82da7dabb86a2d19f8b8bb6a56f781a1a5 Mon Sep 17 00:00:00 2001 From: Jazzcort Date: Wed, 2 Sep 2026 16:58:09 -0400 Subject: [PATCH] Fix missing refusal message in conversation/v2 when using streaming query When streaming completes without partial tokens, the LLM response was not being captured in the turn summary, causing refusal messages to be lost in conversation/v2 history. --- src/utils/agents/streaming.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/utils/agents/streaming.py b/src/utils/agents/streaming.py index 37a094f1c..9d500aacf 100644 --- a/src/utils/agents/streaming.py +++ b/src/utils/agents/streaming.py @@ -516,6 +516,11 @@ def _( ) state.chunk_id += 1 state.turn_summary.next_chunk_id = state.chunk_id + + # Fix the missing refusal message issue in conversation/v2 + if not state.turn_summary.partial_tokens: + state.turn_summary.llm_response = final_text + return payload