Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

agent: Skip serializing empty fields in streaming edit file tool (#53510)

Bennet Bo Fenner60fac25960c9
diff --git a/crates/agent/src/tools/streaming_edit_file_tool.rs b/crates/agent/src/tools/streaming_edit_file_tool.rs
index 47da35bbf25..c988fede454 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<PathBuf>,
- #[serde(default)]
+ #[serde(default, skip_serializing_if = "String::is_empty")]
diff: String,
},
}