From 31505f737e066dd8c6966597fe37b537fd6ecc57 Mon Sep 17 00:00:00 2001 From: krustophski Date: Fri, 25 Sep 2026 05:14:35 +0300 Subject: [PATCH] fix(gui): auto-accept diffs under Full Access mode, not just static "Automatic" handleApplyStateUpdate.ts already had an auto-accept-diff mechanism for when a tool's policy is "allowedWithoutPermission" -- but it read the tool's static ui.toolSettings entry directly, which Full Access mode never modifies (fullAccessMode overrides the EFFECTIVE policy only inside evaluateToolPolicies.ts's own local computation, without writing it back). So even with Full Access on and the edit tool call itself already auto-approved, the resulting diff still sat waiting for a manual Accept/Reject click -- the one prompt Full Access was supposed to eliminate entirely. Now also auto-accepts when fullAccessMode is on, mirroring the same "disabled tools stay excluded" exception used everywhere else Full Access overrides a policy. Co-Authored-By: Claude Sonnet 5 --- .../redux/thunks/handleApplyStateUpdate.ts | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) 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") {