Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/lowercase-edit-error-message.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@moonshot-ai/agent-core": patch
"@moonshot-ai/kimi-code": patch
---

Lowercase the stale file content message in edit tool errors.
4 changes: 2 additions & 2 deletions packages/agent-core/src/tools/builtin/file/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ export class EditTool implements BuiltinTool<EditInput> {
}

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) {
Expand All @@ -140,7 +140,7 @@ export class EditTool implements BuiltinTool<EditInput> {
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.
` };
}

Expand Down
Loading