Skip to content

Commit e8bef3f

Browse files
committed
Remove the append_to_file tool
1 parent 9f61240 commit e8bef3f

File tree

11 files changed

+14
-831
lines changed

11 files changed

+14
-831
lines changed

src/core/Cline.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ import { askFollowupQuestionTool } from "./tools/askFollowupQuestionTool"
7878
import { switchModeTool } from "./tools/switchModeTool"
7979
import { attemptCompletionTool } from "./tools/attemptCompletionTool"
8080
import { newTaskTool } from "./tools/newTaskTool"
81-
import { appendToFileTool } from "./tools/appendToFileTool"
8281

8382
// prompts
8483
import { formatResponse } from "./prompts/responses"
@@ -1242,8 +1241,6 @@ export class Cline extends EventEmitter<ClineEvents> {
12421241
return `[${block.name} for '${block.params.task}']`
12431242
case "write_to_file":
12441243
return `[${block.name} for '${block.params.path}']`
1245-
case "append_to_file":
1246-
return `[${block.name} for '${block.params.path}']`
12471244
case "apply_diff":
12481245
return `[${block.name} for '${block.params.path}']`
12491246
case "search_files":
@@ -1428,9 +1425,6 @@ export class Cline extends EventEmitter<ClineEvents> {
14281425
case "write_to_file":
14291426
await writeToFileTool(this, block, askApproval, handleError, pushToolResult, removeClosingTag)
14301427
break
1431-
case "append_to_file":
1432-
await appendToFileTool(this, block, askApproval, handleError, pushToolResult, removeClosingTag)
1433-
break
14341428
case "apply_diff":
14351429
await applyDiffTool(this, block, askApproval, handleError, pushToolResult, removeClosingTag)
14361430
break

src/core/prompts/__tests__/__snapshots__/system.test.ts.snap

Lines changed: 12 additions & 266 deletions
Large diffs are not rendered by default.

src/core/prompts/sections/rules.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,12 @@ function getEditingInstructions(diffStrategy?: DiffStrategy, experiments?: Recor
1414
availableTools.push("write_to_file (for creating new files or complete file rewrites)")
1515
}
1616

17-
availableTools.push("append_to_file (for appending content to the end of files)")
1817
availableTools.push("insert_content (for adding lines to existing files)")
1918
availableTools.push("search_and_replace (for finding and replacing individual pieces of text)")
2019

2120
// Base editing instruction mentioning all available tools
2221
if (availableTools.length > 1) {
23-
instructions.push(
24-
`- For editing files, you have access to these tools: ${availableTools.join(", ")}.`,
25-
"- The append_to_file tool adds content to the end of files, such as appending new log entries or adding new data records. This tool will always add the content at the end of the file.",
26-
)
22+
instructions.push(`- For editing files, you have access to these tools: ${availableTools.join(", ")}.`)
2723
}
2824

2925
// Additional details for experimental features

src/core/prompts/tools/append-to-file.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/core/prompts/tools/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { getExecuteCommandDescription } from "./execute-command"
88
import { getReadFileDescription } from "./read-file"
99
import { getFetchInstructionsDescription } from "./fetch-instructions"
1010
import { getWriteToFileDescription } from "./write-to-file"
11-
import { getAppendToFileDescription } from "./append-to-file"
1211
import { getSearchFilesDescription } from "./search-files"
1312
import { getListFilesDescription } from "./list-files"
1413
import { getInsertContentDescription } from "./insert-content"
@@ -28,7 +27,6 @@ const toolDescriptionMap: Record<string, (args: ToolArgs) => string | undefined>
2827
read_file: (args) => getReadFileDescription(args),
2928
fetch_instructions: () => getFetchInstructionsDescription(),
3029
write_to_file: (args) => getWriteToFileDescription(args),
31-
append_to_file: (args) => getAppendToFileDescription(args),
3230
search_files: (args) => getSearchFilesDescription(args),
3331
list_files: (args) => getListFilesDescription(args),
3432
list_code_definition_names: (args) => getListCodeDefinitionNamesDescription(args),
@@ -113,7 +111,6 @@ export {
113111
getReadFileDescription,
114112
getFetchInstructionsDescription,
115113
getWriteToFileDescription,
116-
getAppendToFileDescription,
117114
getSearchFilesDescription,
118115
getListFilesDescription,
119116
getListCodeDefinitionNamesDescription,

0 commit comments

Comments
 (0)