From aa50f54999b96f4875d71ce9c84f71ca8ea8737a Mon Sep 17 00:00:00 2001 From: Patrick Erichsen Date: Tue, 8 Jul 2025 13:15:06 -0700 Subject: [PATCH] Update streamNormalInput to handle multiple tool calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Changed from selectCurrentToolCall to selectCurrentToolCalls selector - Added loop to iterate over all tool calls in a response - Each tool call is marked as "generated" with setToolGenerated - Auto-execute tools with "allowedWithoutPermission" policy - Tools with "allowedWithPermission" require manual approval - Maintains backward compatibility with single tool calls - TypeScript compilation passes, core functionality verified 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- gui/src/redux/thunks/streamNormalInput.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gui/src/redux/thunks/streamNormalInput.ts b/gui/src/redux/thunks/streamNormalInput.ts index 3648ee1ba..004dade9d 100644 --- a/gui/src/redux/thunks/streamNormalInput.ts +++ b/gui/src/redux/thunks/streamNormalInput.ts @@ -3,7 +3,7 @@ import { LLMFullCompletionOptions } from "core"; import { modelSupportsTools } from "core/llm/autodetect"; import { ToCoreProtocol } from "core/protocol"; import { selectActiveTools } from "../selectors/selectActiveTools"; -import { selectCurrentToolCall } from "../selectors/selectCurrentToolCall"; +import { selectCurrentToolCalls } from "../selectors/selectCurrentToolCall"; import { selectSelectedChatModel } from "../slices/configSlice"; import { abortStream, @@ -144,11 +144,12 @@ export const streamNormalInput = createAsyncThunk< } } - // If it's a tool call that is automatically accepted, we should call it + // Handle multiple tool calls that may be automatically accepted const newState = getState(); const toolSettings = newState.ui.toolSettings; - const toolCallState = selectCurrentToolCall(newState); - if (toolCallState) { + const toolCallStates = selectCurrentToolCalls(newState); + + for (const toolCallState of toolCallStates) { dispatch( setToolGenerated({ toolCallId: toolCallState.toolCallId,