fix(gui): auto-accept diffs under Full Access mode, not just static "Automatic"
Some checks are pending
Main Branch Build / republish-pr-artifacts (Linux) (push) Waiting to run
Main Branch Build / republish-pr-artifacts (macOS) (push) Waiting to run
PR Checks / track-rerun (push) Waiting to run
PR Checks / prettier-check (push) Waiting to run
PR Checks / core-checks (push) Waiting to run
PR Checks / gui-checks (push) Waiting to run
PR Checks / binary-checks (push) Waiting to run
PR Checks / vscode-checks (push) Waiting to run
PR Checks / get-packages-matrix (push) Waiting to run
PR Checks / packages-checks (push) Blocked by required conditions
PR Checks / vscode-get-test-file-matrix (push) Waiting to run
PR Checks / vscode-package-extension-linux (push) Waiting to run
PR Checks / unknown () (push) Blocked by required conditions
PR Checks / jetbrains-tests (push) Waiting to run
PR Checks / require-all-checks-to-pass (push) Blocked by required conditions
Submit Gradle Dependency Graph For Dependabot / dependency-submission (push) Waiting to run

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 <noreply@anthropic.com>
This commit is contained in:
krustophski 2026-09-25 05:14:35 +03:00
parent c2cdd1957e
commit 31505f737e

View file

@ -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") {