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 <roomote@roocode.com>
This commit is contained in:
roomote[bot] 2025-09-03 22:35:40 -04:00 committed by GitHub
parent 0126c5dd46
commit e7f599bfb9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 6 deletions

View file

@ -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

View file

@ -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