diff --git a/ui/suite/chat/chat.html b/ui/suite/chat/chat.html
index 0986036..8cd0d1b 100644
--- a/ui/suite/chat/chat.html
+++ b/ui/suite/chat/chat.html
@@ -1048,20 +1048,29 @@ function finalizeStreaming() {
});
}
- function sendMessage(messageContent) {
- var input = document.getElementById("messageInput");
- if (!input) {
- console.error("Chat input not found");
- return;
- }
+function sendMessage(messageContent) {
+ var input = document.getElementById("messageInput");
+ if (!input) {
+ console.error("Chat input not found");
+ return;
+ }
- // If no messageContent provided, read from input
- var content = messageContent || input.value.trim();
- if (!content) {
- return;
- }
+ // If no messageContent provided, read from input
+ var content = messageContent || input.value.trim();
+ if (!content) {
+ return;
+ }
- // Inject active switchers into content
+ // Reset streaming state for new user message
+ // This ensures bot responses create new message elements
+ if (isStreaming) {
+ finalizeStreaming();
+ }
+ isStreaming = false;
+ streamingMessageId = null;
+ currentStreamingContent = "";
+
+ // Inject active switchers into content
var activeKeys = Object.keys(activeSwitchers).filter(function(k) { return activeSwitchers[k]; });
var enhancedContent = content;