Compare commits

...

5 Commits

Author SHA1 Message Date
pashpashpash d366ff3744 language 2025-03-28 11:40:49 -07:00
pashpashpash d780bc13ca typo 2025-03-28 10:07:33 -07:00
pashpashpash 3e36044d6c bias 2025-03-28 10:00:55 -07:00
pashpashpash 2e8db59904 changeset 2025-03-28 09:53:29 -07:00
pashpashpash 3da65208d8 updated feedback to model when diff edit fails 2025-03-28 09:44:50 -07:00
2 changed files with 8 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": minor
---
improving search and replace edit failure behaviors
+3 -1
View File
@@ -1754,7 +1754,9 @@ export class Cline {
`This is likely because the SEARCH block content doesn't match exactly with what's in the file, or if you used multiple SEARCH/REPLACE blocks they may not have been in the order they appear in the file.\n\n` +
`The file was reverted to its original state:\n\n` +
`<file_content path="${relPath.toPosix()}">\n${this.diffViewProvider.originalContent}\n</file_content>\n\n` +
`Try again with fewer/more precise SEARCH blocks.\n(If you run into this error two times in a row, you may use the write_to_file tool as a fallback.)`,
`First, make sure you call the read_file tool and re-read the file again in case any changes were made, to get its latest state. Then, make a proper, TARGETED search and replace edit using the write_to_file tool.` +
`You may want to try fewer/more precise SEARCH blocks.\n(If you run into this error three times in a row, you may use the write_to_file tool as a fallback. ` +
`Keep in mind, the write_to_file fallback is far from ideal, as this means you'll be re-writing the entire contents of the file just to make a few edits, which takes time and money. So let's bias towards using replace_in_file as effectively as possible)`,
),
)
await this.diffViewProvider.revertChanges()