From 148d84fe03208e1e522c55cefda13d9aa360682d Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Tue, 8 Jul 2025 15:37:23 -0700 Subject: [PATCH] Remove backward compatibility check in addToolCallDeltaToState MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - This allows parallel tool calls to be processed without ID conflicts - Tool calls are now stored correctly but still need state transition fix 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .../retrieval/pipelines/BaseRetrievalPipeline.ts | 2 +- core/tools/definitions/{lsTool.ts => ls.ts} | 0 core/tools/index.ts | 2 +- gui/src/redux/thunks/streamNormalInput.ts | 1 + gui/src/util/toolCallState.ts | 13 ------------- 5 files changed, 3 insertions(+), 15 deletions(-) rename core/tools/definitions/{lsTool.ts => ls.ts} (100%) diff --git a/core/context/retrieval/pipelines/BaseRetrievalPipeline.ts b/core/context/retrieval/pipelines/BaseRetrievalPipeline.ts index 5089678c1..80328decb 100644 --- a/core/context/retrieval/pipelines/BaseRetrievalPipeline.ts +++ b/core/context/retrieval/pipelines/BaseRetrievalPipeline.ts @@ -19,7 +19,7 @@ import { BuiltInToolNames } from "../../../tools/builtIn"; import { callBuiltInTool } from "../../../tools/callTool"; import { globSearchTool } from "../../../tools/definitions/globSearch"; import { grepSearchTool } from "../../../tools/definitions/grepSearch"; -import { lsTool } from "../../../tools/definitions/lsTool"; +import { lsTool } from "../../../tools/definitions/ls"; import { readFileTool } from "../../../tools/definitions/readFile"; import { viewRepoMapTool } from "../../../tools/definitions/viewRepoMap"; import { viewSubdirectoryTool } from "../../../tools/definitions/viewSubdirectory"; diff --git a/core/tools/definitions/lsTool.ts b/core/tools/definitions/ls.ts similarity index 100% rename from core/tools/definitions/lsTool.ts rename to core/tools/definitions/ls.ts diff --git a/core/tools/index.ts b/core/tools/index.ts index 198438eb1..b2d4722ad 100644 --- a/core/tools/index.ts +++ b/core/tools/index.ts @@ -6,7 +6,7 @@ import { editFileTool } from "./definitions/editFile"; import { fetchUrlContentTool } from "./definitions/fetchUrlContent"; import { globSearchTool } from "./definitions/globSearch"; import { grepSearchTool } from "./definitions/grepSearch"; -import { lsTool } from "./definitions/lsTool"; +import { lsTool } from "./definitions/ls"; import { readCurrentlyOpenFileTool } from "./definitions/readCurrentlyOpenFile"; import { readFileTool } from "./definitions/readFile"; import { requestRuleTool } from "./definitions/requestRule"; diff --git a/gui/src/redux/thunks/streamNormalInput.ts b/gui/src/redux/thunks/streamNormalInput.ts index c30c5a34a..2d5806895 100644 --- a/gui/src/redux/thunks/streamNormalInput.ts +++ b/gui/src/redux/thunks/streamNormalInput.ts @@ -149,6 +149,7 @@ export const streamNormalInput = createAsyncThunk< const toolSettings = newState.ui.toolSettings; const toolCallStates = selectCurrentToolCalls(newState); + for (const toolCallState of toolCallStates) { dispatch( setToolGenerated({ diff --git a/gui/src/util/toolCallState.ts b/gui/src/util/toolCallState.ts index e5d22036f..eb0274aed 100644 --- a/gui/src/util/toolCallState.ts +++ b/gui/src/util/toolCallState.ts @@ -8,19 +8,6 @@ export function addToolCallDeltaToState( toolCallDelta: ToolCallDelta, currentState: ToolCallState | undefined, ): ToolCallState { - // For parallel tool calls, we no longer ignore new tool call IDs - // Each tool call delta should be processed separately - // This preserves backward compatibility for single tool calls - if ( - toolCallDelta.id && - currentState?.toolCallId && - toolCallDelta.id !== currentState?.toolCallId - ) { - // For parallel tool calls, we should create a new state for the new tool call - // instead of ignoring it, but for now we'll return the current state to maintain - // backward compatibility. The parallel logic will be handled at a higher level. - return currentState; - } const currentCall = currentState?.toolCall;