[Bugfix][ToolParser] Stream every tool call when one delta completes several (#60354)

Signed-off-by: Junyi Yao <j.yao@wustl.edu>
Signed-off-by: sfeng33 <4florafeng@gmail.com>
Co-authored-by: sfeng33 <4florafeng@gmail.com>
This commit is contained in:
Junyi Yao
2026-10-08 01:07:35 +00:00
committed by GitHub
co-authored by sfeng33
parent 2dd887426e
commit fdfc171a74
4 changed files with 338 additions and 202 deletions
-6
View File
@@ -640,12 +640,6 @@ class OnlineDerenderer:
if tc.index < len(last_tool_call_ids):
# Pin: reuse the ID already recorded for this index
# rather than one a from scratch replay regenerated.
# Real trigger not just defensive with
# tool_choice="required",
# extract_required_tool_call_streaming resets
# function_name_returned to False whenever the
# partial JSON transiently fails to parse which
# re-emits id+name for the same index on replay.
tc.id = last_tool_call_ids[tc.index]
else:
last_tool_call_ids.append(tc.id)