From f7833987127a75ee10e8e093da50a4ec44148347 Mon Sep 17 00:00:00 2001 From: PaperPlaneDeemo <26437093+PaperPlaneDeemo@users.noreply.github.com> Date: Wed, 3 Jun 2026 22:22:02 +0800 Subject: [PATCH] fix: lowercase edit stale-content message --- .changeset/lowercase-edit-error-message.md | 6 ++++++ packages/agent-core/src/tools/builtin/file/edit.ts | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/lowercase-edit-error-message.md 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. ` }; }