The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.
TypeScript agentai-chatai-studioall-in-onecoding-agentdesktop-appfluximage-generationlinuxllmlocal-ailocal-llmopen-sourceprivacyself-hostedstable-diffusionuncensoreduncensored-aivideo-generationwindows
fix(models): Pfadvergleich faltet Gross und Klein nur dort, wo das OS es tut
purple1c7bc1ca39a2
diff --git a/src/api/__tests__/custom-model-folder.test.ts b/src/api/__tests__/custom-model-folder.test.tsindex b46714bc..efd60862 100644--- a/src/api/__tests__/custom-model-folder.test.ts+++ b/src/api/__tests__/custom-model-folder.test.ts@@ -17,10 +17,14 @@import { describe, it, expect, beforeEach, vi } from 'vitest'const backendCall = vi.fn()+/** Which OS the app is running on. Windows is the platform of the issue this+ * file is about, so it is the default; the Linux case has its own test. */+let platform: 'windows' | 'macos' | 'linux' = 'windows'vi.mock('../backend', () => ({backendCall: (...args: unknown[]) => backendCall(...args),isTauri: () => true,- isMacOS: () => false,+ isMacOS: () => platform === 'macos',+ isWindows: () => platform === 'windows',}))import { customModelDirs, listBundledModels, bundledToAIModels, lastScanDirs, lastCustomScanDir } from '../engine'@@ -164,6 +168,60 @@ describe('the panel is told how the scan fared, not only what it found', () => {expect(lastCustomScanDir()?.status).toBe('unreachable')})+ // Review 2026-09-02: the case fold follows Rust, which folds on Windows and+ // macOS and not on Linux. `/mnt/Models` and `/mnt/models` are two folders on+ // ext4, and folding them would answer a question about one with the verdict+ // about the other.+ it('does not fold case on Linux, where two spellings are two folders', async () => {+ platform = 'linux'+ try {+ setFolder('/mnt/models')+ backendCall.mockResolvedValue({+ dir: '/app/models',+ dirs: [+ { path: '/app/models', status: 'ok' },+ { path: '/mnt/Models', status: 'unreachable' },+ ],+ models: [],+ })+ await listBundledModels()+ expect(lastCustomScanDir()).toBeNull()++ // The same spelling still matches, trailing separator and all.+ backendCall.mockResolvedValue({+ dir: '/app/models',+ dirs: [+ { path: '/app/models', status: 'ok' },+ { path: '/mnt/models/', status: 'truncated' },+ ],+ models: [],+ })+ await listBundledModels()+ expect(lastCustomScanDir()?.status).toBe('truncated')+ } finally {+ platform = 'windows'+ }+ })++ it('folds case on macOS, where one folder has many spellings', async () => {+ platform = 'macos'+ try {+ setFolder('/Users/me/Models')+ backendCall.mockResolvedValue({+ dir: '/app/models',+ dirs: [+ { path: '/app/models', status: 'ok' },+ { path: '/users/me/models', status: 'truncated' },+ ],+ models: [],+ })+ await listBundledModels()+ expect(lastCustomScanDir()?.status).toBe('truncated')+ } finally {+ platform = 'windows'+ }+ })+// Negative control: a verdict about SOME other folder is not a verdict about// this one, and silence beats a wrong accusation.it('reports nothing when the answer does not mention the folder at all', async () => {diff --git a/src/api/engine.ts b/src/api/engine.tsindex 28f6a3c8..e52e25c9 100644--- a/src/api/engine.ts+++ b/src/api/engine.ts@@ -11,7 +11,7 @@* `backendCall` maps camelCase args → snake_case Rust params (Tauri).*/-import { backendCall } from './backend'+import { backendCall, isMacOS, isWindows } from './backend'import { syncBuiltinEnginePort } from './builtin-ensure'import { trackEngineSwap } from './engine-swap-gate'import { prefixModelName } from './providers'@@ -276,19 +276,29 @@ export function lastScanDirs(): ScannedDir[] {/** Same folder, written two ways. Windows arrives with backslashes and any* case, and `C:\\` and `c:/` are one folder; the trailing separator is noise- * on every platform. Only ever used to find the row for a folder WE asked to- * be scanned, so folding case cannot pull in a stranger's folder. */+ * on every platform.+ *+ * The case fold follows Rust's `bundled_scan_dirs`, which folds on Windows+ * and macOS and NOT on Linux: `/mnt/Models` and `/mnt/models` really are two+ * folders on ext4, and folding them here would let this answer a question+ * about one folder with the verdict about the other. */function samePath(a: string, b: string): boolean {- const key = (p: string) => String(p ?? '').replace(/\\/g, '/').replace(/\/+$/, '').toLowerCase()+ const fold = isWindows() || isMacOS()+ const key = (p: string) => {+ const normalised = String(p ?? '').replace(/\\/g, '/').replace(/\/+$/, '')+ return fold ? normalised.toLowerCase() : normalised+ }return key(a) === key(b)}-/** The user's own folder from the last listing, or null when none was set (or- * when it was the app folder under another name, which Rust folds away).+/** The user's own folder from the last listing, or null when none was set or+ * when the answer says nothing about it.** Matched by path rather than by position: the app dir is row 0 today, but a* row read off an index is a row that silently reports the wrong folder the- * moment that stops being true. */+ * moment that stops being true. A folder that IS the app folder under another+ * spelling is folded away by Rust, so the match then lands on row 0, which is+ * the same folder and the right verdict for it. */export function lastCustomScanDir(): ScannedDir | null {const wanted = customModelDirs()[0]if (!wanted) return null