Commit b7cde589e for llama.cpp

commit b7cde589e471573a32d71924efe93e121d5a096e
Author: Aleksander Grygier <aleksander.grygier@gmail.com>
Date:   Thu Oct 29 09:14:53 2026 +0100

    ui: request persistent storage on startup (#31299)

    Ask the browser to keep IndexedDB and localStorage data under storage
    pressure, so conversations and settings are less likely to be evicted.

    Assisted-by: Claude (Opus 5.5 Medium)

diff --git a/tools/ui/src/lib/stores/init.ts b/tools/ui/src/lib/stores/init.ts
index ce2dcfbd0..4473349f9 100644
--- a/tools/ui/src/lib/stores/init.ts
+++ b/tools/ui/src/lib/stores/init.ts
@@ -11,12 +11,25 @@ import { validateApiKey } from '$lib/utils/api-key-validation';

 let startup: Promise<void> | null = null;

+/** Ask the browser not to evict conversations and settings under storage pressure, best effort. */
+async function requestPersistentStorage(): Promise<void> {
+	try {
+		if (!navigator.storage?.persist || (await navigator.storage.persisted())) return;
+
+		await navigator.storage.persist();
+	} catch {
+		// unsupported or denied, storage stays best-effort
+	}
+}
+
 export function initStores(): Promise<void> {
 	if (!browser) return Promise.resolve();

 	startup ??= (async () => {
 		await MigrationService.runAllMigrations();

+		void requestPersistentStorage();
+
 		settingsStore.initialize();
 		permissionsStore.initialize();
 		toolsStore.initialize();