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,