From e7f599bfb9e6690c9cb9e1a99f17b32d24aa36aa Mon Sep 17 00:00:00 2001 From: "roomote[bot]" <219738659+roomote[bot]@users.noreply.github.com> Date: Wed, 3 Sep 2025 22:35:40 -0400 Subject: [PATCH] fix: use askApproval wrapper in insert_content and search_and_replace tools (#7649) 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 Co-authored-by: Roo Code --- 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