From 8917ab75913c429f6082cc7089c2e26b6cb01536 Mon Sep 17 00:00:00 2001 From: axb Date: Mon, 10 Mar 2025 12:12:25 +0800 Subject: [PATCH] fix duplicate ask --- src/core/Cline.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/core/Cline.ts b/src/core/Cline.ts index d26e75ce85..5bc280dc42 100644 --- a/src/core/Cline.ts +++ b/src/core/Cline.ts @@ -1402,8 +1402,12 @@ export class Cline { isCheckpointPossible = true } - const askApproval = async (type: ClineAsk, partialMessage?: string) => { - const { response, text, images } = await this.ask(type, partialMessage, false) + const askApproval = async ( + type: ClineAsk, + partialMessage?: string, + progressStatus?: ToolProgressStatus, + ) => { + const { response, text, images } = await this.ask(type, partialMessage, false, progressStatus) if (response !== "yesButtonClicked") { // Handle both messageResponse and noButtonClicked with text if (text) { @@ -1819,11 +1823,8 @@ export class Cline { if (this.diffStrategy && this.diffStrategy.getProgressStatus) { toolProgressStatus = this.diffStrategy.getProgressStatus(block, diffResult) } - await this.ask("tool", completeMessage, block.partial, toolProgressStatus).catch( - () => {}, - ) - const didApprove = await askApproval("tool", completeMessage) + const didApprove = await askApproval("tool", completeMessage, toolProgressStatus) if (!didApprove) { await this.diffViewProvider.revertChanges() // This likely handles closing the diff view break