From 9b4955c29b8ee908069647cd3d5e5fc3f9d44910 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Wed, 21 Oct 2026 05:39:20 +0200 Subject: [PATCH] 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 --- src/lib/components/chat/Chat.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index bcc0f606db..942f500646 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -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;