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.

Don't send dummy user text with tool results (#29099)

Nathan Sobod48152d95869
diff --git a/crates/agent/src/thread.rs b/crates/agent/src/thread.rs
index 1929daf2ede..e8ca584fa0e 100644
--- a/crates/agent/src/thread.rs
+++ b/crates/agent/src/thread.rs
@@ -1663,9 +1663,10 @@ impl Thread {
/// Insert an empty message to be populated with tool results upon send.
pub fn attach_tool_results(&mut self, cx: &mut Context<Self>) {
- // TODO: Don't insert a dummy user message here. Ensure this works with the thinking model.
- // Insert a user message to contain the tool results.
- self.insert_user_message("Here are the tool results.", Vec::new(), None, cx);
+ // Tool results are assumed to be waiting on the next message id, so they will populate
+ // this empty message before sending to model. Would prefer this to be more straightforward.
+ self.insert_message(Role::User, vec![], cx);
+ self.auto_capture_telemetry(cx);
}
/// Cancels the last pending completion, if there are any pending.