fix: ensure each bot response creates a new message element
All checks were successful
BotUI CI/CD / build (push) Successful in 42s
All checks were successful
BotUI CI/CD / build (push) Successful in 42s
This commit is contained in:
parent
3049476d8f
commit
cf7462f1cb
1 changed files with 10 additions and 1 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue