From 879843514c6ceca0b591e8884f596144a7877941 Mon Sep 17 00:00:00 2001 From: Sandy Tao Date: Wed, 21 Jan 2026 14:25:36 -0800 Subject: [PATCH] fix(core): simplify replace tool error message (#17246) --- packages/core/src/tools/edit.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/tools/edit.ts b/packages/core/src/tools/edit.ts index a133c0e2cf..088ec9d0d3 100644 --- a/packages/core/src/tools/edit.ts +++ b/packages/core/src/tools/edit.ts @@ -328,7 +328,7 @@ export function getErrorReplaceResult( if (occurrences === 0) { error = { display: `Failed to edit, could not find the string to replace.`, - raw: `Failed to edit, 0 occurrences found for old_string (${finalOldString}). Original old_string was (${params.old_string}) in ${params.file_path}. No edits made. The exact text in old_string was not found. Ensure you're not escaping content incorrectly and check whitespace, indentation, and context. Use ${READ_FILE_TOOL_NAME} tool to verify.`, + raw: `Failed to edit, 0 occurrences found for old_string in ${params.file_path}. Ensure you're not escaping content incorrectly and check whitespace, indentation, and context. Use ${READ_FILE_TOOL_NAME} tool to verify.`, type: ToolErrorType.EDIT_NO_OCCURRENCE_FOUND, }; } else if (occurrences !== expectedReplacements) {