From 3fe3776f5270a629d9ec81521594ff80a95e8181 Mon Sep 17 00:00:00 2001 From: Bennet Bo Fenner Date: Fri, 6 Mar 2026 15:27:18 +0100 Subject: [PATCH] agent: Update `old_text` docs for `StreamingEditFileTool` (#50921) In the old edit agent tool we encouraged the LLM to respond with whole lines, which we did not do in the new edit file tool. Release Notes: - N/A --- crates/agent/src/tools/streaming_edit_file_tool.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/agent/src/tools/streaming_edit_file_tool.rs b/crates/agent/src/tools/streaming_edit_file_tool.rs index 81846ec282a52cc694a0f1c8e8418b5202d7e0d6..c326ed3c10170d1c45517103ba02e178bec32c36 100644 --- a/crates/agent/src/tools/streaming_edit_file_tool.rs +++ b/crates/agent/src/tools/streaming_edit_file_tool.rs @@ -108,6 +108,11 @@ pub enum StreamingEditFileMode { pub struct Edit { /// The exact text to find in the file. This will be matched using fuzzy matching /// to handle minor differences in whitespace or formatting. + /// + /// Always include complete lines. Do not start or end mid-line. + /// Be minimal with replacements: + /// - For unique lines, include only those lines + /// - For non-unique lines, include enough context to identify them pub old_text: String, /// The text to replace it with pub new_text: String,