fix: allow repeated tool calls with same tool_call_id

This commit is contained in:
Novice
2026-01-23 10:04:21 +08:00
parent 4707a319e5
commit 8f75be52a1

View File

@@ -186,6 +186,9 @@ class StreamEventBuffer:
idx = self._tool_call_id_map[tool_call_id]
self.tool_calls[idx]["result"] = result
self.tool_calls[idx]["elapsed_time"] = tool_elapsed_time
# Remove from map after result is recorded, so that subsequent calls
# with the same tool_call_id are treated as new tool calls
del self._tool_call_id_map[tool_call_id]
def finalize(self) -> None:
"""Finalize the buffer, flushing any pending data."""