From 301a69d4014cd4929cef7f3ebfcac05364c529cc Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Thu, 12 Nov 2026 14:14:29 +0100 Subject: [PATCH] fix: Fork in a side chat never opens the copy (#34187) In a side chat, the Fork chat button and /fork made the copy but the side chat stayed on the original conversation, while a fork in the main chat opens right away. The copy now opens in place of the side chat, with its whole conversation, and the sidebar lists it at once as it does for a fork from the main chat. Fixes #34182 --- src/lib/components/chat/Chat.svelte | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 7ced4b2c4f..cef3e3d586 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -3290,7 +3290,10 @@ sanitizeHistory(history); chatTitle.set(chatContent.title); - branchPointMessageId = parentChatId ? (chatContent.branchPointMessageId ?? null) : null; + branchPointMessageId = + chatContent.originalChatId === parentChatId + ? (chatContent.branchPointMessageId ?? null) + : null; if (side) await onEmbeddedChatTitle?.(id, chatContent.title); params = structuredClone(chatContent?.params ?? {}); @@ -4148,6 +4151,9 @@ if (!embedded) { await goto(`/c/${result.id}`); await refreshChatList(localStorage.token, { refreshPinned: true }); + } else if (side) { + await onSelectEmbeddedChat?.(result.id); + await refreshChatList(localStorage.token, { refreshPinned: true }); } toast.success($i18n.t('Chat forked'), { id: toastId }); } else {