fix: ensure each bot response creates a new message element
All checks were successful
BotUI CI/CD / build (push) Successful in 42s

This commit is contained in:
Rodrigo Rodriguez (Pragmatismo) 2026-04-14 20:14:52 -03:00
parent 3049476d8f
commit cf7462f1cb

View file

@ -817,6 +817,15 @@ function finalizeStreaming() {
}
function processMessage(data) {
// Ensure each bot response creates a new message element
// If we're still streaming from a previous response, finalize it first
if (isStreaming && streamingMessageId) {
finalizeStreaming();
isStreaming = false;
streamingMessageId = null;
currentStreamingContent = "";
}
// Strip any remaining GPT-oSS thinking content from display
// These should have been filtered by botserver, but remove any that slip through
if (data.content && typeof data.content === "string") {
@ -830,7 +839,7 @@ function processMessage(data) {
data.content = content;
}
if (data.is_complete) {
if (data.is_complete) {
if (isStreaming) {
finalizeStreaming();
} else {