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
This commit is contained in:
Classic298 2026-10-16 01:00:56 +02:00 • committed by GitHub
parent 0696bfdf27
commit ec39df7da5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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}