Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions packages/types/src/experiment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ import type { Keys, Equals, AssertEqual } from "./type-fu.js"
* ExperimentId
*/

export const experimentIds = [
"powerSteering",
"marketplace",
"concurrentFileReads",
"disableCompletionCommand",
] as const
export const experimentIds = ["powerSteering", "concurrentFileReads", "disableCompletionCommand", "marketplace", "multiFileApplyDiff"] as const

export const experimentIdsSchema = z.enum(experimentIds)

Expand All @@ -26,6 +21,7 @@ export const experimentsSchema = z.object({
marketplace: z.boolean(),
concurrentFileReads: z.boolean(),
disableCompletionCommand: z.boolean(),
multiFileApplyDiff: z.boolean(),
})

export type Experiments = z.infer<typeof experimentsSchema>
Expand Down
17 changes: 15 additions & 2 deletions src/core/assistant-message/presentAssistantMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { fetchInstructionsTool } from "../tools/fetchInstructionsTool"
import { listFilesTool } from "../tools/listFilesTool"
import { getReadFileToolDescription, readFileTool } from "../tools/readFileTool"
import { writeToFileTool } from "../tools/writeToFileTool"
import { applyDiffTool } from "../tools/applyDiffTool"
import { applyDiffTool } from "../tools/multiApplyDiffTool"
import { insertContentTool } from "../tools/insertContentTool"
import { searchAndReplaceTool } from "../tools/searchAndReplaceTool"
import { listCodeDefinitionNamesTool } from "../tools/listCodeDefinitionNamesTool"
Expand All @@ -31,6 +31,8 @@ import { formatResponse } from "../prompts/responses"
import { validateToolUse } from "../tools/validateToolUse"
import { Task } from "../task/Task"
import { codebaseSearchTool } from "../tools/codebaseSearchTool"
import { experiments } from "../../shared/experiments"
import { applyDiffToolLegacy } from "../tools/applyDiffTool"

/**
* Processes and presents assistant message content to the user interface.
Expand Down Expand Up @@ -385,7 +387,18 @@ export async function presentAssistantMessage(cline: Task) {
await writeToFileTool(cline, block, askApproval, handleError, pushToolResult, removeClosingTag)
break
case "apply_diff":
await applyDiffTool(cline, block, askApproval, handleError, pushToolResult, removeClosingTag)
if (experiments.get("MULTI_FILE_APPLY_DIFF")?.enabled) {
await applyDiffTool(cline, block, askApproval, handleError, pushToolResult, removeClosingTag)
} else {
await applyDiffToolLegacy(
cline,
block,
askApproval,
handleError,
pushToolResult,
removeClosingTag,
)
}
break
case "insert_content":
await insertContentTool(cline, block, askApproval, handleError, pushToolResult, removeClosingTag)
Expand Down
Loading
Loading