From 60fac25960c95c20032f6a60a3a3beb620ff666d Mon Sep 17 00:00:00 2001 From: Bennet Bo Fenner Date: Fri, 10 Apr 2026 09:00:42 +0100 Subject: [PATCH] agent: Skip serializing empty fields in streaming edit file tool (#53510) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [ ] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A or Added/Fixed/Improved ... --- crates/agent/src/tools/streaming_edit_file_tool.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/agent/src/tools/streaming_edit_file_tool.rs b/crates/agent/src/tools/streaming_edit_file_tool.rs index 47da35bbf25ad188f3f6b98e843b2955910bb7ac..c988fede454ff6e8b4dc327c81132224a8b87a49 100644 --- a/crates/agent/src/tools/streaming_edit_file_tool.rs +++ b/crates/agent/src/tools/streaming_edit_file_tool.rs @@ -189,9 +189,9 @@ pub enum StreamingEditFileToolOutput { }, Error { error: String, - #[serde(default)] + #[serde(default, skip_serializing_if = "Option::is_none")] input_path: Option, - #[serde(default)] + #[serde(default, skip_serializing_if = "String::is_empty")] diff: String, }, }