Merge pull request #2690 from LaZzyMan/fix/acp-permission-flow

fix(acp): align permission flow across clients
This commit is contained in:
Mingholy 2026-03-27 17:19:46 +08:00 committed by GitHub
commit f6c273d0a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 2092 additions and 1101 deletions

View file

@ -78,6 +78,12 @@ export const ToolConfirmationMessage: React.FC<
}, [config]);
const handleConfirm = async (outcome: ToolConfirmationOutcome) => {
// Call onConfirm before resolving the IDE diff so that the CLI outcome
// (e.g. ProceedAlways) is processed first. resolveDiffFromCli would
// otherwise trigger the scheduler's ideConfirmation .then() handler
// with ProceedOnce, racing with the intended CLI outcome.
onConfirm(outcome);
if (confirmationDetails.type === 'edit') {
if (config.getIdeMode() && isDiffingEnabled) {
const cliOutcome =
@ -88,7 +94,6 @@ export const ToolConfirmationMessage: React.FC<
);
}
}
onConfirm(outcome);
};
const isTrustedFolder = config.isTrustedFolder();