@@ -100,7 +100,7 @@ export async function searchAndReplaceTool(
100100
101101 if ( ! fileExists ) {
102102 cline . consecutiveMistakeCount ++
103- cline . recordToolError ( "apply_diff " , "file_does_not_exist" )
103+ cline . recordToolError ( "search_and_replace " , "file_does_not_exist" )
104104 const formattedError = formatResponse . toolError (
105105 `File does not exist at path: ${ absolutePath } \nThe specified file could not be found. Please verify the file path and try again.` ,
106106 )
@@ -118,7 +118,7 @@ export async function searchAndReplaceTool(
118118 fileContent = await fs . readFile ( absolutePath , "utf-8" )
119119 } catch ( error ) {
120120 cline . consecutiveMistakeCount ++
121- cline . recordToolError ( "apply_diff " , "exception" )
121+ cline . recordToolError ( "search_and_replace " , "exception" )
122122 const errorMessage = `Error reading file: ${ absolutePath } \nFailed to read the file content: ${
123123 error instanceof Error ? error . message : String ( error )
124124 } \nPlease verify file permissions and try again.`
@@ -138,7 +138,7 @@ export async function searchAndReplaceTool(
138138 const matchCount = fileContent . match ( searchPattern ) ?. length ?? 0
139139 if ( matchCount > 1 ) {
140140 cline . consecutiveMistakeCount ++
141- cline . recordToolError ( "apply_diff " , "multiple_matches" )
141+ cline . recordToolError ( "search_and_replace " , "multiple_matches" )
142142 pushToolResult (
143143 formatResponse . toolError (
144144 `Found ${ matchCount } matches for replacement text. Please provide more context to make a unique match.` ,
@@ -156,7 +156,7 @@ export async function searchAndReplaceTool(
156156 const diff = formatResponse . createPrettyPatch ( validRelPath , fileContent , newContent )
157157 if ( ! diff ) {
158158 cline . consecutiveMistakeCount ++
159- cline . recordToolError ( "apply_diff " , "no_match" )
159+ cline . recordToolError ( "search_and_replace " , "no_match" )
160160 pushToolResult (
161161 formatResponse . toolError (
162162 `No match found for replacement in '${ validRelPath } '. Please check your text and try again.` ,
@@ -227,7 +227,7 @@ export async function searchAndReplaceTool(
227227 pushToolResult ( message )
228228
229229 // Record successful tool usage and cleanup
230- cline . recordToolUsage ( "apply_diff " )
230+ cline . recordToolUsage ( "search_and_replace " )
231231 await cline . diffViewProvider . reset ( )
232232
233233 // Process any queued messages after file edit completes
0 commit comments