diff --git a/.changeset/lowercase-edit-error-message.md b/.changeset/lowercase-edit-error-message.md new file mode 100644 index 0000000000..b1a9b32570 --- /dev/null +++ b/.changeset/lowercase-edit-error-message.md @@ -0,0 +1,6 @@ +--- +"@moonshot-ai/agent-core": patch +"@moonshot-ai/kimi-code": patch +--- + +Lowercase the stale file content message in edit tool errors. \ No newline at end of file diff --git a/packages/agent-core/src/tools/builtin/file/edit.ts b/packages/agent-core/src/tools/builtin/file/edit.ts index 5c4b32a468..a5c77a2a42 100644 --- a/packages/agent-core/src/tools/builtin/file/edit.ts +++ b/packages/agent-core/src/tools/builtin/file/edit.ts @@ -117,7 +117,7 @@ export class EditTool implements BuiltinTool { } if (count === 0) { - return { isError: true, output: `old_string not found in ${args.path}, The file contents may be out of date. Please use the Read Tool to reload the content. + return { isError: true, output: `old_string not found in ${args.path}, the file contents may be out of date. Please use the Read Tool to reload the content. ` }; } if (count > 1) { @@ -140,7 +140,7 @@ export class EditTool implements BuiltinTool { const parts = content.split(args.old_string); const replacementCount = parts.length - 1; if (replacementCount === 0) { - return { isError: true, output: `old_string not found in ${args.path}, The file contents may be out of date. Please use the Read Tool to reload the content. + return { isError: true, output: `old_string not found in ${args.path}, the file contents may be out of date. Please use the Read Tool to reload the content. ` }; }