[Bugfix] [Parser] Fix empty tool block silently dropping subsequent content (#46091)

Signed-off-by: Ben Browning <bbrownin@redhat.com>
Co-authored-by: Flora Feng <4florafeng@gmail.com>
This commit is contained in:
Ben Browning
2026-06-18 23:17:18 +00:00
committed by GitHub
co-authored by Flora Feng
parent c3c6d723fd
commit 7f616c327d
4 changed files with 26 additions and 3 deletions
+1 -1
View File
@@ -672,7 +672,7 @@ class ParserEngine(Parser):
if len(tool_call_deltas) > 1:
tool_call_deltas = self._coalesce_tool_call_deltas(tool_call_deltas)
if self._deferred_content and not seen_tool_event:
if self._deferred_content and (not seen_tool_event or not tool_call_deltas):
content_parts.insert(0, self._deferred_content)
self._deferred_content = ""