From 81ba5ada2f8d36ca459018921a1b8a30207a2dfd Mon Sep 17 00:00:00 2001 From: Aleksander Grygier Date: Mon, 21 Sep 2026 16:28:43 +0200 Subject: [PATCH] ui : list the server tools at startup Assisted-by: pi:llama.cpp/DeepSeek-V4.1-Flash --- tools/ui/src/lib/stores/init.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/tools/ui/src/lib/stores/init.ts b/tools/ui/src/lib/stores/init.ts index 0f28f88480..a16bbc3102 100644 --- a/tools/ui/src/lib/stores/init.ts +++ b/tools/ui/src/lib/stores/init.ts @@ -9,7 +9,6 @@ import { tabsStore } from './tabs.svelte'; import { toolsStore } from './tools.svelte'; import { versionStore } from './version.svelte'; import { browser } from '$app/environment'; -import { LOCAL_BACKEND_ID } from '$lib/constants'; import { MigrationService } from '$lib/services/migration.service'; let startup: Promise | null = null; @@ -27,14 +26,13 @@ export function initStores(): Promise { // per-backend and never block startup void backendsModelsStore.loadAll(); - // the local server state is needed once its tab is opened; loading it here - // keeps the tab switch free of /props requests - if (backendsStore.local.enabled && backendsStore.active.id !== LOCAL_BACKEND_ID) { - void serverStore.prefetchLocalState(); - } - permissionsStore.initialize(); toolsStore.initialize(); + + // the local server state backs the installation facts and decides whether + // /tools exists at all, so probe it first and only then list the tools; + // otherwise they stay empty until the tools menu is opened + void serverStore.prefetchLocalState().then(() => toolsStore.fetchServerTools()); void versionStore.initialize(); // the full conversation list loads in the background; once it is back,