mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-29 06:32:52 +00:00
fix: background sub-agent report shows as a raw message after reloading the chat (#32804)
After reloading a chat while a background sub-agent was still working, its report came in as a plain user bubble with the whole raw report text instead of the "Background sub-agent finished" row, until the next reload. When the report arrives the page reloads the chat and receives the new turn live at the same moment, and the live copy, which lacks the message details, replaced the complete one from the server. The live copy is now laid over the server copy, so live changes still win and the report keeps what marks it as a sub-agent report. Fixes #32801
This commit is contained in:
parent
1b987c9a10
commit
9b4955c29b
1 changed files with 2 additions and 1 deletions
|
|
@ -2946,7 +2946,8 @@
|
|||
chatContent.history ??= convertMessagesToHistory(chatContent.messages);
|
||||
// Keep live updates received while the chat and tags were loading.
|
||||
for (const [id, message] of Object.entries(history.messages)) {
|
||||
if (initialHistory.messages[id] !== message) chatContent.history.messages[id] = message;
|
||||
if (initialHistory.messages[id] !== message)
|
||||
chatContent.history.messages[id] = { ...chatContent.history.messages[id], ...message };
|
||||
}
|
||||
if (history.currentId !== initialHistory.currentId) chat.current_message_id = history.currentId;
|
||||
history = chatContent.history;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue