From 8f75be52a154d4e1077477875de0f62cdb1b2c1a Mon Sep 17 00:00:00 2001 From: Novice Date: Fri, 23 Jan 2026 10:04:21 +0800 Subject: [PATCH] fix: allow repeated tool calls with same tool_call_id --- api/core/app/apps/advanced_chat/generate_task_pipeline.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/api/core/app/apps/advanced_chat/generate_task_pipeline.py b/api/core/app/apps/advanced_chat/generate_task_pipeline.py index 095b2d4650..232e02ec6d 100644 --- a/api/core/app/apps/advanced_chat/generate_task_pipeline.py +++ b/api/core/app/apps/advanced_chat/generate_task_pipeline.py @@ -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."""