From 12212dc329b1483f7db28557de0bcb78f5e0769e Mon Sep 17 00:00:00 2001 From: 5brian Date: Wed, 9 Apr 2025 22:57:42 -0400 Subject: [PATCH] agent: Prevent sending whitespace only messages (#28409) Prevent this from happening when sending a prompt with only spaces and newlines: ![image](https://github.com/user-attachments/assets/b275f4c5-c013-4695-8fb4-e3ad75d41750) Release Notes: - agent: Prevent from sending messages containing only white space. --- crates/agent/src/message_editor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/agent/src/message_editor.rs b/crates/agent/src/message_editor.rs index 85cb62e24ab88824109b94471a774264e87e99d8..6daa5b6bbfecf4fe3d53701c9d29d026f3be0436 100644 --- a/crates/agent/src/message_editor.rs +++ b/crates/agent/src/message_editor.rs @@ -201,7 +201,7 @@ impl MessageEditor { } fn is_editor_empty(&self, cx: &App) -> bool { - self.editor.read(cx).text(cx).is_empty() + self.editor.read(cx).text(cx).trim().is_empty() } fn is_model_selected(&self, cx: &App) -> bool {