From 48c9bd5fae8546423ea1b9de83acd354d3b6f30f Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Tue, 17 Jun 2025 10:40:37 -0400 Subject: [PATCH] Encourage use of start_line in multi-file diff to match legacy diff (#4777) --- src/core/diff/strategies/multi-file-search-replace.ts | 6 +++--- src/core/tools/multiApplyDiffTool.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/diff/strategies/multi-file-search-replace.ts b/src/core/diff/strategies/multi-file-search-replace.ts index d35f32685e..3450ae56bc 100644 --- a/src/core/diff/strategies/multi-file-search-replace.ts +++ b/src/core/diff/strategies/multi-file-search-replace.ts @@ -107,12 +107,12 @@ Parameters: - path: (required) The path of the file to modify (relative to the current workspace directory ${args.cwd}) - diff: (required) One or more diff elements containing: - content: (required) The search/replace block defining the changes. - - start_line: (optional) The line number of original content where the search block starts. + - start_line: (required) The line number of original content where the search block starts. Diff format: \`\`\` <<<<<<< SEARCH -:start_line: (optional) The line number of original content where the search block starts. +:start_line: (required) The line number of original content where the search block starts. ------- [exact content to find including whitespace] ======= @@ -294,7 +294,7 @@ Each file requires its own path, start_line, and diff elements. "\n" + "CORRECT FORMAT:\n\n" + "<<<<<<< SEARCH\n" + - ":start_line: (optional) The line number of original content where the search block starts.\n" + + ":start_line: (required) The line number of original content where the search block starts.\n" + "-------\n" + "[exact content to find including whitespace]\n" + "=======\n" + diff --git a/src/core/tools/multiApplyDiffTool.ts b/src/core/tools/multiApplyDiffTool.ts index a80075e10f..e477008940 100644 --- a/src/core/tools/multiApplyDiffTool.ts +++ b/src/core/tools/multiApplyDiffTool.ts @@ -153,7 +153,7 @@ Expected structure: relative/path/to/file.ext diff content here - optional line number + line number