From e58dacf0cb32a369d35fc0b1e6bba7f1f14cc7b3 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 17 Nov 2026 01:57:18 +0900 Subject: [PATCH] refac --- src/lib/components/chat/Chat.svelte | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 5532109e2c..d04570cd36 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -122,7 +122,12 @@ updateChatParams, updateChatFolderIdById } from '$lib/apis/chats'; - import { resolveTerminalTarget, setCwd, type FilesystemFile } from '$lib/apis/terminal'; + import { + listTerminalSkills, + resolveTerminalTarget, + setCwd, + type FilesystemFile + } from '$lib/apis/terminal'; import { generateOpenAIChatCompletion, getErrorMessage } from '$lib/apis/openai'; import { processUrl, processWebSearch } from '$lib/apis/retrieval'; import { @@ -1302,6 +1307,19 @@ } } + // Sent skill mentions and the + menu's Skills entry need the terminal's skills before any list opens. + $: { + const terminalId = $selectedTerminalId; + void listTerminalSkills( + resolveTerminalTarget(terminalId, $terminalServers ?? [], localStorage.token, { + chatId: $chatId || null, + modelId: selectedModels[0] ?? null + }) + ).then((items) => { + if (terminalId === $selectedTerminalId) terminalSkills.set(items); + }); + } + const applyFolderTerminal = (folder: any) => { const terminalId = folder?.data?.terminal_id; if (!terminalId) return;