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(engine): der Rat nennt den Reiter, den es wirklich gibt
purple051e02ae69ae
diff --git a/src-tauri/src/commands/engine.rs b/src-tauri/src/commands/engine.rsindex b094fbee..27403ce7 100644--- a/src-tauri/src/commands/engine.rs+++ b/src-tauri/src/commands/engine.rs@@ -1143,13 +1143,13 @@ fn gguf_header_reason(path: &Path) -> Option<String> {datei.read_exact(&mut kopf).ok()?;if &kopf[..4] != GGUF_MAGIC {return Some(format!(- "\"{name}\" does not start with the GGUF marker, so it is not a model file. Open Models, Discover and download it again."+ "\"{name}\" does not start with the GGUF marker, so it is not a model file. Open Models, Get new and download it again."));}let version = u32::from_le_bytes([kopf[4], kopf[5], kopf[6], kopf[7]]);if version == 0 || version > GGUF_VERSION_UNSINN {return Some(format!(- "\"{name}\" carries a GGUF version of {version}, which is not a version at all. The file is damaged, most likely a download that did not finish. Open Models, Discover and download it again."+ "\"{name}\" carries a GGUF version of {version}, which is not a version at all. The file is damaged, most likely a download that did not finish. Open Models, Get new and download it again."));}None@@ -1206,7 +1206,7 @@ pub(crate) fn start_failure_message(failure: &StartFailure, port: u16, budget: Dlet hint = if let Some(lib) = stderr_names_a_missing_system_library(&failure.stderr) {missing_library_hint(&lib, cfg!(target_os = "linux"))} else if stderr_blames_the_model(&failure.stderr) {- " The engine refused the model file. Open Models, Discover and install a different quant.".to_string()+ " The engine could not read the model file. It may be damaged, cut short, or of a type this engine cannot run. Open Models, Get new and download it again, or pick another model.".to_string()} else {" Reinstall Locally Uncensored if this keeps happening, or pick a different backend in Settings, AI Backends.".to_string()};@@ -3413,7 +3413,7 @@ mod tests {"the note sits behind the engine log again:\n{msg}");// Und der Satz mit dem Handlungsvorschlag bleibt ganz oben.- assert!(msg.find("refused the model file").unwrap() < notiz, "{msg}");+ assert!(msg.find("could not read the model file").unwrap() < notiz, "{msg}");}#[test]@@ -3889,7 +3889,7 @@ mod tests {stderr: "llama_model_load: error loading model: unknown model architecture 'wanx'".into(),};let msg = start_failure_message(&f, 8127, Duration::from_secs(60));- assert!(msg.contains("refused the model file"), "{msg}");+ assert!(msg.contains("could not read the model file"), "{msg}");assert!(!msg.contains("GPU Layers"), "{msg}");}@@ -3918,7 +3918,7 @@ srv llama_server: exiting due to model loading error";stderr: KAPUTTE_GGUF_STDERR.into(),};let msg = start_failure_message(&f, 8127, Duration::from_secs(60));- assert!(msg.contains("refused the model file"), "{msg}");+ assert!(msg.contains("could not read the model file"), "{msg}");assert!(!msg.contains("GPU Layers"), "{msg}");assert!(!msg.contains("graphics-card"), "{msg}");// The engine's own last words still travel, for a bug report.@@ -4039,7 +4039,7 @@ srv llama_server: exiting due to model loading error";stderr: KAPUTTE_VERSION_STDERR.into(),};let msg = start_failure_message(&f, 8127, Duration::from_secs(60));- assert!(msg.contains("refused the model file"), "{msg}");+ assert!(msg.contains("could not read the model file"), "{msg}");assert!(!msg.contains("GPU Layers"), "{msg}");assert!(!msg.contains("graphics-card"), "{msg}");}@@ -4057,7 +4057,7 @@ srv llama_server: exiting due to model loading error";};let msg = start_failure_message(&f, 8127, Duration::from_secs(60));assert!(msg.contains("GPU Layers"), "{msg}");- assert!(!msg.contains("refused the model file"), "{msg}");+ assert!(!msg.contains("could not read the model file"), "{msg}");}#[test]diff --git a/src/api/__tests__/builtin-engine-diagnose.test.ts b/src/api/__tests__/builtin-engine-diagnose.test.tsindex 17cbbdae..e9e32544 100644--- a/src/api/__tests__/builtin-engine-diagnose.test.ts+++ b/src/api/__tests__/builtin-engine-diagnose.test.ts@@ -89,7 +89,7 @@ describe('diagnoseBuiltinEngine', () => {const d = await diagnoseBuiltinEngine({ repair: true })expect(d.ok).toBe(false)expect(d.reason).toMatch(/no chat model to load yet/i)- expect(d.reason).toMatch(/Models, Discover/i)+ expect(d.reason).toMatch(/Models, Get new/i)})it('does not count an embedding GGUF as a chat model', async () => {diff --git a/src/api/builtin-ensure.ts b/src/api/builtin-ensure.tsindex e5b58f0a..c18182b5 100644--- a/src/api/builtin-ensure.ts+++ b/src/api/builtin-ensure.ts@@ -243,7 +243,7 @@ async function loadBuiltinModel(modelName: string): Promise<void> {// on Windows 10 — they gave up on the built-in engine and moved to// Ollama). Say what is actually wrong instead.throw new Error(- `The LU Engine has no model file named "${bare}". It may have been deleted, moved, or the download did not finish. Open Models, install it again, then pick it in the chat.`,+ `The LU Engine has no model file named "${bare}". It may have been deleted, moved, or the download did not finish. Open Models, Get new and download it again, then pick it in the chat.`,)}@@ -457,7 +457,7 @@ export async function diagnoseBuiltinEngine(ok: false,repaired: false,reason:- 'The LU Engine is installed but has no chat model to load yet. Open Models, Discover and install one, then test again.',+ 'The LU Engine is installed but has no chat model to load yet. Open Models, Get new and install one, then test again.',}}@@ -483,7 +483,7 @@ export async function diagnoseBuiltinEngine(return {ok: false,repaired: false,- reason: `The LU Engine has no model file named "${bare}". It may have been deleted, moved, or the download did not finish. Open Models and install it again.`,+ reason: `The LU Engine has no model file named "${bare}". It may have been deleted, moved, or the download did not finish. Open Models, Get new and download it again.`,}}try {diff --git a/src/components/models/ModelManager.tsx b/src/components/models/ModelManager.tsxindex e7177e5d..155c7a71 100644--- a/src/components/models/ModelManager.tsx+++ b/src/components/models/ModelManager.tsx@@ -249,7 +249,7 @@ export function ModelManager() {</button><h1 className="text-[0.85rem] font-semibold text-gray-900 dark:text-white">Models</h1>- {/* Discover / Installed segment — the MLX panel is one list with+ {/* Get new / Installed segment. The MLX panel is one list withper-model Install/Remove, so the split would switch nothing. */}<div className={`ml-2 flex items-center p-0.5 rounded-lg bg-gray-100 dark:bg-white/[0.04] border border-gray-200 dark:border-white/[0.06] ${showMlxPanel ? 'hidden' : ''}`}><button@@ -391,7 +391,7 @@ export function ModelManager() {onClick={() => setTab('discover')}className="flex items-center gap-1.5 mt-1 px-3 py-1.5 rounded-md bg-gray-900 dark:bg-white/10 hover:bg-gray-800 dark:hover:bg-white/15 text-white t-micro font-medium transition-colors">- <Sparkles size={11} /> Discover models+ <Sparkles size={11} /> Get new models</button></div>) : filteredModels.length === 0 ? (diff --git a/src/lib/__tests__/der-rat-nennt-nur-echte-knoepfe.test.ts b/src/lib/__tests__/der-rat-nennt-nur-echte-knoepfe.test.tsnew file mode 100644index 00000000..a965ada5--- /dev/null+++ b/src/lib/__tests__/der-rat-nennt-nur-echte-knoepfe.test.ts@@ -0,0 +1,91 @@+/**+ * Ein Rat in einer Fehlermeldung darf nur Knoepfe nennen, die es gibt.+ *+ * Gegenprobe G1, 04.09.2026: nach dem Klick auf eine kaputte GGUF-Datei stand+ * in der Meldung "Open Models, Discover and install a different quant." Der+ * Testkunde hat alle fuenf Hauptseiten nach dem Wort "Discover" durchsucht und+ * null Treffer gehabt. Die Reiter auf der Models-Seite heissen "Get new" und+ * "Installed". Der Rat schickte den Kunden ausserdem zu einem ANDEREN Quant,+ * obwohl die Datei nur unvollstaendig heruntergeladen war und dieselbe Datei+ * noch einmal zu laden der richtige Weg ist.+ *+ * Der Test liest die Reiterbeschriftungen aus der Models-Seite und haelt jeden+ * "Open Models, X"-Rat in der Anwendung dagegen.+ *+ * Run: npx vitest run src/lib/__tests__/der-rat-nennt-nur-echte-knoepfe.test.ts+ */+import { describe, it, expect } from 'vitest'+import { readdirSync, readFileSync, statSync } from 'node:fs'+import { resolve, join } from 'node:path'++const src = resolve(__dirname, '..', '..')+const rust = resolve(__dirname, '..', '..', '..', 'src-tauri', 'src')++/** Die Beschriftungen der Reiterleiste, so wie ein Mensch sie liest. */+function reiterBeschriftungen(): string[] {+ const datei = readFileSync(join(src, 'components', 'models', 'ModelManager.tsx'), 'utf8')+ const anfang = datei.indexOf('{/* Get new / Installed segment')+ const ende = datei.indexOf('<div className="flex-1" />', anfang)+ expect(anfang).toBeGreaterThan(0)+ expect(ende).toBeGreaterThan(anfang)+ const leiste = datei.slice(anfang, ende)+ const namen = [...leiste.matchAll(/\/>\s*([A-Za-z][A-Za-z ]*?)\s*$/gm)].map((m) => m[1].trim())+ expect(namen.length).toBeGreaterThan(1)+ return namen+}++function dateien(dir: string, endung: RegExp): string[] {+ const out: string[] = []+ for (const e of readdirSync(dir)) {+ const p = join(dir, e)+ if (statSync(p).isDirectory()) {+ if (e === '__tests__' || e === 'node_modules' || e === 'target') continue+ out.push(...dateien(p, endung))+ } else if (endung.test(e)) out.push(p)+ }+ return out+}++describe('der Rat in Fehlermeldungen', () => {+ const reiter = reiterBeschriftungen()++ it('die Models-Seite hat wirklich einen Reiter "Get new"', () => {+ expect(reiter).toContain('Get new')+ expect(reiter).toContain('Installed')+ })++ it('jeder "Open Models, X"-Rat nennt einen Reiter, den es gibt', () => {+ const suender: string[] = []+ for (const f of [...dateien(src, /\.tsx?$/), ...dateien(rust, /\.rs$/)]) {+ const text = readFileSync(f, 'utf8')+ for (const [i, zeile] of text.split('\n').entries()) {+ for (const treffer of zeile.matchAll(/Open Models,\s+([A-Z][A-Za-z ]*?)\s+and\b/g)) {+ if (!reiter.includes(treffer[1])) {+ suender.push(`${f}:${i + 1} nennt "${treffer[1]}"`)+ }+ }+ }+ }+ expect(suender).toEqual([])+ })++ // Negativkontrolle: genau dieser Satz stand in der Anwendung, und genau+ // dieser Satz muss den Test rot machen.+ it('der alte Satz waere aufgefallen', () => {+ const alt = 'Open Models, Discover and install a different quant.'+ const treffer = [...alt.matchAll(/Open Models,\s+([A-Z][A-Za-z ]*?)\s+and\b/g)]+ expect(treffer).toHaveLength(1)+ expect(reiter).not.toContain(treffer[0][1])+ })++ it('kein Rat schickt den Kunden zu einem anderen Quant', () => {+ const suender: string[] = []+ for (const f of [...dateien(src, /\.tsx?$/), ...dateien(rust, /\.rs$/)]) {+ const text = readFileSync(f, 'utf8')+ for (const [i, zeile] of text.split('\n').entries()) {+ if (/install a different quant/.test(zeile)) suender.push(`${f}:${i + 1}`)+ }+ }+ expect(suender).toEqual([])+ })+})