From 3dfa10502e1a2e890f1e1b67baee652977966b37 Mon Sep 17 00:00:00 2001 From: Roo Code Date: Thu, 4 Sep 2025 00:06:06 +0000 Subject: [PATCH] fix: use askApproval wrapper in insert_content and search_and_replace tools Fixes issue where isWriteProtected was incorrectly passed as the partial flag to task.ask(), causing "Current ask promise was ignored (#1)" error. Both tools now use the askApproval wrapper function which correctly handles the parameter ordering, passing undefined for progressStatus and isWriteProtected as the fourth parameter. Fixes #7648 --- src/core/tools/insertContentTool.ts | 4 +--- src/core/tools/searchAndReplaceTool.ts | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/core/tools/insertContentTool.ts b/src/core/tools/insertContentTool.ts index b5e85dea30..e22a368167 100644 --- a/src/core/tools/insertContentTool.ts +++ b/src/core/tools/insertContentTool.ts @@ -153,9 +153,7 @@ export async function insertContentTool( } // Ask for approval (same for both flows) - const didApprove = await cline - .ask("tool", completeMessage, isWriteProtected) - .then((response) => response.response === "yesButtonClicked") + const didApprove = await askApproval("tool", completeMessage, undefined, isWriteProtected) if (!didApprove) { // Revert changes if diff view was shown diff --git a/src/core/tools/searchAndReplaceTool.ts b/src/core/tools/searchAndReplaceTool.ts index 50f4868b50..4912934415 100644 --- a/src/core/tools/searchAndReplaceTool.ts +++ b/src/core/tools/searchAndReplaceTool.ts @@ -223,9 +223,7 @@ export async function searchAndReplaceTool( cline.diffViewProvider.scrollToFirstDiff() } - const didApprove = await cline - .ask("tool", completeMessage, isWriteProtected) - .then((response) => response.response === "yesButtonClicked") + const didApprove = await askApproval("tool", completeMessage, undefined, isWriteProtected) if (!didApprove) { // Revert changes if diff view was shown