diff --git a/gui/src/redux/thunks/handleApplyStateUpdate.ts b/gui/src/redux/thunks/handleApplyStateUpdate.ts index a220af51f..3686713ce 100644 --- a/gui/src/redux/thunks/handleApplyStateUpdate.ts +++ b/gui/src/redux/thunks/handleApplyStateUpdate.ts @@ -51,14 +51,28 @@ export const handleApplyStateUpdate = createAsyncThunk< if ( applyState.status === "done" && - toolCallState?.toolCall.function.name && - getState().ui.toolSettings[toolCallState.toolCall.function.name] === - "allowedWithoutPermission" + toolCallState?.toolCall.function.name ) { - extra.ideMessenger.post("acceptDiff", { - streamId: applyState.streamId, - filepath: applyState.filepath, - }); + const toolName = toolCallState.toolCall.function.name; + const rawPolicy = getState().ui.toolSettings[toolName]; + // Full Access mode auto-approves the tool call itself (see + // evaluateToolPolicies.ts), but that override lives only in the + // thunk that evaluates the call -- it never gets written back + // into ui.toolSettings, so this check (which predates Full + // Access mode) still saw the tool's original static policy and + // never auto-accepted the resulting diff, leaving an + // Accept/Reject prompt visible even with Full Access on. Mirror + // the same "disabled tools stay excluded" exception used + // everywhere else Full Access overrides a policy. + const autoApproved = + rawPolicy === "allowedWithoutPermission" || + (getState().ui.fullAccessMode && rawPolicy !== "disabled"); + if (autoApproved) { + extra.ideMessenger.post("acceptDiff", { + streamId: applyState.streamId, + filepath: applyState.filepath, + }); + } } if (applyState.status === "closed") {