diff --git a/crates/assistant2/src/active_thread.rs b/crates/assistant2/src/active_thread.rs index 9963f8913b..e420aa9c55 100644 --- a/crates/assistant2/src/active_thread.rs +++ b/crates/assistant2/src/active_thread.rs @@ -270,8 +270,15 @@ impl ActiveThread { let model_registry = LanguageModelRegistry::read_global(cx); if let Some(model) = model_registry.active_model() { self.thread.update(cx, |thread, cx| { - // Insert an empty user message to contain the tool results. - thread.insert_user_message("", Vec::new(), cx); + // Insert a user message to contain the tool results. + thread.insert_user_message( + // TODO: Sending up a user message without any content results in the model sending back + // responses that also don't have any content. We currently don't handle this case well, + // so for now we provide some text to keep the model on track. + "Here are the tool results.", + Vec::new(), + cx, + ); thread.send_to_model(model, RequestKind::Chat, true, cx); }); } @@ -295,10 +302,7 @@ impl ActiveThread { let colors = cx.theme().colors(); // Don't render user messages that are just there for returning tool results. - if message.role == Role::User - && message.text.is_empty() - && self.thread.read(cx).message_has_tool_results(message_id) - { + if message.role == Role::User && self.thread.read(cx).message_has_tool_results(message_id) { return Empty.into_any(); }