Просмотр исходного кода

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 <[email protected]>
roomote[bot] 4 месяцев назад
Родитель
Сommit
e7f599bfb9
2 измененных файлов с 2 добавлено и 6 удалено
  1. 1 3
      src/core/tools/insertContentTool.ts
  2. 1 3
      src/core/tools/searchAndReplaceTool.ts

+ 1 - 3
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

+ 1 - 3
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