From ec39df7da56f6947fde17a9be2c146251f891b26 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Fri, 16 Oct 2026 01:00:56 +0200 Subject: [PATCH] fix: inline HTML preview in a reply shows "File not found" on a Per chat terminal (#32485) With an Open Terminal orchestrator connection set to Terminal Contexts > Chat = "Per chat" (Admin > Integrations > Open Terminal), the preview of an HTML file shown inside an assistant reply looked for the file in the shared terminal workspace, so it showed "File not found" even though the file sits in the chat's own workspace. The sidebar file browser already opens the same file correctly since #32418. The preview inside the reply now uses the chat's own workspace as well. Fixes #32477 --- .../components/chat/Messages/TerminalOutputFile.svelte | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/Messages/TerminalOutputFile.svelte b/src/lib/components/chat/Messages/TerminalOutputFile.svelte index 633f669e31..c78b351b81 100644 --- a/src/lib/components/chat/Messages/TerminalOutputFile.svelte +++ b/src/lib/components/chat/Messages/TerminalOutputFile.svelte @@ -58,6 +58,13 @@ $: terminal = resolveTerminal(); $: unavailable = !terminal; $: previewKey = terminal ? `${terminal.url}|${terminal.key}|${path}|${chatId}` : ''; + $: isPerChatTerminal = + ($terminalServers ?? []).find((server: any) => server.id === selector)?.contexts?.chat + ?.context_id === 'chat_id'; + $: previewBaseUrl = + terminal && isPerChatTerminal && chatId + ? `${terminal.url}/chats/${encodeURIComponent(chatId)}` + : (terminal?.url ?? ''); $: previewClass = isImage(path) ? 'h-[22rem]' : isPdf(path) || @@ -299,7 +306,7 @@ {fileSqliteData} {fileDocxData} {fileContent} - baseUrl={terminal?.url ?? ''} + baseUrl={previewBaseUrl} apiKey={terminal?.key ?? ''} {fileOfficeHtml} {fileOfficeSlides}