Elffuss BraidHub

kikocis/continue public

fix: edit tool prompt updates to encourage multi edits to avoid linting effects (#7998)

fix: prompt updates for linting effects
Changeset2e6f3439cd004ad1d3a5183e7a551e66c9ae7f26ada216703025c1245b130d8f
AuthorDallin Romney <dallinromney@gmail.com> · 2025-09-26 17:07 -07:00
CommitterGitHub <noreply@github.com> · 2025-09-26 17:07 -07:00
Parents574faa3a4add

Browse the files at this changeset

2 files changed

modified core/tools/definitions/multiEdit.ts +2 −3
@@ -1,7 +1,6 @@
11 import { Tool } from "../..";
22 import { BUILT_IN_GROUP_NAME, BuiltInToolNames } from "../builtIn";
33 import { NO_PARALLEL_TOOL_CALLING_INSTRUCTION } from "./editFile";
4-import { singleFindAndReplaceTool } from "./singleFindAndReplace";
54
65 export interface EditOperation {
76 old_string: string;
@@ -25,8 +24,7 @@
2524 isInstant: false,
2625 function: {
2726 name: BuiltInToolNames.MultiEdit,
28- description: `This is a tool for making multiple edits to a single file in one operation. It is built on top of the ${singleFindAndReplaceTool.function.name} and allows you to perform multiple find-and-replace operations efficiently.
29-Prefer this tool over the ${singleFindAndReplaceTool.function.name} tool when you need to make multiple edits to the same file.
27+ description: `Use this tool to make multiple edits to a single file in one operation. It allows you to perform multiple find-and-replace operations efficiently.
3028
3129 To make multiple edits to a file, provide the following:
3230 1. filepath: The path to the file to modify, RELATIVE to the project/workspace root (verify the directory path is correct)
@@ -36,6 +34,7 @@
3634 - replace_all: Replace all occurrences of old_string. This parameter is optional and defaults to false.
3735
3836 IMPORTANT:
37+- Files may be modified between tool calls by users, linters, etc, so always make all edits in one tool call where possible. For example, do not only edit imports if there are other changes in the file, as unused imports may be removed by a linter between tool calls.
3938 - All edits are applied in sequence, in the order they are provided
4039 - Each edit operates on the result of the previous edit, so plan your edits carefully to avoid conflicts between sequential operations
4140 - Edits are atomic - all edits must be valid for the operation to succeed - if any edit fails, none will be applied
modified extensions/cli/src/tools/multiEdit.ts +4 −3
@@ -10,7 +10,7 @@
1010 getLanguageFromFilePath,
1111 } from "../telemetry/utils.js";
1212
13-import { validateAndResolveFilePath } from "./edit.js";
13+import { editTool, validateAndResolveFilePath } from "./edit.js";
1414 import { readFileTool } from "./readFile.js";
1515 import { Tool } from "./types.js";
1616 import { generateDiff } from "./writeFile.js";
@@ -31,8 +31,8 @@
3131 displayName: "MultiEdit",
3232 readonly: false,
3333 isBuiltIn: true,
34- description: `This is a tool for making multiple edits to a single file in one operation. It allows you to perform multiple find-and-replace operations efficiently.
35-This tool is ideal when you need to make multiple edits to the same file.
34+ description: `Use this tool to make multiple edits to a single file in one operation. It allows you to perform multiple find-and-replace operations efficiently.
35+Prefer this tool over the ${editTool.name} tool when you need to make multiple edits to the same file.
3636
3737 To make multiple edits to a file, provide the following:
3838 1. file_path: The absolute path to the file to modify. Relative paths can also be used (resolved against cwd) but absolute is preferred
@@ -42,6 +42,7 @@
4242 - replace_all: Replace all occurrences of old_string. This parameter is optional and defaults to false.
4343
4444 IMPORTANT:
45+- Files may be modified between tool calls by users, linters, etc, so always make all edits in one tool call where possible. For example, do not only edit imports if there are other changes in the file, as unused imports may be removed by a linter between tool calls.
4546 - All edits are applied in sequence, in the order they are provided
4647 - Each edit operates on the result of the previous edit, so plan your edits carefully to avoid conflicts between sequential operations
4748 - Edits are atomic - all edits must be valid for the operation to succeed - if any edit fails, none will be applied