diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 8652df4630..f83996d776 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -3138,7 +3138,10 @@ filter_ids: selectedFilterIds.length > 0 ? selectedFilterIds : undefined, tool_ids: toolIds.length > 0 ? toolIds : undefined, skill_ids: skillIds.length > 0 ? skillIds : undefined, - terminal_id: terminalEnabled ? (activeTerminalId ?? undefined) : undefined, + terminal_id: + terminalEnabled && ($terminalServers ?? []).some((t) => t.id && t.id === activeTerminalId) + ? activeTerminalId + : undefined, tool_servers: [ ...($toolServers ?? []).filter( (server, idx) => toolServerIds.includes(idx) || toolServerIds.includes(server?.id)