Skip to content

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.

fix(engine): keine Reste des alten Namens mehr im sichtbaren Text

purplefb0707077170
diff --git a/src-tauri/src/commands/engine.rs b/src-tauri/src/commands/engine.rs
index 53247d27..d50a9aa8 100644
--- a/src-tauri/src/commands/engine.rs
+++ b/src-tauri/src/commands/engine.rs
@@ -1274,7 +1274,7 @@ fn start_bundled_engine_blocking(
}
};
if port != preferred_port {
- println!("[Engine] port {preferred_port} is taken, the built-in engine moves to {port}");
+ println!("[Engine] port {preferred_port} is taken, the LU Engine moves to {port}");
}
let desired_args =
build_server_args(&model_path, &tuning, port, slot_dir.as_deref(), mmproj.as_deref());
@@ -1284,7 +1284,7 @@ fn start_bundled_engine_blocking(
let first = spawn_engine_attempt(state, &binary, &desired_args, &model_path, port, ctx);
let failure = match first {
Ok(()) => {
- println!("[Engine] Built-in engine healthy on port {port}");
+ println!("[Engine] LU Engine healthy on port {port}");
return Ok(serde_json::json!({
"status": "started",
"port": port,
@@ -1331,7 +1331,7 @@ fn start_bundled_engine_blocking(
};
match spawn_engine_attempt(state, &binary, &retry_args, &model_path, retry_port, ctx) {
Ok(()) => {
- println!("[Engine] Built-in engine healthy on port {retry_port} (second attempt)");
+ println!("[Engine] LU Engine healthy on port {retry_port} (second attempt)");
Ok(serde_json::json!({
"status": "started",
"port": retry_port,
@@ -2029,7 +2029,7 @@ pub(crate) fn stop_engine_locked(state: &AppState) -> bool {
if let Some(mut engine) = guard.take() {
let _ = engine.child.kill();
let _ = engine.child.wait();
- println!("[Engine] Built-in engine stopped (port {})", engine.port);
+ println!("[Engine] LU Engine stopped (port {})", engine.port);
true
} else {
false
@@ -2106,7 +2106,7 @@ fn start_bundled_embed_blocking(
)
})?;
- println!("[Engine] Starting built-in embeddings server on port {port}, model {model_path}");
+ println!("[Engine] Starting the LU Engine embeddings server on port {port}, model {model_path}");
let mut cmd = Command::new(&binary);
cmd.args(build_embed_args(&model_path, port))
.stdin(Stdio::null())
diff --git a/src-tauri/src/state.rs b/src-tauri/src/state.rs
index 7247ed57..17bc5066 100644
--- a/src-tauri/src/state.rs
+++ b/src-tauri/src/state.rs
@@ -501,7 +501,7 @@ impl AppState {
if let Ok(mut engine) = self.bundled_engine.lock() {
if let Some(ref mut e) = *engine {
let _ = e.child.kill();
- println!("[Engine] Built-in engine stopped (explicit shutdown)");
+ println!("[Engine] LU Engine stopped (explicit shutdown)");
}
*engine = None;
}
@@ -510,7 +510,7 @@ impl AppState {
if let Ok(mut embed) = self.bundled_embed.lock() {
if let Some(ref mut e) = *embed {
let _ = e.child.kill();
- println!("[Engine] Built-in embeddings server stopped (explicit shutdown)");
+ println!("[Engine] LU Engine embeddings server stopped (explicit shutdown)");
}
*embed = None;
}
diff --git a/src/api/rag.ts b/src/api/rag.ts
index 914dde87..89d3e45d 100644
--- a/src/api/rag.ts
+++ b/src/api/rag.ts
@@ -141,7 +141,7 @@ async function embedViaBuiltin(texts: string[], model: string): Promise<number[]
})
} catch (err) {
throw new Error(
- `Cannot reach the built-in embeddings server. (${err instanceof Error ? err.message : String(err)})`
+ `Cannot reach the LU Engine embeddings server. (${err instanceof Error ? err.message : String(err)})`
)
}
@@ -152,7 +152,7 @@ async function embedViaBuiltin(texts: string[], model: string): Promise<number[]
detail = body?.error?.message || body?.error || ""
} catch { /* ignore parse errors */ }
throw new Error(
- `Embedding failed (HTTP ${res.status}): ${detail || "the built-in embeddings server may still be loading"}`
+ `Embedding failed (HTTP ${res.status}): ${detail || "the LU Engine embeddings server may still be loading"}`
)
}
diff --git a/src/components/models/DiscoverModels.tsx b/src/components/models/DiscoverModels.tsx
index f0b32019..a44916fe 100644
--- a/src/components/models/DiscoverModels.tsx
+++ b/src/components/models/DiscoverModels.tsx
@@ -259,7 +259,7 @@ export function DiscoverModels({ category, search = '', searchSubmitToken = 0 }:
}
setActiveModel(name)
} catch (e) {
- log.warn('[DiscoverModels] built-in engine repair failed', { err: e })
+ log.warn('[DiscoverModels] LU Engine repair failed', { err: e })
setActiveModel(name)
} finally {
setUsingModel(null)
diff --git a/src/hooks/useModels.ts b/src/hooks/useModels.ts
index 8043779a..52a937ab 100644
--- a/src/hooks/useModels.ts
+++ b/src/hooks/useModels.ts
@@ -79,9 +79,9 @@ async function resumeBuiltinEngines(bundled: BundledModel[]) {
worthRetrying: engineStartIsWorthRetrying,
sleep: wait,
onError: (attempt, err) =>
- log.warn('[useModels] built-in engine resume failed', { attempt, err }),
+ log.warn('[useModels] LU Engine resume failed', { attempt, err }),
})
- log.info('[useModels] built-in engine resume', outcome)
+ log.info('[useModels] LU Engine resume', outcome)
await embedResumed
}
diff --git a/src/lib/__tests__/no-built-in-engine-left-on-screen.test.ts b/src/lib/__tests__/no-built-in-engine-left-on-screen.test.ts
new file mode 100644
index 00000000..a04e8768
--- /dev/null
+++ b/src/lib/__tests__/no-built-in-engine-left-on-screen.test.ts
@@ -0,0 +1,105 @@
+/**
+ * A16 (A14-1a), Windows counter-check 02.09.: the rename to "LU Engine" held
+ * everywhere the counter-check looked in 2.6.8, with one leftover it could
+ * name: "Cannot reach the built-in embeddings server." That sentence is about
+ * the embeddings sidecar rather than the chat engine, so it slipped past the
+ * checklist, and standing next to "LU Engine" everywhere else it simply reads
+ * as a second product.
+ *
+ * This is the sweep that keeps the next one from slipping through. It reads
+ * every source file the app ships, throws the comments away, and fails on any
+ * remaining "built-in engine" / "built-in embeddings" in text that can reach a
+ * user, a log line included.
+ *
+ * Deliberately NOT covered:
+ * - `release-notes.ts`. Notes for 2.6.7 and older describe the app as it was
+ * called then, and rewriting history there would make the notes lie.
+ * - `lib/engine-name.ts`. It holds the old display name on purpose:
+ * `LEGACY_ENGINE_NAME` is what sits in provider configs written before
+ * 2.6.8, and `isLuEngineName` has to keep recognising it.
+ * - Code identifiers (`isBuiltinEngineEntry`, `builtin_*`, `activateBuiltinModel`).
+ * They are not text on a screen and renaming them would be a large diff
+ * with no reader.
+ *
+ * Limit worth knowing: the comment stripper is a regular expression, not a
+ * parser. It can swallow the tail of a string containing `//`, so the sweep can
+ * miss a hit hidden behind a URL inside a literal. It cannot invent one.
+ *
+ * Run: npx vitest run src/lib/__tests__/no-built-in-engine-left-on-screen.test.ts
+ */
+import { describe, it, expect } from 'vitest'
+import { readFileSync, readdirSync, statSync } from 'node:fs'
+import { resolve, dirname, join, relative } from 'node:path'
+import { fileURLToPath } from 'node:url'
+
+const SRC = resolve(dirname(fileURLToPath(import.meta.url)), '../..')
+
+/** The old name, in every spelling that ever shipped. */
+const OLD_NAME = /built[-\s]?in\s+(engine|embedding)/i
+
+const EXEMPT = [
+ 'lib/release-notes.ts',
+ 'lib/engine-name.ts',
+]
+
+function sourceFiles(dir: string): string[] {
+ const out: string[] = []
+ for (const entry of readdirSync(dir)) {
+ const full = join(dir, entry)
+ if (statSync(full).isDirectory()) {
+ if (entry === '__tests__' || entry === 'node_modules') continue
+ out.push(...sourceFiles(full))
+ } else if (/\.(ts|tsx)$/.test(entry) && !/\.test\.tsx?$/.test(entry)) {
+ out.push(full)
+ }
+ }
+ return out
+}
+
+/** Everything that is not a comment. See the limit noted at the top. */
+function withoutComments(src: string): string[] {
+ return src
+ .replace(/\/\*[\s\S]*?\*\//g, '')
+ .split('\n')
+ .map((line) => line.replace(/(^|[^:"'`\\])\/\/.*$/, '$1'))
+}
+
+describe('the old engine name is gone from everything a user can read', () => {
+ it('leaves no "built-in engine" or "built-in embeddings" in src/', () => {
+ const left: string[] = []
+ for (const file of sourceFiles(SRC)) {
+ const rel = relative(SRC, file).replace(/\\/g, '/')
+ if (EXEMPT.some((e) => rel.endsWith(e))) continue
+ withoutComments(readFileSync(file, 'utf8')).forEach((line, i) => {
+ if (OLD_NAME.test(line)) left.push(`src/${rel}:${i + 1}: ${line.trim()}`)
+ })
+ }
+ expect(left, `the old name is still on screen:\n${left.join('\n')}`).toEqual([])
+ })
+
+ // NEGATIVE CONTROL: the sweep has to be able to see the thing it is looking
+ // for. Without this a broken matcher would report a clean house forever.
+ it('really does recognise the old name', () => {
+ const seen = [
+ 'Cannot reach the built-in embeddings server.',
+ 'the Built-in Engine loads it',
+ 'moved to the built in engine',
+ "log.warn('[x] built-in engine resume failed')",
+ ].filter((s) => OLD_NAME.test(s))
+ expect(seen).toHaveLength(4)
+ // And it is not simply matching everything: ComfyUI's own built-in nodes
+ // and LU's built-in workflows are other things with the same adjective.
+ expect(OLD_NAME.test("ComfyUI's built-in inpaint nodes")).toBe(false)
+ expect(OLD_NAME.test('Use the built-in workflow')).toBe(false)
+ })
+
+ // NEGATIVE CONTROL: the exemptions are exemptions, not a hole big enough to
+ // hide the whole app in. Both named files must still contain what they are
+ // exempt for, or the exemption is stale and should go.
+ it('keeps the two exemptions honest', () => {
+ const legacy = readFileSync(join(SRC, 'lib/engine-name.ts'), 'utf8')
+ expect(legacy, 'engine-name.ts no longer needs its exemption').toMatch(OLD_NAME)
+ const notes = readFileSync(join(SRC, 'lib/release-notes.ts'), 'utf8')
+ expect(notes, 'release-notes.ts no longer needs its exemption').toMatch(OLD_NAME)
+ })
+})
diff --git a/src/stores/modelStore.ts b/src/stores/modelStore.ts
index 83d1ba31..aa94cf56 100644
--- a/src/stores/modelStore.ts
+++ b/src/stores/modelStore.ts
@@ -160,7 +160,7 @@ export const useModelStore = create<ModelState>()(
!!nextModel && 'providerName' in nextModel && isLuEngineName(nextModel.providerName)
if (!nextIsBuiltin) {
backendCall('stop_bundled_engine').catch((e) =>
- log.warn('[modelStore] failed to stop built-in engine on switch-away', { err: e }),
+ log.warn('[modelStore] failed to stop the LU Engine on switch-away', { err: e }),
)
} else if (name) {
// built-in → DIFFERENT built-in: llama-server serves exactly ONE
@@ -173,7 +173,7 @@ export const useModelStore = create<ModelState>()(
// selection, name = null, has nothing to swap to; nextIsBuiltin
// is false then anyway, this branch just spells it out for tsc.)
activateBuiltinModel(name).catch((e) =>
- log.warn('[modelStore] failed to swap built-in engine to the picked model', { model: name, err: e }),
+ log.warn('[modelStore] failed to swap the LU Engine to the picked model', { model: name, err: e }),
)
}
} else if (!prev.includes('::')) {