diff --git a/crates/agent/src/thread.rs b/crates/agent/src/thread.rs index 1929daf2ed..e8ca584fa0 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) { - // 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.