Skip to content

Commit 3dfa105

Browse files
committed
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
1 parent 1f5ee43 commit 3dfa105

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/core/tools/insertContentTool.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,7 @@ export async function insertContentTool(
153153
}
154154

155155
// Ask for approval (same for both flows)
156-
const didApprove = await cline
157-
.ask("tool", completeMessage, isWriteProtected)
158-
.then((response) => response.response === "yesButtonClicked")
156+
const didApprove = await askApproval("tool", completeMessage, undefined, isWriteProtected)
159157

160158
if (!didApprove) {
161159
// Revert changes if diff view was shown

src/core/tools/searchAndReplaceTool.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,7 @@ export async function searchAndReplaceTool(
223223
cline.diffViewProvider.scrollToFirstDiff()
224224
}
225225

226-
const didApprove = await cline
227-
.ask("tool", completeMessage, isWriteProtected)
228-
.then((response) => response.response === "yesButtonClicked")
226+
const didApprove = await askApproval("tool", completeMessage, undefined, isWriteProtected)
229227

230228
if (!didApprove) {
231229
// Revert changes if diff view was shown

0 commit comments

Comments
 (0)