@@ -11,7 +11,7 @@ import { fetchInstructionsTool } from "../tools/fetchInstructionsTool"
1111import { listFilesTool } from "../tools/listFilesTool"
1212import { getReadFileToolDescription , readFileTool } from "../tools/readFileTool"
1313import { writeToFileTool } from "../tools/writeToFileTool"
14- import { applyDiffTool } from "../tools/applyDiffTool "
14+ import { applyDiffTool } from "../tools/multiApplyDiffTool "
1515import { insertContentTool } from "../tools/insertContentTool"
1616import { searchAndReplaceTool } from "../tools/searchAndReplaceTool"
1717import { listCodeDefinitionNamesTool } from "../tools/listCodeDefinitionNamesTool"
@@ -31,6 +31,8 @@ import { formatResponse } from "../prompts/responses"
3131import { validateToolUse } from "../tools/validateToolUse"
3232import { Task } from "../task/Task"
3333import { codebaseSearchTool } from "../tools/codebaseSearchTool"
34+ import { experiments } from "../../shared/experiments"
35+ import { applyDiffToolLegacy } from "../tools/applyDiffTool"
3436
3537/**
3638 * Processes and presents assistant message content to the user interface.
@@ -385,7 +387,18 @@ export async function presentAssistantMessage(cline: Task) {
385387 await writeToFileTool ( cline , block , askApproval , handleError , pushToolResult , removeClosingTag )
386388 break
387389 case "apply_diff" :
388- await applyDiffTool ( cline , block , askApproval , handleError , pushToolResult , removeClosingTag )
390+ if ( experiments . get ( "MULTI_FILE_APPLY_DIFF" ) ?. enabled ) {
391+ await applyDiffTool ( cline , block , askApproval , handleError , pushToolResult , removeClosingTag )
392+ } else {
393+ await applyDiffToolLegacy (
394+ cline ,
395+ block ,
396+ askApproval ,
397+ handleError ,
398+ pushToolResult ,
399+ removeClosingTag ,
400+ )
401+ }
389402 break
390403 case "insert_content" :
391404 await insertContentTool ( cline , block , askApproval , handleError , pushToolResult , removeClosingTag )
0 commit comments