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.

assistant2: Only add context if it is non-empty (#22141)

Marshall Bowers6fa5a1758605
diff --git a/crates/assistant2/src/context.rs b/crates/assistant2/src/context.rs
index b83e3bad12c..7e335f41379 100644
--- a/crates/assistant2/src/context.rs
+++ b/crates/assistant2/src/context.rs
@@ -73,5 +73,7 @@ pub fn attach_context_to_message(
context_text.push_str(&thread_context);
}
- message.content.push(MessageContent::Text(context_text));
+ if !context_text.is_empty() {
+ message.content.push(MessageContent::Text(context_text));
+ }
}