Skip to content

Commit fd45dd0

Browse files
roomote[bot]roomote-agent
authored andcommitted
fix: use askApproval wrapper in insert_content and search_and_replace tools (RooCodeInc#7649)
Fixes issue where isWriteProtected was incorrectly passed as the partial flag to task.ask(), causing "Current ask promise was ignored (RooCodeInc#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 RooCodeInc#7648 Co-authored-by: Roo Code <[email protected]>
1 parent f4c7069 commit fd45dd0

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
@@ -224,9 +224,7 @@ export async function searchAndReplaceTool(
224224
cline.diffViewProvider.scrollToFirstDiff()
225225
}
226226

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

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

0 commit comments

Comments
 (0)