From d5a6697c9715da45be3f8dc321dde640405b39de Mon Sep 17 00:00:00 2001 From: uinstinct <61635505+uinstinct@users.noreply.github.com> Date: Wed, 29 Oct 2025 10:20:33 +0530 Subject: [PATCH] fix: use yolo when applying diff --- .../redux/thunks/handleApplyStateUpdate.ts | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/gui/src/redux/thunks/handleApplyStateUpdate.ts b/gui/src/redux/thunks/handleApplyStateUpdate.ts index bbb0b5206..a220af51f 100644 --- a/gui/src/redux/thunks/handleApplyStateUpdate.ts +++ b/gui/src/redux/thunks/handleApplyStateUpdate.ts @@ -44,13 +44,24 @@ export const handleApplyStateUpdate = createAsyncThunk< // Handle apply status updates - use toolCallId from event payload if (applyState.toolCallId) { - if (applyState.status === "closed") { - // Find the tool call to check if it was canceled - const toolCallState = findToolCallById( - getState().session.history, - applyState.toolCallId, - ); + const toolCallState = findToolCallById( + getState().session.history, + applyState.toolCallId, + ); + if ( + applyState.status === "done" && + toolCallState?.toolCall.function.name && + getState().ui.toolSettings[toolCallState.toolCall.function.name] === + "allowedWithoutPermission" + ) { + extra.ideMessenger.post("acceptDiff", { + streamId: applyState.streamId, + filepath: applyState.filepath, + }); + } + + if (applyState.status === "closed") { if (toolCallState) { const accepted = toolCallState.status !== "canceled";