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(sweep): Gedankenstrich-Pruefung auf 0 gebracht
purplebe3c3c13bfe5
diff --git a/src/api/agents/__tests__/stop-really-stops-background-work.test.ts b/src/api/agents/__tests__/stop-really-stops-background-work.test.tsindex a1d58703..a7924f6d 100644--- a/src/api/agents/__tests__/stop-really-stops-background-work.test.ts+++ b/src/api/agents/__tests__/stop-really-stops-background-work.test.ts@@ -3,7 +3,7 @@* fehlte.** Was vorher stand (`run-stop.test.ts`, `sub-agent.test.ts`) war ein- * Quelltext-Grep und eine Aufrufform-Pruefung — beides wird gruen, wenn+ * Quelltext-Grep und eine Aufrufform-Pruefung, beides wird gruen, wenn* `cancelAll` zu einem No-op gemacht wird, solange die Zeile im Quelltext* stehenbleibt. Dieser Test laesst stattdessen einen ECHTEN Unteragentenlauf* gegen einen gemockten Anbieter mit Schleife laufen (`defaultSubAgentRunner`,@@ -17,7 +17,7 @@** Negativkontrolle (siehe Commit-Text): die Wettlauf-Sperre in* `buildDelegateExecutor` (isRunStopped-Pruefung direkt nach `start(...)`)- * kurz zurueckgenommen — dieser Test bleibt gruen (die Aufgabe stand zum+ * kurz zurueckgenommen, dieser Test bleibt gruen (die Aufgabe stand zum* Stop-Zeitpunkt schon im Store), aber ein eigener Test unten deckt genau die* Luecke ab; das `gates.abortSignal`-Threading aus `chatWithTools`* zurueckgenommen (den `{ signal: ... }`-Parameter entfernt) macht@@ -89,10 +89,10 @@ async function warteBis(pruefung: () => boolean, was: string): Promise<void> {/*** Ein Anbieter mit einer echten Schleife: jede Antwort traegt einen- * Werkzeugaufruf, also bricht `defaultSubAgentRunner` nie von selbst ab —+ * Werkzeugaufruf, also bricht `defaultSubAgentRunner` nie von selbst ab,* nur der Stop kann diese Schleife beenden. Ab dem zweiten Aufruf loest die* Implementierung selbst denselben Griff aus, den der Stop-Knopf benutzt,- * MITTEN in der laufenden Anfrage — genau der Moment, den T4 gemessen hat+ * MITTEN in der laufenden Anfrage, genau der Moment, den T4 gemessen hat* (ein Aufruf, der schon unterwegs war, als Stop gedrueckt wurde).*/function baueSchleifendenAnbieter() {@@ -102,7 +102,7 @@ function baueSchleifendenAnbieter() {calls++if (opts?.signal) gesehenesSignal.push(opts.signal)if (calls === 2) {- // Stop, mitten in dieser (der zweiten) Anfrage — derselbe Griff, den+ // Stop, mitten in dieser (der zweiten) Anfrage, derselbe Griff, den// stopAgent/stopCodex seit der B1-Nachbesserung benutzen.useAgentTaskStore.getState().cancelAll(CONV)stopRun(CONV)@@ -140,12 +140,12 @@ describe('Stop mitten in einer laufenden Hintergrundanfrage beendet den Lauf wir)const standNachAbbruch = callCount()- // Eine grosszuegige Wartezeit — waere die Sperre am Schleifenkopf+ // Eine grosszuegige Wartezeit, waere die Sperre am Schleifenkopf// (`gates.abortSignal?.aborted`) nicht da, liefe die Schleife bis zum// Budget weiter und `callCount()` waechse.await new Promise((r) => setTimeout(r, 50))expect(callCount()).toBe(standNachAbbruch)- // Und nicht einfach "irgendwann aufgehoert" — genau zwei: die erste+ // Und nicht einfach "irgendwann aufgehoert", genau zwei: die erste// Anfrage plus die, die schon unterwegs war, als Stop gedrueckt wurde.expect(standNachAbbruch).toBe(2)})@@ -193,7 +193,7 @@ describe('Wettlauf: Stop im Startfenster (Opus-Review, Nachbesserung 2)', () =>* Der von Opus gefundene zweite Fall: der Nutzer druecke Stop nicht waehrend* eine Anfrage laeuft, sondern GENAU in dem Fenster, in dem die Aufgabe noch* gar nicht im Store steht (zwischen `_inFlight++` und `start(...)` liegen- * zwei `await`s). Das laesst sich von aussen nicht zeitlich treffen — aber+ * zwei `await`s). Das laesst sich von aussen nicht zeitlich treffen, aber* die Sperre selbst deckt einen strengeren Fall ab: schon VOR dem ersten* `runner()`-Aufruf steht der Stop-Merker. `buildDelegateExecutor` prueft* `isRunStopped(convId)` direkt nach `start(...)`, also muss der Anbieter indiff --git a/src/api/agents/sub-agent.ts b/src/api/agents/sub-agent.tsindex 51547171..07a45eb9 100644--- a/src/api/agents/sub-agent.ts+++ b/src/api/agents/sub-agent.ts@@ -1,12 +1,12 @@/**- * Phase 13 (v2.4.0) — Sub-agent delegation.+ * Phase 13 (v2.4.0), Sub-agent delegation.** Exposes a `delegate_task` builtin tool that spawns a nested ReAct loop* with a sub-goal, its own isolated AgentBudget, and the same tool* registry minus `delegate_task` itself (so a sub-agent cannot fork-bomb* a tree of delegations).*- * Depth is capped at 2 globally — a sub-agent that attempts to call+ * Depth is capped at 2 globally, a sub-agent that attempts to call* delegate_task returns a refusal string. Combined with the tool-list* filtering, the model has no syntactically valid path to recurse.*/@@ -15,7 +15,7 @@ import { settleThinking } from '../../lib/thinking-stripper'import { toolResultIsFailure } from '../../lib/tool-result-failure'import { isRunStopped } from '../../lib/run-stop'// M7 / Audit W-T2: hier stand zweimal `await import('../mcp')`. Gesplittet hat-// das nie — die Tonne mcp/index.ts hängt über useAgentChat, useCodex und+// das nie, die Tonne mcp/index.ts hängt über useAgentChat, useCodex und// api/tool-registry.ts ohnehin statisch im Graph, also meldete Rolldown// INEFFECTIVE_DYNAMIC_IMPORT. Der import() war auch nie fürs Splitten da,// sondern um den Zyklus mcp/index → builtin-tools → sub-agent → mcp/index zu@@ -56,7 +56,7 @@ import { allowedInReadOnlyTurn } from '../../lib/mutating-tools'// Recursion note: a sub-agent's tool list is filtered so it never SEES// `delegate_task`, which is what discourages nesting in practice. It is not a-// hard block — the runner resolves over the full registry — but the in-flight+// hard block, the runner resolves over the full registry, but the in-flight// concurrency cap below (SUB_AGENT_MAX_PARALLEL) plus each sub-agent's tight// budget bound the blast radius. (A former SUB_AGENT_MAX_DEPTH constant claimed// to enforce a depth limit but was never read; removed in 2.5.9. The design@@ -65,8 +65,8 @@ import { allowedInReadOnlyTurn } from '../../lib/mutating-tools'/*** Max sub-agents in flight at the same time (Bonus, 2026-05). Parallel- * siblings let the model fan out research tasks — e.g. "for each of these- * 4 files, summarize the public surface" — without the historic serial+ * siblings let the model fan out research tasks, e.g. "for each of these+ * 4 files, summarize the public surface", without the historic serial* pressure from the depth counter doubling as a concurrency gate.*/export const SUB_AGENT_MAX_PARALLEL = 4@@ -76,7 +76,7 @@ export const SUB_AGENT_MAX_PARALLEL = 4** Ab 2.6.8 die VORGABE, nicht mehr das Gesetz: `resolveSubAgentBudget()` liest* die Einstellungen und faellt auf diese Zahlen zurueck. Sie bleiben trotzdem- * hier stehen und werden nicht durch DEFAULT_SETTINGS ersetzt — dieses Modul+ * hier stehen und werden nicht durch DEFAULT_SETTINGS ersetzt, dieses Modul* laeuft in Tests ohne Store, und ein Sub-Agent ohne Kappe ist genau das, was* die Kappe verhindern soll.*/@@ -85,14 +85,14 @@ export const SUB_AGENT_BUDGET = { maxToolCalls: 10, maxIterations: 5 } as const/*** Die Kappen fuer EINEN delegierten Lauf.*- * 0 heisst hier "nimm die Vorgabe" und nicht "unbegrenzt" — anders als bei den+ * 0 heisst hier "nimm die Vorgabe" und nicht "unbegrenzt", anders als bei den* Kappen des Hauptlaufs. Der Unterschied ist kein Versehen: beim Hauptlauf* sitzt der Nutzer davor und kann Stop druecken, ein Sub-Agent laeuft ohne* Zuschauer. Unbegrenztheit soll man dort nicht aus Versehen einstellen* koennen, indem man ein Feld leert.*//** Hoechstlaenge des Rohmaterials, das ein Abbruch zurueckgibt. Es landet als- * WERKZEUGERGEBNIS im Fenster des Hauptagenten — grosszuegig waere hier+ * WERKZEUGERGEBNIS im Fenster des Hauptagenten, grosszuegig waere hier* teuer, und der Zweck ist ein Anhaltspunkt, keine Akte. */const MATERIAL_KAPPE = 3000const MATERIAL_JE_ERGEBNIS = 700@@ -101,14 +101,14 @@ const MATERIAL_JE_ERGEBNIS = 700* Was dieser Lauf per Werkzeug gefunden hat, als Rohmaterial.** `finalContent` sammelt nur die PROSA-Zuege. Ein Unteragent, der alle seine- * Schritte in Werkzeuge steckt — also genau der, der die Kappe reisst —, hat+ * Schritte in Werkzeuge steckt, also genau der, der die Kappe reisst, , hat* am Ende viel gefunden und nichts gesagt, und bis zum 03.09.2026 ging das* alles verloren: „(no partial answer)" nach 78 Sekunden Recherche. Bei einem* lokalen Modell ist das die teuerste Sekunde im ganzen Ablauf.** Fehlgeschlagene Aufrufe werden GEZAEHLT, nicht ausgegeben: „Web search* failed" ist kein Fund, und als Material waere es Rauschen. Als Zahl ist es- * die wichtigste Auskunft, die es hier gibt — es wurde nichts gefunden, und+ * die wichtigste Auskunft, die es hier gibt, es wurde nichts gefunden, und* der Hauptagent soll nicht anfangen zu raten.** Ausdruecklich als Material benannt und nie als Antwort: der Hauptagent soll@@ -132,7 +132,7 @@ export function gesammeltesMaterial(messages: Array<{ role: string; content?: stconst notiz = gescheitert > 0 ? ` ${gescheitert} tool call${gescheitert === 1 ? '' : 's'} failed and produced nothing.` : ''if (teile.length === 0) return notiz.trim()- return `Raw material gathered before the stop (not an answer — verify before using):${notiz}\n\n${teile.join('\n\n---\n\n')}`+ return `Raw material gathered before the stop (not an answer, verify before using):${notiz}\n\n${teile.join('\n\n---\n\n')}`}export function resolveSubAgentBudget(s?: {@@ -155,24 +155,24 @@ export const DELEGATE_TASK_TOOL_DEF: MCPToolDefinition = {// Die Zahlen sind seit 2.6.8 einstellbar, also duerfen sie hier nicht mehr// als Tatsache stehen. Eine Beschreibung, die "max 10" sagt, waehrend die// Einstellung auf 3 steht, ist keine Hilfe fuer das Modell, sondern eine- // Falschauskunft — es plant dann Teilziele, die es nie zu Ende bringt.+ // Falschauskunft, es plant dann Teilziele, die es nie zu Ende bringt.// Der echte Wert erreicht das Modell dort, wo er zaehlt: in// AgentBudget.haltMessage(), wenn die Kappe wirklich greift.// "Klein halten" stand hier frueher unmittelbar neben der neuen Bitte um- // einen AUSFUEHRLICHEN Auftrag — fuer ein 3B-Modell zwei Anweisungen, die+ // einen AUSFUEHRLICHEN Auftrag, fuer ein 3B-Modell zwei Anweisungen, die// sich widersprechen, und es befolgt dann die kuerzere. Die beiden meinen// verschiedene Achsen: der UMFANG bleibt schmal, die BESCHREIBUNG wird// lang. Genau so steht es jetzt da, in einem Satz statt in zweien.+ 'Its tool budget is tight: keep the SCOPE narrow, the brief detailed. '+ 'PARALLELIZE: emit multiple delegate_task tool calls in the SAME assistant turn '- + 'to fan out (e.g. one sub-agent per file) — up to 4 run concurrently. '+ + 'to fan out (e.g. one sub-agent per file), up to 4 run concurrently. '// Die Rueckgabeform wird ABSICHTLICH nicht mehr angekuendigt. Am// 02.09.2026 gemessen: ein 4B-Modell, dem gesagt wurde, der Aufruf liefere// „a task id at once", hat die Antwort ERFUNDEN statt das Werkzeug zu- // rufen — „Task ID: t12345, Status: Background task initiated". Wer einem+ // rufen, „Task ID: t12345, Status: Background task initiated". Wer einem// schwachen Modell das Ergebnis beschreibt, gibt ihm eine Vorlage zum// Halluzinieren. Was der Aufruf zurueckgibt, erfaehrt es beim Aufrufen.- + 'DO NOT call from inside another delegate_task — recursion is filtered by the harness. '+ + 'DO NOT call from inside another delegate_task, recursion is filtered by the harness. '+ 'NOT a replacement for a regular tool call when one direct tool would do.',inputSchema: {type: 'object',@@ -183,14 +183,14 @@ export const DELEGATE_TASK_TOOL_DEF: MCPToolDefinition = {// hier am schwersten zu sehen ist: der Sub-Agent teilt das Gespraech// NICHT. Er sieht nicht, was der Nutzer wollte, nicht die Dateien, die// schon offen waren, nicht die drei Fehlversuche davor. Ein Satz ist- // fuer den Aufrufer vollstaendig, weil er den Rest im Kopf hat — beim+ // fuer den Aufrufer vollstaendig, weil er den Rest im Kopf hat, beim// Empfaenger kommt eine Aufgabe ohne Grundlage an, und er sucht sich// die Haelfte davon nochmal zusammen, aus einem Budget, das dafuer// nicht reicht. Die Task-Beschreibung der Claude-Code-Desktop-App// verlangt an genau dieser Stelle das Gegenteil von Kuerze.description:'A detailed, self-contained brief: what to do and what to report back. '- + 'The sub-agent does NOT see this conversation — anything you leave out, '+ + 'The sub-agent does NOT see this conversation, anything you leave out, '+ 'it cannot look up. Several sentences are right here; one line is too little.',},context: {@@ -206,10 +206,10 @@ export const DELEGATE_TASK_TOOL_DEF: MCPToolDefinition = {// PLATZHALTER `"your-model-id"` mit, die Delegation lief gar nicht// erst los und der Nutzer bekam statt einer Antwort eine Fehlermeldung// samt Modelliste. Ein Feld, das nach einer Kennung fragt, bekommt von- // einem kleinen Modell eine erfundene — es sei denn, das Weglassen+ // einem kleinen Modell eine erfundene, es sei denn, das Weglassen// steht ausdruecklich und zuerst da.description:- 'OMIT unless the user named another model. Never a placeholder — '+ 'OMIT unless the user named another model. Never a placeholder, '+ 'only an id copied verbatim from the user or your installed list.',},background: {@@ -226,7 +226,7 @@ export const DELEGATE_TASK_TOOL_DEF: MCPToolDefinition = {}/**- * In-flight counter — module-scoped so parallel siblings + nested+ * In-flight counter, module-scoped so parallel siblings + nested* children share one bound. Reset only by successful return or thrown* error; see the try/finally in the executor.*@@ -298,20 +298,20 @@ export interface SubAgentGates {* Build the gates for one delegated run (audit AGT-1).** A sub-agent runs a full ReAct loop over the whole tool registry minus- * delegate_task — shell_execute, file_write and file_edit included, all three+ * delegate_task, shell_execute, file_write and file_edit included, all three* 'confirm' by default. Until 2.6.7 it called executeParallel with getTool +* execute + explainError and NOTHING else: no approval gate (the executor's* was optional and therefore skipped), no audit trail, no abort signal. One* approved delegate_task bought an unattended, unlogged, uninterruptible* shell. Threading `run` (plan 2.6.6 C1) did not fix that: the run context* carries the conversation, workspace, artifact and read-only flags, so it- * scopes WHERE a tool writes and whether shell_execute is read-only — it never+ * scopes WHERE a tool writes and whether shell_execute is read-only, it never* asked the user anything.** The gates are resolved here rather than handed down from the hook on* purpose. All three live in module-scoped, conversation-keyed state (the* approval FIFO, the audit store, the permission store), so the run's- * conversation id is enough to reach the SAME queue the parent loop uses —+ * conversation id is enough to reach the SAME queue the parent loop uses,* the pending approval surfaces in the same UI, the tool call lands in the* same audit list. The parent's own awaitApproval closure could not be reused:* it resolves a request id against the batch it was built for and answers@@ -407,7 +407,7 @@ export async function buildSubAgentGates(run?: AgentRunContext): Promise<SubAgenconst entry: ApprovalEntry = { toolCall, resolve }approvals.enqueueApproval(convId, entry)// Stop has to answer a question nobody clicked, or the delegation (and- // with it the parent turn) waits forever — same lesson as audit A4.+ // with it the parent turn) waits forever, same lesson as audit A4.abortSignal?.addEventListener('abort',() => {@@ -504,7 +504,7 @@ export async function defaultSubAgentRunner(function: { name: t.name, description: t.description, parameters: t.inputSchema },}))- // The sub-agent's own conversation — data this file writes, so it gets the+ // The sub-agent's own conversation, data this file writes, so it gets the// declared type `provider.chatWithTools` reads rather than a guard.const messages: ChatMessage[] = [{@@ -532,12 +532,12 @@ export async function defaultSubAgentRunner(let finalContent = ''// Hat dieser Unterauftrag ueberhaupt schon einen Handgriff getan, und hat er// seinen einen Anstoss schon bekommen? Beides zusammen entscheidet, ob ein- // Zug ohne Werkzeugaufruf als Antwort zaehlt — siehe ankuendigung.ts.+ // Zug ohne Werkzeugaufruf als Antwort zaehlt, siehe ankuendigung.ts.let werkzeugGelaufen = falselet angestossen = false// Die Schleifengrenze kommt aus DEMSELBEN Budget, das auch zaehlt. Vorher// stand hier die Konstante, waehrend `options.budget` die eingestellte Kappe- // trug — zwei Zahlen fuer eine Regel, und die stillere haette gewonnen.+ // trug, zwei Zahlen fuer eine Regel, und die stillere haette gewonnen.const maxIterations = options.budget.snapshot().caps.maxIterations || SUB_AGENT_BUDGET.maxIterationsfor (let i = 0; i < maxIterations; i++) {if (gates.abortSignal?.aborted) {@@ -567,7 +567,7 @@ export async function defaultSubAgentRunner(}// B1 (3.0.1): `gates.abortSignal` was only checked at the TOP of the next// iteration, never handed to the provider call itself. A Stop pressed- // mid-request left the fetch running to completion on its own — T4+ // mid-request left the fetch running to completion on its own, T4// measured a 25.2s cloud request finishing with status 200, 13.4s after// the user stopped, and that is paid compute the product promised would// not happen ("Stop means stop"). Threading the same signal the tool@@ -580,7 +580,7 @@ export async function defaultSubAgentRunner(finalContent = settled || finalContentif (!turn.toolCalls || turn.toolCalls.length === 0) {// Persona B2 (03.09.2026): drei Unterauftraege, 251 Sekunden, und- // zurueck kamen zwei Ankuendigungen — „Ich recherchiere das Hamburger+ // zurueck kamen zwei Ankuendigungen, „Ich recherchiere das Hamburger// Transparenzgesetz fuer Sie." Ein kleines Modell sagt erst hoeflich an,// was es tun wird, und faellt genau hier hinaus, bevor es einen// Handgriff getan hat. Ein Anstoss, einmal, und nur solange noch nichts@@ -604,7 +604,7 @@ export async function defaultSubAgentRunner(// Die NAMEN, nicht die Argumente: siehe AgentTask.activity. Die drei// Regeln dahinter (doppelte zusammenfassen, namenlose nicht// verschweigen, kappen) stehen in describeToolCalls und werden dort- // geprueft — hier liefe kein Test dagegen.+ // geprueft, hier liefe kein Test dagegen.activity: describeToolCalls(turn.toolCalls.map((tc) => tc.function?.name)),})}@@ -636,8 +636,7 @@ export async function defaultSubAgentRunner(messages.push({ role: 'assistant', content: turn.content || '', tool_calls: turn.toolCalls })// Map each result back to its ORIGINATING call by index. executeParallel// preserves input order (results[i] <-> requests[i] <-> turn.toolCalls[i]),- // so zipping by index gives every tool message the correct tool_call_id —- // even when the turn fired the same tool twice. The previous find-by-name+ // so zipping by index gives every tool message the correct tool_call_id, // even when the turn fired the same tool twice. The previous find-by-name// matched the FIRST call for both duplicates, leaving the second call's id// with no result; strict OpenAI-compatible providers (lu-cloud/DeepInfra,// openai, anthropic) then 400/422'd on the next turn and delegate_task@@ -692,7 +691,7 @@ export function buildDelegateExecutor(// Einstellungen (ein dynamisches import(), also ein Mikrotask) und zaehlte// danach hoch. Fuenf gleichzeitige Aufrufe kamen damit alle an der// Schranke vorbei, bevor der erste sie erhoehte, und die Kappe war weg.- // Gefangen von 'a 5th parallel sibling is refused' — eine Sperrklinke,+ // Gefangen von 'a 5th parallel sibling is refused', eine Sperrklinke,// die seit 2.5.x still gruen dastand und in dem Moment gebissen hat, in// dem sie gebraucht wurde. Die Reihenfolge hier ist die ganze Regel:// pruefen, zaehlen, DANN erst irgendetwas awaiten.@@ -733,13 +732,13 @@ export function buildDelegateExecutor(// ── Stopp auf die Hauptantwort laesst Hintergrundagenten LAUFEN ─────────//// Hier wurde das Abbruchsignal des Elternzugs durchgereicht. Fuer einen- // Vordergrundagenten ist das richtig — der Elternzug wartet ja auf ihn —,+ // Vordergrundagenten ist das richtig, der Elternzug wartet ja auf ihn, ,// und dort passiert es weiterhin von selbst, weil der unveraenderte// `run` mitsamt seinem Signal weitergegeben wird. Dieser Block hier// gehoert aber ausschliesslich dem Hintergrundfall, und da war es falsch://// Der Nutzer bestellt drei Hintergrund-Recherchen, die Hauptantwort- // schweift ab, er drueckt Stopp — und bekommt drei abgebrochene Agenten+ // schweift ab, er drueckt Stopp, und bekommt drei abgebrochene Agenten// samt halber Ergebnisse. Er wollte den Satz stoppen, nicht die Arbeit.//// Genau das trennt die Claude-Code-Desktop-App: Esc beendet die Antwort,@@ -747,7 +746,7 @@ export function buildDelegateExecutor(// Liste gestoppt. Beide Griffe dafuer gibt es hier: der Abbrechen-Knopf an// jeder Zeile im Panel und "Stop every running agent" im Kopf.//- // Was WEITERHIN abbricht — und der Grund, warum diese Zeile ueberhaupt+ // Was WEITERHIN abbricht, und der Grund, warum diese Zeile ueberhaupt// gestrichen werden durfte: das Loeschen oder Schliessen des Chats.// `dropConversationSideState` ruft `clearConv`, und das bricht laufende// Aufgaben ab, bevor es sie vergisst. Ein Agent ohne Chat haette niemanden@@ -755,7 +754,7 @@ export function buildDelegateExecutor(useAgentTaskStore.getState().start({// `controller` MUSS mit. Die erste Fassung erzeugte ihn zwei Zeilen- // weiter oben und uebergab ihn nicht — der Abbrechen-Knopf im Panel+ // weiter oben und uebergab ihn nicht, der Abbrechen-Knopf im Panel// waere fuer JEDE Hintergrundaufgabe tot gewesen, und nichts haette es// gemeldet: `cancel` gibt bei fehlendem Griff still `false` zurueck.// Gefunden, weil der Store ihn seither als Pflicht fuehrt.@@ -766,12 +765,12 @@ export function buildDelegateExecutor(// `_inFlight++` weiter oben und diesem `start(...)` liegen zwei awaits// (die zwei dynamischen imports), in deren Fenster ein Stop-Knopf// `cancelAll` ueber eine Liste laufen liess, in der diese Aufgabe noch- // gar nicht stand — sie wurde erst DANACH eingetragen, mit einem+ // gar nicht stand, sie wurde erst DANACH eingetragen, mit einem// Controller, den niemand mehr abbricht (der Lauf liest nur// `gates.abortSignal`, nicht `isRunStopped`). Ergebnis: ein// Hintergrundagent, der den Stop ueberlebt, bis sein Budget reisst.// `isRunStopped` ist der klebrige, modulweite Merker aus lib/run-stop.ts,- // genau fuer diesen Fall gebaut — hier direkt nach dem Eintragen und vor+ // genau fuer diesen Fall gebaut, hier direkt nach dem Eintragen und vor// dem ersten `runner(...)`-Aufruf geprueft schliesst das Fenster.if (isRunStopped(convId)) {controller.abort()@@ -810,12 +809,11 @@ export function buildDelegateExecutor(})void meldeInDenVerlauf(convId, id, goal, controller.signal.aborted ? 'cancelled' : 'failed', grund)})- // HIER faellt der Zaehler, nicht wenn der Aufruf zurueckkehrt — und+ // HIER faellt der Zaehler, nicht wenn der Aufruf zurueckkehrt, und// genau darin lag die zweite Falle, die eine Entwurfskritik am// 02.09.2026 aufgedeckt hat. Das urspruengliche try/finally umschloss// `await runner(...)`. Eine Hintergrundaufgabe kehrt sofort zurueck,- // also waere der Platz freigegeben, waehrend der Agent noch rechnet —- // SUB_AGENT_MAX_PARALLEL waere fuer genau den Pfad tot gewesen, der ihn+ // also waere der Platz freigegeben, waehrend der Agent noch rechnet, // SUB_AGENT_MAX_PARALLEL waere fuer genau den Pfad tot gewesen, der ihn// am noetigsten braucht. Der Zaehler gehoert an das Leben der AUFGABE..finally(() => { _inFlight-- })@@ -829,20 +827,20 @@ export function buildDelegateExecutor(** DAS LOCH, DAS SIE STOPFT: die Meldung an das MODELL laeuft ueber* `appendTaskReport`, und das steht oben in der ReAct-Schleife. Endet eine- * Aufgabe, NACHDEM der Elternzug vorbei ist — der Normalfall bei einer- * Hintergrundaufgabe, sie laeuft ja laenger —, gibt es keine Schleife mehr,+ * Aufgabe, NACHDEM der Elternzug vorbei ist, der Normalfall bei einer+ * Hintergrundaufgabe, sie laeuft ja laenger, , gibt es keine Schleife mehr,* die sie abholt. Bis zur naechsten Nachricht des Nutzers erfuhr niemand* etwas: nicht das Modell und, wenn das Panel zugeklappt war, auch nicht der* Mensch. Ein Agent hatte gearbeitet und niemand sah es.** Als App-Hinweis (`role:'system'` mit `notice`) und NICHT als* Assistentenblase: das Modell hat diesen Satz nicht gesagt. Die Nutzlast- * verwirft `role:'system'`, der Verlauf zeigt ihn — genau der Mechanismus,+ * verwirft `role:'system'`, der Verlauf zeigt ihn, genau der Mechanismus,* den auch `/compact` benutzt.** Was hier ABSICHTLICH NICHT passiert: es wird kein Modellzug gestartet. Die* Claude-Code-Desktop-App weckt ihren Hauptagenten von selbst; hier waere das- * eine Inferenz, die der Nutzer nicht angefordert hat — auf einem Laptop mit+ * eine Inferenz, die der Nutzer nicht angefordert hat, auf einem Laptop mit* lokalem Modell eine spuerbare Minute Rechnerei ohne Frage. Der Mensch sieht* das Ergebnis sofort, das Modell bekommt es beim naechsten Zug ueber* `takeUnreported`, das die Aufgabe bis dahin als ungemeldet fuehrt.@@ -880,7 +878,7 @@ let _taskSeq = 1* hat. Leer, solange niemand eine Zahl genannt hat.** SUB_AGENT_MAX_PARALLEL (4) bleibt die Vorgabe fuer das, was ein MODELL von- * sich aus faechern darf — sie bremst eine Fan-out-Schleife, die niemand+ * sich aus faechern darf, sie bremst eine Fan-out-Schleife, die niemand* bestellt hat. Sagt der Nutzer „nutze 5 agenten", ist dieselbe 4 keine* Sicherheitsgrenze mehr, sondern eine Bevormundung: er hat die Zahl genannt,* und die App weiss es nicht besser.diff --git a/src/api/cloud/__tests__/cloud-client.test.ts b/src/api/cloud/__tests__/cloud-client.test.tsindex 355964ff..d0c38c05 100644--- a/src/api/cloud/__tests__/cloud-client.test.ts+++ b/src/api/cloud/__tests__/cloud-client.test.ts@@ -20,7 +20,7 @@ beforeEach(() => {})/** A fetch that never answers on its own, and that ends the same way a real- * one does when its signal aborts — including a signal that was already+ * one does when its signal aborts, including a signal that was already* aborted before the call. */function hangingFetch(onAbort?: () => void) {return (_url: string, init: RequestInit) =>@@ -97,7 +97,7 @@ describe('cloudFetch', () => {// access token there, over the network, with no deadline of its own. The// guard used to be armed AFTER that await, so a refresh whose peer// disappeared mid-flight wedged Create exactly the way a hanging fetch did- // — one step earlier, and past every clock this file installs.+ //, one step earlier, and past every clock this file installs.vi.useFakeTimers()getAccessToken.mockImplementation(() => new Promise(() => {}))const settled = cloudFetch('/api/jobs', { method: 'POST', body: '{"x":1}' }).catch(@@ -180,13 +180,13 @@ describe('cloudFetch', () => {const settled = cloudFetch('/api/me', { signal: ac.signal }).catch((e: unknown) => e)// Wait for the request to be genuinely in flight before cancelling. The// deadline now also covers the token step, so aborting before fetch is- // reached (correctly) means no request is ever issued — which is the+ // reached (correctly) means no request is ever issued, which is the// adjacent test, not this one.await startedac.abort()const err = await settledexpect(seen?.aborted).toBe(true)- // A cancelled run is not a timeout — it must not be relabelled as one.+ // A cancelled run is not a timeout, it must not be relabelled as one.expect(err).not.toBeInstanceOf(CloudJobError)})@@ -212,7 +212,7 @@ describe('cloudFetch', () => {expect((err as CloudJobError).message).toMatch(/could not reach/i)})- it('D2: a deliberate cancel is NOT relabelled — it must stay tellable from a real failure', async () => {+ it('D2: a deliberate cancel is NOT relabelled: it must stay tellable from a real failure', async () => {// Regression guard for the fix above: it must only reword a genuine// network failure, never a caller-initiated Stop/teardown, which every// existing caller already distinguishes by checking `instanceof@@ -235,8 +235,8 @@ describe('cloudFetch', () => {it('D2 Nachbesserung 7: a genuine bug in this file is NOT relabelled as a server outage', async () => {// The original condition caught ANY bare rejection, so a programming- // error thrown from inside cloudFetch's own try block — a broken- // response parser, a bad property access — came back saying "LU Cloud+ // error thrown from inside cloudFetch's own try block, a broken+ // response parser, a bad property access, came back saying "LU Cloud// server unreachable" forever, hiding a real bug behind the wrong// explanation. A TypeError whose message is not one of the network-shaped// ones must pass through completely unchanged.@@ -348,7 +348,7 @@ describe('jobs wrappers', () => {expect(path).toBe('uid/abc.png')const [url, init] = fetchMock.mock.calls[0] as [string, RequestInit]expect(url).toBe(`${CLOUD_BASE}/api/jobs/upload?role=source`)- // WKWebView fails cross-origin FormData(Blob) bodies — the contract is a+ // WKWebView fails cross-origin FormData(Blob) bodies, the contract is a// bare ArrayBuffer with the octet-stream content type.expect(init.body).toBeInstanceOf(ArrayBuffer)expect((init.headers as Headers).get('content-type')).toBe('application/octet-stream')diff --git a/src/api/cloud/client.ts b/src/api/cloud/client.tsindex 652227ed..2e7d189d 100644--- a/src/api/cloud/client.ts+++ b/src/api/cloud/client.ts@@ -1,6 +1,6 @@// Fetch wrapper for the lu-labs.ai cloud APIs: prefixes CLOUD_BASE and// injects the Supabase bearer token. Direct HTTPS from the WebView (no Tauri-// proxy — the CSP allowlists the cloud hosts, and the server side speaks+// proxy, the CSP allowlists the cloud hosts, and the server side speaks// CORS for Tauri origins).import { CLOUD_BASE } from './config'@@ -15,7 +15,7 @@ export class CloudJobError extends Error {* provider throttle AND for an empty wallet, and only the last of those is* something the user can act on by paying. */readonly code?: string- /** What `retry-after` asked for, in ms — the burst guard's window is fixed+ /** What `retry-after` asked for, in ms, the burst guard's window is fixed* and up to a minute long, so the number is worth showing. */readonly retryAfterMs?: numberconstructor(@@ -24,7 +24,7 @@ export class CloudJobError extends Error {meta?: { code?: string; retryAfterMs?: number; cause?: unknown },) {// Opus-Review Nachbesserung 7 (3.0.1, D2): the reworded network-failure- // message below intentionally loses the engine's own text — `cause`+ // message below intentionally loses the engine's own text, `cause`// keeps it reachable for a log line without putting it back in front of// the customer. `super(message)` alone (no options) when nothing is// passed, matching every existing call site's behavior exactly.@@ -71,7 +71,7 @@ export async function jsonOrError<T>(res: Response): Promise<T> {/** Ceiling for one cloud round-trip. Nothing else bounds these: the Create* surface awaits them one after another, and a fetch whose peer disappears- * mid-flight never settles on its own — one half-open socket during an+ * mid-flight never settles on its own, one half-open socket during an* upload or a submit therefore wedged Create until the app was restarted. */const REQUEST_TIMEOUT_MS = 60_000@@ -85,12 +85,12 @@ const UPLOAD_BYTES_PER_MS = 64** Measured: ArrayBuffer, any view over one, Blob/File, string, URLSearchParams* (its serialised form is what goes on the wire) and FormData (the sum of its- * parts — the multipart boundaries add a few hundred bytes per field, which+ * parts, the multipart boundaries add a few hundred bytes per field, which* is noise next to a file and does not change the deadline).** NOT measurable: a ReadableStream body has no length until it has been read,* and reading it here would consume the only copy. `null` says so rather than- * reporting 0 bytes — FormData, URLSearchParams and a stream all counted as+ * reporting 0 bytes, FormData, URLSearchParams and a stream all counted as* zero before, so all three quietly got the flat ceiling while this comment* block claimed the deadline grew with the body. */function bodyBytes(body: RequestInit['body']): number | null {@@ -116,7 +116,7 @@ function bodyBytes(body: RequestInit['body']): number | null {/** The deadline for one request.** A body whose size cannot be known falls back to the flat ceiling, because- * there is nothing to derive anything else from — and that is a real limit,+ * there is nothing to derive anything else from, and that is a real limit,* not a rounding: a streamed 40 MB upload would be cut off at 60 s. Nothing* in this app sends a stream body today (uploadInput reads the Blob into an* ArrayBuffer first, everything else is JSON or a Blob), and the day one does@@ -135,7 +135,7 @@ export interface CloudFetchInit extends RequestInit {/*** Opus-Review Nachbesserung 7 (3.0.1, D2): the closed set of raw rejection* MESSAGES the fetch spec's own engines use for "this request never reached- * anything" — connection refused, DNS failure, CORS block, TLS failure. Not+ * anything", connection refused, DNS failure, CORS block, TLS failure. Not* a generic `err instanceof TypeError` check: a broken response parser or a* bad property access inside this app's own code also throws a TypeError,* and relabelling THAT as "LU Cloud server unreachable" would hide a real@@ -151,7 +151,7 @@ function looksLikeRawNetworkFailure(err: unknown): boolean {/** Settle `work` as soon as it settles, or reject the moment `signal` aborts.** For the steps of a request that take no AbortSignal of their own. The- * abandoned promise keeps running — it just no longer decides anything, and+ * abandoned promise keeps running, it just no longer decides anything, and* its rejection is still handled here, so it cannot surface as an unhandled* one later. */function untilAborted<T>(work: Promise<T>, signal: AbortSignal): Promise<T> {@@ -172,20 +172,20 @@ export async function cloudFetch(path: string, init: CloudFetchInit = {}): Promiconst { timeoutMs, signal, ...rest } = init// The clock starts BEFORE the token, not after it. getAccessToken() goes to// the network whenever the access token has expired (supabase-js refreshes- // it there), and that refresh has no deadline of its own — so awaiting it+ // it there), and that refresh has no deadline of its own, so awaiting it// outside this guard left exactly the wedge the guard exists to remove, one// step earlier: Create awaits these calls one after another, and a refresh// whose peer disappeared mid-flight never settles on its own.//- // Two things must be able to end all of it — the caller's signal (a- // cancelled run) and the deadline — and fetch takes one. AbortSignal.any+ // Two things must be able to end all of it, the caller's signal (a+ // cancelled run) and the deadline, and fetch takes one. AbortSignal.any// would merge them, but it is newer than the WKWebView LU runs inside on// older macOS, so the relay is wired by hand.const ac = new AbortController()// D2 (3.0.1): set the moment the CALLER's own signal is why `ac` aborted,// same idea as `timedOut` below but for cancellation instead of a deadline.// Needed to tell "the user/run cancelled this" apart from "the network- // genuinely failed" in the catch — both end up as a plain, non-CloudJobError+ // genuinely failed" in the catch, both end up as a plain, non-CloudJobError// rejection from `fetch`/`untilAborted`, and only the second one should be// reworded.let callerAborted = false@@ -208,7 +208,7 @@ export async function cloudFetch(path: string, init: CloudFetchInit = {}): Promi} catch (err) {// Engines disagree on whether a fetch rejects with the abort *reason*, so// the deadline is remembered here instead of read back off the signal.- // 408 keeps pollJob's policy intact — a timeout is worth another try.+ // 408 keeps pollJob's policy intact, a timeout is worth another try.// A 401 raised above is not a timeout and must keep its own status.if (timedOut && !(err instanceof CloudJobError)) {throw new CloudJobError('the cloud did not answer in time', 408)@@ -217,11 +217,11 @@ export async function cloudFetch(path: string, init: CloudFetchInit = {}): Promi// deploy. The new Desktop build calls a route the still-old server does// not have yet; an unmatched Next.js API route commonly answers without// the app's CORS headers, so the browser never lets the fetch resolve to- // a status code at all — it rejects the plain `fetch()` call itself with+ // a status code at all, it rejects the plain `fetch()` call itself with// `TypeError: Failed to fetch`. Every caller in this app reads `err instanceof// Error ? err.message : ...` straight into its own error banner// (ContentPolicySettings.tsx and others), so that raw engine string was- // the ENTIRE explanation a customer ever saw — no status, no next step.+ // the ENTIRE explanation a customer ever saw, no status, no next step.// Excluded on purpose: `err instanceof CloudJobError` is already a real// server answer (401 above, or one jsonOrError raised before it threw)// and keeps its own accurate message; `callerAborted` is a deliberate@@ -232,7 +232,7 @@ export async function cloudFetch(path: string, init: CloudFetchInit = {}): Promi// Opus-Review Nachbesserung 7: the ORIGINAL condition reworded EVERY bare// rejection, including a genuine programming error that happens to throw// inside this try block (a TypeError from a broken response parser, a bad- // property access) — a bug in this app's own code would come back+ // property access), a bug in this app's own code would come back// relabelled as "LU Cloud server unreachable" forever, and the next// report would chase the wrong half. `looksLikeRawNetworkFailure` only// matches the small, closed set of messages the fetch spec and its@@ -240,13 +240,13 @@ export async function cloudFetch(path: string, init: CloudFetchInit = {}): Promi// WebView2/Chrome ("Failed to fetch"), Firefox ("NetworkError when// attempting to fetch"), Safari/WebKit ("Load failed"), and the Rust-side// client this same request path uses under `npm run dev`/Node- // ("fetch failed" / "error sending request"). Anything else — including- // an error this app's own code raised — passes through unchanged. The+ // ("fetch failed" / "error sending request"). Anything else, including+ // an error this app's own code raised, passes through unchanged. The// original message still reaches the log, as `cause`, even though the// customer only ever sees the actionable rewording.if (!callerAborted && !(err instanceof CloudJobError) && looksLikeRawNetworkFailure(err)) {throw new CloudJobError(- 'Could not reach the LU Cloud server. This can happen right after an app update while the server catches up — try again in a moment, or check for a newer version.',+ 'Could not reach the LU Cloud server. This can happen right after an app update while the server catches up, try again in a moment, or check for a newer version.',0,{ cause: err },)@@ -254,7 +254,7 @@ export async function cloudFetch(path: string, init: CloudFetchInit = {}): Promithrow err} finally {// The deadline covers what this function owns: the token (refresh- // included), connect, request body, response headers — which is where the+ // included), connect, request body, response headers, which is where the// observed wedge lived (an upload or a submit that never came back).// Reading the response body is the caller's half; jsonOrError reports a// torn read rather than hanging.diff --git a/src/api/providers/__tests__/openai-top-k.test.ts b/src/api/providers/__tests__/openai-top-k.test.tsindex 587d68b1..4dde4f2c 100644--- a/src/api/providers/__tests__/openai-top-k.test.ts+++ b/src/api/providers/__tests__/openai-top-k.test.ts@@ -1,7 +1,7 @@/*** F3 (3.0.1, T4 Nebenfund): the sampling popup's top_k slider reached the* request body for local/self-hosted OpenAI-compatible endpoints for- * temperature and top_p, but never for top_k — the field simply was not on+ * temperature and top_p, but never for top_k, the field simply was not on* OpenAIChatRequest and nothing ever assigned it. The slider promised an* effect the server never saw.*@@ -71,7 +71,7 @@ afterEach(() => {vi.resetModules()})-describe('F3 — top_k reaches an own OpenAI-compatible endpoint', () => {+describe('F3: top_k reaches an own OpenAI-compatible endpoint', () => {it('chatStream sends top_k alongside temperature and top_p', async () => {const p = await makeProvider(OWN_ENDPOINT)await drain(p.chatStream('m', [{ role: 'user', content: 'hi' }], {@@ -88,7 +88,7 @@ describe('F3 — top_k reaches an own OpenAI-compatible endpoint', () => {expect(sent[0].body.top_k).toBe(20)})- it('never sends top_k to LU Cloud — that protocol genuinely has no such field', async () => {+ it('never sends top_k to LU Cloud: that protocol genuinely has no such field', async () => {const p = await makeProvider({ id: 'lu-cloud', name: 'LU Cloud', apiKey: '', enabled: true, baseUrl: 'https://lu-labs.ai/api/inference/v1', isLocal: false })await drain(p.chatStream('m', [{ role: 'user', content: 'hi' }], { topK: 40 }))expect('top_k' in sent[0].body).toBe(false)diff --git a/src/api/providers/ollama-provider.ts b/src/api/providers/ollama-provider.tsindex 43fc3e6f..9c10f93a 100644--- a/src/api/providers/ollama-provider.ts+++ b/src/api/providers/ollama-provider.ts@@ -1,5 +1,5 @@/**- * Ollama Provider — wraps existing ollama.ts into the ProviderClient interface.+ * Ollama Provider, wraps existing ollama.ts into the ProviderClient interface.** No behavior change. Pure adapter pattern.* Reuses localFetch/localFetchStream from backend.ts for Tauri compatibility.@@ -36,7 +36,7 @@ export interface OllamaRequestOptions {export interface OllamaRequestMessage {role: stringcontent: string- /** base64 payloads only — Ollama takes the data, not our {data,mimeType}. */+ /** base64 payloads only, Ollama takes the data, not our {data,mimeType}. */images?: string[]tool_calls?: ToolCall[]}@@ -53,8 +53,7 @@ export interface OllamaChatRequest {}// Was auf dieser Route ZURUECKKOMMT, liegt als `OllamaChatChunk` in ./wire,-// hinter `parseOllamaChatChunk`. Hier stand dieselbe Form ein zweites Mal —-// als Typargument an `parseNDJSONStream`, also als BEHAUPTUNG ueber+// hinter `parseOllamaChatChunk`. Hier stand dieselbe Form ein zweites Mal, // als Typargument an `parseNDJSONStream`, also als BEHAUPTUNG ueber// `JSON.parse`, mit drei Feldern (`prompt_eval_duration`, `total_duration`,// `load_duration`), die diese Datei nie gelesen hat. Die sieben, die sie// liest, kommen jetzt geprueft aus dem Parser. Dass das ueberhaupt auffiel:@@ -101,7 +100,7 @@ export class OllamaProvider implements ProviderClient {** Issue #31 fix: previously this function used `config.baseUrl` in Tauri* mode only, and in dev mode always forwarded to the Vite proxy which- * itself was hardcoded to localhost:11434 — so a user-configured remote+ * itself was hardcoded to localhost:11434, so a user-configured remote* Ollama never actually got called. Both modes now go through the single* ollamaUrl() resolver.*/@@ -149,11 +148,11 @@ export class OllamaProvider implements ProviderClient {if (options?.topP !== undefined) ollamaOptions.top_p = options.topPif (options?.topK !== undefined) ollamaOptions.top_k = options.topKif (options?.maxTokens && options.maxTokens > 0) ollamaOptions.num_predict = options.maxTokens- // Bug AA v2.5.0 — forward user's context-window override. Without this+ // Bug AA v2.5.0, forward user's context-window override. Without this// Ollama silently uses num_ctx=2048 (its default), which RAG payloads// and long-turn chats blow through immediately. Kj103x Discord// 2026-05-27: "LU caps VRAM ~5 GB regardless of context window UI- // setting" — the UI setting was never wired here. Setting num_ctx+ // setting", the UI setting was never wired here. Setting num_ctx// higher than the loaded model's max is harmless (Ollama clamps).// num_ctx comes from the caller (hook): the user override OR the model's// real context length (capped for VRAM safety). 0/undefined → Ollama keeps@@ -169,7 +168,7 @@ export class OllamaProvider implements ProviderClient {if (options?.thinking === true) body.think = trueelse if (options?.thinking === false) body.think = false- // Zeitbombe 4 — the idle watchdog needs something to abort, and a provider+ // Zeitbombe 4, the idle watchdog needs something to abort, and a provider// only ever gets a signal, never the controller behind it. This chains one// onto the caller's: Stop still propagates inward, and a stream that goes// silent can now cancel its own request (which on the Tauri path is what@@ -184,7 +183,7 @@ export class OllamaProvider implements ProviderClient {// Older Ollama builds / non-thinking models reject ANY `think` field// with HTTP 400. Retry once without it so the user's request still- // succeeds — we just fall back to model-default behaviour.+ // succeeds, we just fall back to model-default behaviour.if (!res.ok && res.status === 400 && 'think' in body) {delete body.thinkres = await localFetchStream(this.apiUrl('/chat'), {@@ -220,7 +219,7 @@ export class OllamaProvider implements ProviderClient {const chunk = parseOllamaChatChunk(raw)// Mid-stream `{"error":"..."}` line (runner crash, OOM) inside an- // HTTP-200 stream — surface it instead of yielding a silent empty+ // HTTP-200 stream, surface it instead of yielding a silent empty// chat turn (rikki Discord 2026-06-10, Win11 proxy path). `error`// kommt als `string | undefined` aus dem Parser, der `typeof`-Test// von frueher sass auf einem `unknown` aus einer Typzusicherung.@@ -231,7 +230,7 @@ export class OllamaProvider implements ProviderClient {// `arguments` arrives as `unknown` from the wire because Ollama is// not the only thing that answers on this endpoint: llama.cpp-based// and proxied servers send the field as a JSON *string*, and this- // path used to hand that string on as `Record<string, any>` — a lie+ // path used to hand that string on as `Record<string, any>`, a lie// `any` was covering for. repairToolCallArgs is the same// normalization the non-streaming path below already performs; for a// real object it returns the object untouched.@@ -250,7 +249,7 @@ export class OllamaProvider implements ProviderClient {toolCalls: toolCalls?.length ? toolCalls : undefined,done: chunk.done || false,finishReason: chunk.done_reason || undefined,- // Bug M v2.4.7 — pass through server-side generation metrics so the+ // Bug M v2.4.7, pass through server-side generation metrics so the// benchmark can report Ollama's own measurement instead of trusting// client-side TTFT, which WebView2 release-mode buffers into// uselessness for fast small models.@@ -269,7 +268,7 @@ export class OllamaProvider implements ProviderClient {throw err}- // Truncated NDJSON — no done:true ever arrived. A user-pressed Stop is+ // Truncated NDJSON, no done:true ever arrived. A user-pressed Stop is// not a disconnect, so it gets no terminal chunk (the chat layer has// already stopped reading by then anyway).if (!sawDone && !options?.signal?.aborted) {@@ -309,13 +308,13 @@ export class OllamaProvider implements ProviderClient {keep_alive: '30m',}- // v2.4.6 Bug L: see chatStream() above — same num_gpu:99 removal.+ // v2.4.6 Bug L: see chatStream() above, same num_gpu:99 removal.const ollamaOptions: OllamaRequestOptions = {}if (options?.temperature !== undefined) ollamaOptions.temperature = options.temperatureif (options?.topP !== undefined) ollamaOptions.top_p = options.topPif (options?.topK !== undefined) ollamaOptions.top_k = options.topKif (options?.maxTokens && options.maxTokens > 0) ollamaOptions.num_predict = options.maxTokens- // Bug AA v2.5.0 — see chatStream() for the why.+ // Bug AA v2.5.0, see chatStream() for the why.// num_ctx comes from the caller (hook): the user override OR the model's// real context length (capped for VRAM safety). 0/undefined → Ollama keeps// its own default; the hook always passes a real value so a chat never@@ -324,7 +323,7 @@ export class OllamaProvider implements ProviderClient {ollamaOptions.num_ctx = options.contextWindow}body.options = ollamaOptions- // Tri-state think flag — see chatStream() for details.+ // Tri-state think flag, see chatStream() for details.if (options?.thinking === true) body.think = trueelse if (options?.thinking === false) body.think = false@@ -378,7 +377,7 @@ export class OllamaProvider implements ProviderClient {thinking: asString(prop(message, 'thinking')) || '',toolCalls,// Real token usage from the non-streaming response, same fields- // chatStream() already forwards — without them the agent TokenCounter+ // chatStream() already forwards, without them the agent TokenCounter// falls back to a char/4 estimate for every Ollama tool turn.promptEvalCount: asNumber(prop(data, 'prompt_eval_count')),evalCount: asNumber(prop(data, 'eval_count')),@@ -418,8 +417,8 @@ export class OllamaProvider implements ProviderClient {// 'full', and only the cloud catalog path (openai-provider.ts// listModels) ever sets that field, because it is the only one backed// by a real measurement. Ollama's own /api/tags carries nothing like- // it, so a locally installed abliterated/uncensored GGUF — several of- // which this app's own Discover catalog tags 'Unfiltered' — can never+ // it, so a locally installed abliterated/uncensored GGUF, several of+ // which this app's own Discover catalog tags 'Unfiltered', can never// show the mark, even though it deserves it. Rather than guess from// the model name (the house rule this app is built against), the mark// stays measured-only and simply absent here. Closing this needs a@@ -439,7 +438,7 @@ export class OllamaProvider implements ProviderClient {async getContextLength(model: string): Promise<number> {// Bug K: dieselbe Cascade-Logik wie in src/api/ollama.ts::getModelContext.- // Vorher hat dieser Provider NUR `general.context_length` gecheckt — aber+ // Vorher hat dieser Provider NUR `general.context_length` gecheckt, aber// viele Ollama-Modelle (z.B. qwen2.5:*, llama3.x:*) lassen das leer und// setzen stattdessen architecture-specific keys wie `qwen2.context_length`// oder `llama.context_length`. Mit dem alten Code zeigte LU 4096 obwohl@@ -488,15 +487,15 @@ export class OllamaProvider implements ProviderClient {/*** Classify a non-ok Ollama response and wrap it in `ProviderError`. The* resulting error carries:- * - `code` — one of `ollama_missing_blob`, `ollama_stale_manifest`,+ * - `code`, one of `ollama_missing_blob`, `ollama_stale_manifest`,* or generic `network` so UI catch sites can branch (and feed the* model-health store via lib/sync-ollama-health.ts) without* re-parsing the message.- * - `model` — threaded through from chatStream/chatWithTools so the+ * - `model`, threaded through from chatStream/chatWithTools so the* UI can name the affected model in a one-click "ollama pull <model>"* repair flow. Missing-blob errors only carry the on-disk blob hash,* not the model name, so we pass `model` into parseOllamaError as the- * fallback (Bug C) — that populates `parsed.model`, which+ * fallback (Bug C), that populates `parsed.model`, which* chatStyleMessage then uses for the user-facing wording.** Pure function: no store side-effects, no UI imports. The caller@@ -506,7 +505,7 @@ export class OllamaProvider implements ProviderClient {* Shares the detection logic with loadModel / unloadModel via* ollama-errors. The regex there matches chat, completion, AND generate* (the Lichtschalter path uses /api/generate with an empty prompt for- * preload — same error class).+ * preload, same error class).*/private async buildError(res: Response, fallback: string, model?: string): Promise<ProviderError> {const status = res.statusdiff --git a/src/api/providers/openai-provider.ts b/src/api/providers/openai-provider.tsindex 800e7535..410249ff 100644--- a/src/api/providers/openai-provider.ts+++ b/src/api/providers/openai-provider.ts@@ -43,8 +43,8 @@ import { useSettingsStore } from '../../stores/settingsStore'// Transport routing lives in the `useLocalProxy` getter (below) plus the shared// host helpers in backend.ts. A direct webview fetch only works for hosts the-// pinned CSP lists; everything else — LAN backends (also CORS-blocked, GH #49)-// and any cloud endpoint LU ships no preset for — goes through the Rust proxy.+// pinned CSP lists; everything else, LAN backends (also CORS-blocked, GH #49)+// and any cloud endpoint LU ships no preset for, goes through the Rust proxy.// `isLanBackend` stays separate: it decides local-only BEHAVIOUR (context// probing), which must not follow the transport decision.@@ -110,7 +110,7 @@ export interface OpenAIChatRequest {* The two transports this provider posts through: the browser `fetch` and* `localFetch`/`localFetchStream` (Rust proxy). Both satisfy this narrower* signature, which is what removes the `fetcher as any` casts that used to- * bridge them — a cast that would equally have accepted a function taking no+ * bridge them, a cast that would equally have accepted a function taking no* arguments at all.*/type ChatFetcher = (@@ -134,7 +134,7 @@ interface OpenAIModelEntry {owned_by?: string// Catalogue metadata some OpenAI-compat servers attach (LU Cloud does):// display name, real context window, vision modality, think capability.- // Absent everywhere else — the mapping below falls back to heuristics.+ // Absent everywhere else, the mapping below falls back to heuristics.name?: string/** Das Fenster, mit dem diese Bereitstellung laeuft. */context_length?: number@@ -164,7 +164,7 @@ interface OpenAIModelEntry {/*** Build a catalogue entry out of one `/v1/models` element, checking every* field on the way. `think` is validated against the three values the rest of- * the app switches on — a server sending anything else must not smuggle a+ * the app switches on, a server sending anything else must not smuggle a* fourth mode into the model picker.*/function toModelEntry(m: Record<string, unknown>): OpenAIModelEntry {@@ -241,7 +241,7 @@ const KNOWN_CONTEXT: Record<string, number> = {'qwen/qwen-2.5-72b-instruct': 32768,}-// Heuristik aus dem Modell-Namen — letzter Fallback bevor wir auf den+// Heuristik aus dem Modell-Namen, letzter Fallback bevor wir auf den// konservativen 8192er-Default zurueckfallen. Wird nur erreicht wenn weder// KNOWN_CONTEXT noch `probeContextFromServer()` ein Ergebnis liefert.function guessContextFromName(model: string): number {@@ -278,7 +278,7 @@ function guessContextFromName(model: string): number {// context_length per model). The name heuristic underestimates new cloud// models badly (Qwen3.6-35B-A3B → 32k guess vs 262k real), which shrinks the// applyMaxTokens headroom toward the 256 floor on long chats and truncates-// answers. Module-level and keyed by endpoint — NOT an instance field: the+// answers. Module-level and keyed by endpoint, NOT an instance field: the// lu-cloud provider builds a FRESH OpenAIProvider delegate on every call (its// bearer token rotates), so an instance map is always empty exactly where it// matters. listModels fills it through one delegate; chatStream's@@ -294,18 +294,18 @@ const catalogContext = new Map<string, number>()*/const catalogTrained = new Map<string, number>()-/** Ceiling for the optional metadata probes — see `probeInit`. */+/** Ceiling for the optional metadata probes, see `probeInit`. */const CONTEXT_PROBE_TIMEOUT_MS = 2500/*** Flat token cost charged for one inline image during prompt estimation.** Audit CS-1: a base64 data URL is ~1.37 characters per byte of source image,- * so a single 100 KB screenshot adds ~137 000 characters to `body.messages` —+ * so a single 100 KB screenshot adds ~137 000 characters to `body.messages`,* ~34 000 phantom "tokens" under the chars/4 rule, which is more than the ENTIRE* window of every model at or below 32k (the built-in engine, LM Studio,* llama.cpp, vLLM, KoboldCpp). The headroom subtraction then went negative and- * the 256 floor won, capping every answer with an attachment at 256 tokens —+ * the 256 floor won, capping every answer with an attachment at 256 tokens,* and getting worse each turn, because images ride along in the history.** Images do not cost characters, they cost tiles. OpenAI bills a 1024x1024@@ -390,7 +390,7 @@ export class OpenAIProvider implements ProviderClient {}/**- * A backend on this machine or the LAN — declared by the preset+ * A backend on this machine or the LAN, declared by the preset* (`config.isLocal`) OR detected from the host (localhost, RFC1918, CGNAT,* IPv6 ULA/link-local, .local, bare machine name). Drives behaviour that only* makes sense locally: per-model context probing and the LM Studio enhanced@@ -404,7 +404,7 @@ export class OpenAIProvider implements ProviderClient {* Whether requests must go through the Rust proxy instead of a direct webview* fetch. Two reasons: a LAN endpoint has no CORS headers for the* tauri.localhost origin (GH #49), and a public host outside the pinned CSP- * allow-list gets killed inside the webview before it hits the network — that+ * allow-list gets killed inside the webview before it hits the network, that* is every custom OpenAI-compatible provider a user configures themselves* (their own domain, or a vendor LU ships no preset for).*/@@ -597,7 +597,7 @@ export class OpenAIProvider implements ProviderClient {// Sanierungspfad: a throttle or a gateway hiccup is not the request's// fault, and the user used to read the raw status line for it. The retry// sits HERE, around the request, so it can never replay a stream that has- // already started — see providers/retry.ts for the rules.+ // already started, see providers/retry.ts for the rules.const post = () => sendWithTransientRetry(() => fetcher(`${this.baseUrl}/chat/completions`, {method: 'POST',@@ -677,8 +677,8 @@ export class OpenAIProvider implements ProviderClient {/*** Request init for the optional side probes (context window, tool- * capabilities). Every one of them is an OPTIMISATION — a failure just means- * the cascade falls back to a heuristic — but they ran with neither a signal+ * capabilities). Every one of them is an OPTIMISATION, a failure just means+ * the cascade falls back to a heuristic, but they ran with neither a signal* nor a timeout, so a LAN backend that accepts the TCP connection and then* says nothing blocked the user's message for the proxy's full default* (300 s, and applyMaxTokens can hit two of them) with Stop unable to cut in.@@ -694,8 +694,7 @@ export class OpenAIProvider implements ProviderClient {* Bound `max_tokens` so prompt + completion can never exceed the model's real* context window. Some cloud backends (DeepInfra) otherwise default the* completion budget to nearly the whole window and then 400 the moment the- * real prompt (agent system prompt + tool definitions) tips it over —- * surfaced as "[network] inference upstream error" on tool turns (Bug 5,+ * real prompt (agent system prompt + tool definitions) tips it over, * surfaced as "[network] inference upstream error" on tool turns (Bug 5,* 2026-07-11). Under-estimating the context is safe (a shorter cap); we never* over-request. Runs for every request, so an UNSET budget (settings.maxTokens* = 0) sends the full safe remainder instead of letting the server over-default.@@ -746,7 +745,7 @@ export class OpenAIProvider implements ProviderClient {}const RESERVE = 512// Audit CS-1: count characters WITHOUT the base64 image payloads and charge- // a flat per-image rate instead — see IMAGE_TOKEN_ESTIMATE. Counting the+ // a flat per-image rate instead, see IMAGE_TOKEN_ESTIMATE. Counting the// data URLs as text made one screenshot look like ~34k tokens and starved// max_tokens down to the 256 floor on every model with a small window.const msgPayload = measurePayload(body.messages || '')@@ -756,7 +755,7 @@ export class OpenAIProvider implements ProviderClient {Math.ceil(promptChars / 4) + (msgPayload.images + toolPayload.images) * IMAGE_TOKEN_ESTIMATEconst headroom = Math.max(256, ctxLen - promptTokens - RESERVE)// Audit E6: an UNSET budget used to send the whole remaining window as- // max_tokens — six figures on a 128k model. Servers that validate+ // max_tokens, six figures on a 128k model. Servers that validate// max_tokens against the model's real OUTPUT limit reject that outright.// 32k is beyond any single reply this app produces; an explicit user// request still passes through un-capped (their server, their call).@@ -780,8 +779,7 @@ export class OpenAIProvider implements ProviderClient {if (options?.temperature !== undefined) body.temperature = options.temperatureif (options?.topP !== undefined) body.top_p = options.topP- // F3: temperature and top_p reached the request, top_k never did —- // the sampling popup's slider promised an effect that never happened.+ // F3: temperature and top_p reached the request, top_k never did, // the sampling popup's slider promised an effect that never happened.// LU Cloud is excluded on purpose: its proxy protocol genuinely has no// such field (sampling-reaches-the-cloud-body.test.ts), unlike a real// self-hosted llama.cpp/vLLM/KoboldCpp/LM-Studio/built-in-engine server.@@ -807,18 +805,18 @@ export class OpenAIProvider implements ProviderClient {// (choices:[] + usage:{...}). OpenAI, DeepInfra (LU Cloud), Groq, vLLM and// LM Studio all honor stream_options; an endpoint that rejects unknown// params 400/422s and the retry below drops it. Real usage is what keeps- // the TokenCounter honest — a char/4 estimate can't see the system prompt.+ // the TokenCounter honest, a char/4 estimate can't see the system prompt.body.stream_options = { include_usage: true }// Managed built-in engine: Create/Music renders stop the llama-server- // child to free VRAM ("reloads lazily on the next message") — this is that+ // child to free VRAM ("reloads lazily on the next message"), this is that// lazy reload. Restart-before-send instead of letting the fetch hit a dead// 127.0.0.1:8127 and look like a crashed backend.if (this.config.managed === true) await ensureBuiltinEngineAlive(model)if (this.useLocalProxy) await ensureProxyAllowsHost(this.baseUrl)const fetcher = this.useLocalProxy ? localFetchStream : fetch- // Zeitbombe 4 — the idle watchdog needs a controller to abort, and a+ // Zeitbombe 4, the idle watchdog needs a controller to abort, and a// provider only ever receives a signal. This chains one onto the caller's:// Stop still propagates inward, and a stream that goes silent can cancel// its own request instead of leaving reader.read() pending forever.@@ -830,7 +828,7 @@ export class OpenAIProvider implements ProviderClient {res = await this.sendChat(model, body, guard.signal, fetcher)if (!res.ok) throw await this.parseError(res)} catch (err) {- // Nothing to watch — drop the listener on the caller's signal here, the+ // Nothing to watch, drop the listener on the caller's signal here, the// stream loop's `finally` below is never reached on this path.guard.release()throw err@@ -886,7 +884,7 @@ export class OpenAIProvider implements ProviderClient {)}- // Real token usage — the include_usage final chunk carries `usage` with+ // Real token usage, the include_usage final chunk carries `usage` with// an empty choices[], so capture it BEFORE the choice guard below.const u = chunk.usageif (u) {@@ -900,14 +898,13 @@ export class OpenAIProvider implements ProviderClient {// Capture WHY the model stopped ('stop', 'length', 'content_filter').// 'length' with zero content is the reasoning-loop failure mode: the// whole token budget went into thinking and no answer was ever written- // (David, cloud Qwen3.6, 2026-07-12) — the chat layer needs the reason+ // (David, cloud Qwen3.6, 2026-07-12), the chat layer needs the reason// to explain the empty bubble.if (choice.finish_reason) finishReason = choice.finish_reasonconst content = choice.delta?.content || ''- // Yield native reasoning as `thinking` so the panel fills live —- // without this the entire reasoning phase of a cloud reasoner is+ // Yield native reasoning as `thinking` so the panel fills live, // without this the entire reasoning phase of a cloud reasoner is// silently dropped and the chat sits in dead air (uselu fc55c91).const reasoning = choice.delta?.reasoning_content ?? choice.delta?.reasoning ?? ''if (repetitionStop?.push(content) || reasoningRepetitionStop?.push(reasoning)) {@@ -924,11 +921,11 @@ export class OpenAIProvider implements ProviderClient {const key = tc.index ?? keyForUnindexedBlock(toolCallAccum, tc.id)const existing = toolCallAccum.get(key)if (existing) {- // id and name do NOT always arrive in the first delta — several+ // id and name do NOT always arrive in the first delta, several// OpenAI-compat servers send the id one chunk later, or open with a// bare index. Ignoring them left a call with an empty name (dispatch// fails on "") or an empty tool_call_id, which 422s the follow-up- // turn — the exact break the server-side normalizer had to heal.+ // turn, the exact break the server-side normalizer had to heal.// Set-if-empty, not append: servers that repeat the full name in// every delta are far more common than ones that stream it in parts.if (tc.id && !existing.id) existing.id = tc.id@@ -950,7 +947,7 @@ export class OpenAIProvider implements ProviderClient {// NB: we intentionally do NOT early-return on finish_reason. With// stream_options.include_usage the server sends the usage chunk AFTER- // the finish_reason chunk — returning early would discard it. The [DONE]+ // the finish_reason chunk, returning early would discard it. The [DONE]// sentinel (or the end-of-stream fallback below) emits the single done// chunk, which now carries the captured usage.}@@ -969,7 +966,7 @@ export class OpenAIProvider implements ProviderClient {// Stream ended without an explicit [DONE] sentinel. If the server also// never sent a finish_reason, the connection was cut mid-generation- // (proxy idle-timeout, upstream drop) — a clean FIN ends parseSSEStream+ // (proxy idle-timeout, upstream drop), a clean FIN ends parseSSEStream// without any error, which used to masquerade as a normal completion and// leave the user a silent empty bubble. Tag it 'disconnect' so the chat// layer can say so.@@ -996,8 +993,7 @@ export class OpenAIProvider implements ProviderClient {if (options?.temperature !== undefined) body.temperature = options.temperatureif (options?.topP !== undefined) body.top_p = options.topP- // F3: temperature and top_p reached the request, top_k never did —- // the sampling popup's slider promised an effect that never happened.+ // F3: temperature and top_p reached the request, top_k never did, // the sampling popup's slider promised an effect that never happened.// LU Cloud is excluded on purpose: its proxy protocol genuinely has no// such field (sampling-reaches-the-cloud-body.test.ts), unlike a real// self-hosted llama.cpp/vLLM/KoboldCpp/LM-Studio/built-in-engine server.@@ -1073,7 +1069,7 @@ export class OpenAIProvider implements ProviderClient {// G32 (R20-Mac, 2026-08-07): the standard /v1/models listing says// nothing about tools, so `?? true` declared every LM Studio model// tool-capable and the layered resolution downstream had nothing to- // downgrade on — a tool-less model got a native `tools` payload. LM+ // downgrade on, a tool-less model got a native `tools` payload. LM// Studio's enhanced listing answers it per model in `capabilities`// (['tool_use', ...]); one fetch covers all models. Backends without// the enhanced API leave the map empty → optimistic as before.@@ -1163,7 +1159,7 @@ export class OpenAIProvider implements ProviderClient {}/**- * Bug K — dynamische Context-Window-Detection fuer lokale OpenAI-compat+ * Bug K, dynamische Context-Window-Detection fuer lokale OpenAI-compat* Backends. LM Studio 0.3+ liefert die wahren Werte via Enhanced-API:* GET /api/v0/models/<id> -> { max_context_length, loaded_context_length, ... }* Generische OpenAI-compat Server (vLLM, llama.cpp server, Aphrodite, SGLang,@@ -1320,7 +1316,7 @@ export class OpenAIProvider implements ProviderClient {/*** G32: per-model tool capability from LM Studio's enhanced listing* (/api/v0/models). Only entries that carry a `capabilities` array land in- * the map — a generic OpenAI-compat backend (vLLM, llama.cpp server) 404s+ * the map, a generic OpenAI-compat backend (vLLM, llama.cpp server) 404s* or answers without the field, and an absent entry means "nobody said",* which keeps the optimistic default. LAN only, same rule as the context* probe: a cloud endpoint must not get an extra request per listing.@@ -1344,7 +1340,7 @@ export class OpenAIProvider implements ProviderClient {* G37 (R21c wire proof, 2026-08-07): llama.cpp's own answer, one flag for* the whole server. The bundled engine's /props reports* chat_template_caps.supports_tools: false because the GGUF ships a minimal- * template, and a native `tools` payload is then accepted but IGNORED — no+ * template, and a native `tools` payload is then accepted but IGNORED, no* refusal to learn from, the model just never sees a tool contract. false* means every model here needs the prompt transport; true means native is* fine; a 404 or a props answer without the field means nobody said, and@@ -1400,7 +1396,7 @@ export class OpenAIProvider implements ProviderClient {/*** G37 (R21c, 2026-08-07): llama.cpp answers the tool question on /props,* server-wide. The bundled engine loads the GGUF's template WITHOUT tool- * support and then silently ignores a native `tools` payload — the model+ * support and then silently ignores a native `tools` payload, the model* never sees a tool contract and invents results for every step. /props is* only asked when the enhanced listing said nothing.*/@@ -1419,7 +1415,7 @@ export class OpenAIProvider implements ProviderClient {* server drive native tools". The listing-time probe (G37) never runs for* the bundled engine, because useModels skips listModels for the managed* built-in backend and builds the picker rows from the downloaded GGUFs- * instead — so the run still put a native `tools` payload on 8127 and the+ * instead, so the run still put a native `tools` payload on 8127 and the* model narrated fiction. The strategy resolution calls this directly* before each run: `false` means the prompt transport must carry the* contract, `true` means native is fine, `undefined` means nobody said@@ -1435,7 +1431,7 @@ export class OpenAIProvider implements ProviderClient {/*** R19 (LM Studio, 2026-08-07): what the server actually ALLOCATED for this* model. LM Studio JIT-loads at its configured default, often far below the- * model's maximum, and hard-truncates any prompt beyond it — a run budgeted+ * model's maximum, and hard-truncates any prompt beyond it, a run budgeted* against max_context_length loses the middle of its own prompt, tool* contract included, and dies without a usable error. The run budget clamps* to this; the DISPLAY value deliberately keeps preferring the maximum@@ -1626,13 +1622,13 @@ export class OpenAIProvider implements ProviderClient {* A tool call's `arguments` is a JSON *string* on the wire and the caller is* a language model, so nothing guarantees it decodes to an object. The happy* path used to return whatever JSON.parse produced under a- * `Record<string, any>` annotation — `"null"` therefore handed `null` to+ * `Record<string, any>` annotation, `"null"` therefore handed `null` to* every downstream `args.foo` read, and `"[1,2]"` / `"42"` handed on a value* with none of the promised keys.** Both branches now go through `isRecord`, and that is deliberately NOT the* check the repair branch used to have: `typeof [] === 'object'`, so- * `parsed && typeof parsed === 'object'` let an ARRAY through — the very+ * `parsed && typeof parsed === 'object'` let an ARRAY through, the very* `"[1,2]"` this comment named as covered while it was not. Arrays and null* are rejected here; only something indexable by name leaves.*/@@ -1693,7 +1689,7 @@ export class OpenAIProvider implements ProviderClient {} catch { /* non-JSON body → keep default */ }// Map HTTP status to error code. The canned texts are FALLBACKS for- // opaque bodies only — a server that sends an honest message (LU Cloud:+ // opaque bodies only, a server that sends an honest message (LU Cloud:// "monthly credit budget exhausted", "LU Cloud is in closed beta (Max// plan only)", …) must surface it verbatim, not a wrong API-key /// wait-a-moment hint the user can't act on.@@ -1733,8 +1729,7 @@ export class OpenAIProvider implements ProviderClient {// LM Studio: model load fails when there's no inference runtime for the// model's format installed. The raw API error reads "No LM Runtime found- // for model format 'gguf'" which doesn't tell a noob what to do —- // rewrite it into actionable steps. This commonly happens on Windows+ // for model format 'gguf'" which doesn't tell a noob what to do, // rewrite it into actionable steps. This commonly happens on Windows// ARM64 where LM Studio doesn't auto-fetch a runtime, and on any fresh// install where the user installed via LU's in-app install_lmstudio.// The runtime catalogue isn't reachable from `lms` CLI (no `runtime`diff --git a/src/api/providers/types.ts b/src/api/providers/types.tsindex d41a184a..e8b4d24c 100644--- a/src/api/providers/types.ts+++ b/src/api/providers/types.ts@@ -18,7 +18,7 @@ export interface ProviderConfig {enabled: booleanbaseUrl: string // e.g. "http://localhost:11434", "https://openrouter.ai/api/v1"apiKey: string // Encrypted in store. Empty string for local providers.- isLocal: boolean // true for Ollama, LM Studio, vLLM — no API key needed+ isLocal: boolean // true for Ollama, LM Studio, vLLM, no API key needed// Built-in engine (2.5.7): the app manages this OpenAI-compatible backend's// lifecycle itself (bundled llama-server on 127.0.0.1:8127). When true the UI// hides the URL/key inputs and the model list comes from `list_bundled_models`@@ -51,8 +51,7 @@ export interface ProviderConfig {disabledByUser?: boolean// Opus-Review Nachbesserung 6 (3.0.1, F3): the pushed-out backend's own// API key, so a takeover does not just stop LEAKING it into the new- // occupant's field (the original F3 fix) but also stops DESTROYING it —- // handing the slot back used to come back with no key and a silent 401.+ // occupant's field (the original F3 fix) but also stops DESTROYING it, // handing the slot back used to come back with no key and a silent 401.// Same "obfuscated" representation `apiKey` itself carries, an opaque// blob this app never needs to read as text outside providerStore.ts.// Session-only on purpose: providerStore.ts's `partialize` strips this@@ -78,7 +77,7 @@ export interface ProviderPreset {}export const PROVIDER_PRESETS: ProviderPreset[] = [- // Built-in engine (2.5.7) — bundled llama.cpp llama-server, OpenAI-compatible,+ // Built-in engine (2.5.7), bundled llama.cpp llama-server, OpenAI-compatible,// lifecycle owned by the app. Zero external install. Default backend.{ id: 'builtin', name: LU_ENGINE_NAME, providerId: 'openai', baseUrl: 'http://127.0.0.1:8127/v1', isLocal: true, managed: true },@@ -89,7 +88,7 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [{ id: 'lmstudio', name: 'LM Studio', providerId: 'openai', baseUrl: 'http://localhost:1234/v1', isLocal: true },{ id: 'vllm', name: 'vLLM', providerId: 'openai', baseUrl: 'http://localhost:8000/v1', isLocal: true },{ id: 'llamacpp', name: 'llama.cpp', providerId: 'openai', baseUrl: 'http://localhost:8080/v1', isLocal: true },- // LiteLLM proxy (GH PR #64, thanks @RheagalFire) — speaks the OpenAI protocol,+ // LiteLLM proxy (GH PR #64, thanks @RheagalFire), speaks the OpenAI protocol,// so it reuses the openai client and fronts 100+ upstreams from one local port.{ id: 'litellm', name: 'LiteLLM', providerId: 'openai', baseUrl: 'http://localhost:4000/v1', isLocal: true },{ id: 'koboldcpp', name: 'KoboldCpp', providerId: 'openai', baseUrl: 'http://localhost:5001/v1', isLocal: true },@@ -170,8 +169,7 @@ export interface ChatOptions {temperature?: numbertopP?: number// Ollama/Anthropic support this. The real OpenAI API does not, but F3- // (3.0.1): the OpenAI-COMPATIBLE provider (self-hosted endpoints —- // llama.cpp, vLLM, KoboldCpp, LM Studio, the built-in engine) sends it as+ // (3.0.1): the OpenAI-COMPATIBLE provider (self-hosted endpoints, // llama.cpp, vLLM, KoboldCpp, LM Studio, the built-in engine) sends it as// an extension field, the same way it already sends top_p.topK?: numbermaxTokens?: number@@ -195,7 +193,7 @@ export interface ChatOptions {* a model default above it would quietly upgrade the bill.*/effortDefault?: string- // Bug AA v2.5.0 — Kj103x Discord 2026-05-27. Ollama defaults `num_ctx` to+ // Bug AA v2.5.0, Kj103x Discord 2026-05-27. Ollama defaults `num_ctx` to// 2048 if you don't pass it in /api/chat options, which silently caps RAG// and long-turn chats even though the loaded model supports way more. When// set, we forward this as `options.num_ctx` to Ollama. Other providers@@ -220,12 +218,12 @@ export interface ChatStreamChunk {toolCalls?: ToolCall[]done: boolean// Why generation ended, on the final done:true chunk. 'stop' | 'length'- // (token budget exhausted — e.g. the whole budget went into reasoning) |+ // (token budget exhausted, e.g. the whole budget went into reasoning) |// 'disconnect' (the stream closed without any completion signal: proxy// timeout, upstream cut). Lets the chat layer explain an empty reply// instead of rendering silent dead air.finishReason?: string- // Server-reported generation metrics (Bug M v2.4.7 — Ollama only). Released+ // Server-reported generation metrics (Bug M v2.4.7, Ollama only). Released// in the final done:true chunk. Authoritative tok/s = evalCount /// (evalDurationMs / 1000). Prefer these over client-side JS timing whenever// available, because WebView2 release-mode often buffers the response and@@ -318,7 +316,7 @@ export class ProviderError extends Error {/*** Provider-specific extra context. Used by UI catch sites to update the* model-health store (Ollama missing-blob / stale-manifest) without importing- * zustand from inside the provider — keeps the API layer decoupled from app+ * zustand from inside the provider, keeps the API layer decoupled from app* state. See lib/sync-ollama-health.ts.*/readonly model?: stringdiff --git a/src/components/chat/AgentPanel.tsx b/src/components/chat/AgentPanel.tsxindex 4b6e55f1..c2f9132a 100644--- a/src/components/chat/AgentPanel.tsx+++ b/src/components/chat/AgentPanel.tsx@@ -9,7 +9,7 @@ import { HINWEIS_TEXT } from '../../lib/hinweis'/*** Die rechte Spalte für Hintergrundagenten.*- * WANN SIE DA IST — die Entscheidung des Nutzers, wörtlich: das Panel ist+ * WANN SIE DA IST, die Entscheidung des Nutzers, wörtlich: das Panel ist* "nur für Hintergrund-Agenten". Ein gewöhnlicher Agentenlauf bekommt keins.* Es erscheint, sobald diese Konversation eine Hintergrundaufgabe hat, und* verschwindet wieder, wenn keine mehr da ist. Ein dauerhaft sichtbares@@ -17,7 +17,7 @@ import { HINWEIS_TEXT } from '../../lib/hinweis'* sagt und trotzdem Platz nimmt.** Der Preis dieser Entscheidung, offen benannt: wer nie delegiert, erfährt- * nie, dass es das gibt. Das ist hier richtig herum — die Fähigkeit gehört+ * nie, dass es das gibt. Das ist hier richtig herum, die Fähigkeit gehört* dem Modell, nicht dem Menschen; der Mensch will sie sehen, wenn sie* benutzt wird, und nicht als Angebot.*@@ -54,7 +54,7 @@ function TaskRow({ task, now }: { task: AgentTask; now: number }) {{fertig && task.status !== 'done' && ` · ${task.status}`}</div>{/* Nur waehrend es laeuft. Nach dem Ende ist "zuletzt read_file"- keine Auskunft mehr, sondern ein stehengebliebener Zeiger — das+ keine Auskunft mehr, sondern ein stehengebliebener Zeiger, dasERGEBNIS steht dann eine Zeile tiefer und ist das, was zaehlt. */}{task.status === 'running' && task.activity && (<div@@ -92,7 +92,7 @@ function TaskRow({ task, now }: { task: AgentTask; now: number }) {/*** B1 (3.0.1, Orchestrator-Entscheid): Unterhaltung wechseln beendet einen- * Hintergrundauftrag NICHT — der Kunde darf ihn bewusst weiterlaufen lassen.+ * Hintergrundauftrag NICHT, der Kunde darf ihn bewusst weiterlaufen lassen.* Aber wenn dieses Panel unten nur an `activeConversationId` haengt, zeigt es* beim Wechsel in eine andere Unterhaltung GAR NICHTS mehr, obwohl anderswo* noch etwas laeuft und Credits kostet. Diese Leiste ist die sichtbare@@ -144,7 +144,7 @@ export function AgentPanel() {const setWidth = useUIStore((s) => s.setAgentPanelWidth)const setCollapsed = useUIStore((s) => s.setAgentPanelCollapsed)- // Die Laufzeit tickt, solange etwas läuft — und NUR dann. Ein Intervall,+ // Die Laufzeit tickt, solange etwas läuft, und NUR dann. Ein Intervall,// das auch bei lauter fertigen Aufgaben weiterläuft, weckt die App jede// Sekunde für eine Zahl, die sich nicht mehr ändert.const laufend = (tasks ?? []).filter((t) => t.status === 'running').length@@ -162,13 +162,13 @@ export function AgentPanel() {// Ohne diese acht Zeilen war die ganze Funktion eine 28-Pixel-Leiste: das// Panel startet zugeklappt (`agentPanelCollapsed: true`, persistiert), und// nichts hat es je wieder geöffnet. Der Nutzer verlangte „auf und zu- // klappbar sobald aktiviert" — „sobald aktiviert" heißt: es zeigt sich,+ // klappbar sobald aktiviert", „sobald aktiviert" heißt: es zeigt sich,// wenn etwas losläuft.//// Nur bei einer Kennung, die dieses Panel noch nie gesehen hat, und nur// beim ERSTEN Mal je Konversation. Sonst risse es sich bei jeder der fünf// Aufgaben eines Fächers wieder auf, nachdem der Nutzer es weggeklappt hat- // — und eine Spalte, die gegen den Klick zurückkommt, ist schlimmer als+ //, und eine Spalte, die gegen den Klick zurückkommt, ist schlimmer als// eine, die nie erscheint.const gesehen = useRef<{ conv: string | null; ids: Set<string> }>({ conv: null, ids: new Set() })useEffect(() => {@@ -215,7 +215,7 @@ export function AgentPanel() {<span className="t-mono">{anderswoLaufend}</span></button>)}- {/* Auch zugeklappt muss "es läuft etwas" sichtbar bleiben — sonst+ {/* Auch zugeklappt muss "es läuft etwas" sichtbar bleiben, sonstversteckt ein Klick die einzige Spur eines Agenten, der geradeWerkzeuge auf der Maschine des Nutzers fährt. */}{laufend > 0 && (@@ -231,7 +231,7 @@ export function AgentPanel() {)}{/* Ein GESCHEITERTER Agent hinterließ auf der Leiste gar nichts: derZähler oben zählt nur laufende. Wer das Panel weggeklappt hatte,- erfuhr nie, dass eine Aufgabe fehlgeschlagen ist — die Arbeit war+ erfuhr nie, dass eine Aufgabe fehlgeschlagen ist, die Arbeit wargetan, das Ergebnis war ein Fehler, und niemand sah ihn. */}{gescheitert > 0 && (<buttondiff --git a/src/components/chat/__tests__/agent-panel-elsewhere.test.tsx b/src/components/chat/__tests__/agent-panel-elsewhere.test.tsxindex 5e2cb554..18139fc5 100644--- a/src/components/chat/__tests__/agent-panel-elsewhere.test.tsx+++ b/src/components/chat/__tests__/agent-panel-elsewhere.test.tsx@@ -2,7 +2,7 @@/*** B1 (3.0.1, Orchestrator-Entscheid): "Unterhaltung wechseln beendet NICHT"* einen Hintergrundauftrag, der Kunde darf ihn bewusst weiterlaufen lassen.- * Vorher haengte das ganze Panel an `activeConversationId` — beim Wechsel in+ * Vorher haengte das ganze Panel an `activeConversationId`, beim Wechsel in* eine andere Unterhaltung verschwand jede Spur, obwohl anderswo noch etwas* lief und Credits kostete. Diese Tests fahren den echten agentTaskStore und* das echte AgentPanel, keine Attrappe.@@ -37,14 +37,14 @@ beforeEach(() => {useUIStore.getState().setAgentPanelCollapsed(false)})-describe('AgentPanel — background work in another chat stays visible', () => {+describe('AgentPanel: background work in another chat stays visible', () => {it('shows nothing when no conversation has a background task', () => {render(<AgentPanel />)expect(screen.queryByTestId('agent-panel')).toBeNull()expect(screen.queryByTestId('agent-panel-elsewhere-bar')).toBeNull()})- it('the active chat has none, but another chat is still running — the panel says so', () => {+ it('the active chat has none, but another chat is still running: the panel says so', () => {starte('t1', THERE)render(<AgentPanel />)expect(screen.getByTestId('agent-panel-elsewhere-bar')).toBeTruthy()diff --git a/src/components/models/ModelRowMarks.tsx b/src/components/models/ModelRowMarks.tsxindex dc1671ae..39699d3c 100644--- a/src/components/models/ModelRowMarks.tsx+++ b/src/components/models/ModelRowMarks.tsx@@ -29,8 +29,7 @@ export function ModelRowMarks({ model }: { model: { flash?: CloudModel['flash'];{model.unfiltered === 'full' && (// K12 (3.0.1): unbeantwortete Discord-Meldung, die Marke war nicht// auffindbar. Sie stand als reiner Fliesstext in derselben Groesse- // wie jede andere Kleinschrift der Zeile, ohne Icon, ohne Gewicht —- // im Sammelbild der Liste ging sie unter. Bleibt auf derselben+ // wie jede andere Kleinschrift der Zeile, ohne Icon, ohne Gewicht, // im Sammelbild der Liste ging sie unter. Bleibt auf derselben// Stufe der Typo-Leiter (t-micro setzt NUR die Groesse, siehe// index.css), bekommt aber ein Icon und Fettung dazu, beides// Tailwind-Utilities, die t-micro nicht ueberschreibt.diff --git a/src/components/models/ModelSelector.tsx b/src/components/models/ModelSelector.tsxindex c80b7a49..1ba2282c 100644--- a/src/components/models/ModelSelector.tsx+++ b/src/components/models/ModelSelector.tsx@@ -45,7 +45,7 @@ import type { CloudModel as CloudModelMarks } from '../../types/models'// ── Local-mode cloud discovery (2.5.8): an "LU Cloud" section at the list's// tail. Signed-in accounts show their real hosted chat models (the appMode// filter hides them from the selectable list); logged-out shows one generic-// row. Tapping any row opens the Cloud gate (login → plan → beta) — chat rows+// row. Tapping any row opens the Cloud gate (login → plan → beta), chat rows// skip the teaser sheet, the gate IS the pitch here. Hidden in cloud mode// (models are the real list there) and when the discovery layer is off. ──function CloudTeaserSection({ onOpen }: { onOpen: () => void }) {@@ -130,7 +130,7 @@ function CloudTeaserSection({ onOpen }: { onOpen: () => void }) {// True when `prev` already holds exactly the names in `next`. Lets the 1.5 s// loaded-state poll bail out of a state update (return the SAME Set ref) when// nothing changed, so React skips the re-render instead of reconciling the whole-// dropdown every tick — the common case once the user has stopped loading models+// dropdown every tick, the common case once the user has stopped loading models// (vedaiorobotics GH #70: "interface laggy, even when loading models").function sameStringSet(prev: Set<string>, next: string[]): boolean {if (prev.size !== next.length) return false@@ -138,12 +138,11 @@ function sameStringSet(prev: Set<string>, next: string[]): boolean {return true}-// ── Bug Q (v2.4.7 — wakeywakeynow GH #41) ─────────────────────+// ── Bug Q (v2.4.7, wakeywakeynow GH #41) ─────────────────────//// Symptom: user has LM Studio installed with models on disk, opens LU's// chat model picker, sees only Ollama models, no hint about LM Studio.-// Root cause: LM Studio's HTTP server doesn't auto-start with the app —-// the user has to click Developer → Start Server in LM Studio, OR run+// Root cause: LM Studio's HTTP server doesn't auto-start with the app, // the user has to click Developer → Start Server in LM Studio, OR run// `lms server start`. When the server is off, LU's OpenAI-compat probe// returns nothing and LM Studio is silently dropped from the dropdown.// v2.4.4 added a "Start LM Studio server" hint to onboarding, but the@@ -160,7 +159,7 @@ function sameStringSet(prev: Set<string>, next: string[]): boolean {* Antwort von `lmstudio_server_status`. Deckungsgleich mit der Rust-Seite* (`src-tauri/src/commands/install.rs:3379` baut genau diese fuenf Schluessel,* alle immer gesetzt). Exportiert, weil das Onboarding denselben Befehl ruft- * und dort ein `any` stand — eine Antwort, ein Typ.+ * und dort ein `any` stand, eine Antwort, ein Typ.*/export interface LmStudioServerStatus {running: boolean@@ -210,7 +209,7 @@ function LmStudioServerHint({ onStarted }: { onStarted: () => void }) {setStartError('')try {await backendCall('start_lmstudio_server')- // The CLI takes a second or two to bind 1234 — poll status+ // The CLI takes a second or two to bind 1234, poll status// briefly so the banner replaces itself with the models list// instead of leaving the spinner spinning forever.for (let i = 0; i < 8; i++) {@@ -234,7 +233,7 @@ function LmStudioServerHint({ onStarted }: { onStarted: () => void }) {} catch (e) {// Hier stand `catch (e: any)` mit `e?.message`. Das las genau EINE Sorte// Fehler: ein `Error`-Objekt. Tauris `invoke` lehnt aber mit einem STRING- // ab (die Rust-Seite gibt `Result<_, String>` zurueck) — im ausgelieferten+ // ab (die Rust-Seite gibt `Result<_, String>` zurueck), im ausgelieferten// Programm hatte `e.message` deshalb nie einen Wert, und der Grund des// Fehlschlags wurde jedes Mal durch das pauschale „Start failed" ersetzt.// `detailOf` ist die Stelle, an der dieses Projekt genau diese Frage schon@@ -313,10 +312,10 @@ function getProviderBadge(model: AIModel) {//// Users care more about model lineage than about which local backend// they're pointing at. "Qwen 3.6 27B" appears once under Qwen whether-// it came from Ollama or LM Studio — the per-row provider badge+// it came from Ollama or LM Studio, the per-row provider badge// (rendered below) keeps that detail visible.//-// Pure visual grouping — model name + provider still resolve chat+// Pure visual grouping, model name + provider still resolve chat// routing exactly as before.// Normalize a model name into a comparable base form:@@ -331,7 +330,7 @@ function normalizeModelName(name: string): string {.replace(/:.+$/, '') // strip :tag suffix}-// Ordered — first match wins. Prefixes/infixes on the normalized name.+// Ordered, first match wins. Prefixes/infixes on the normalized name.const FAMILY_MATCHERS: Array<{ family: string; test: RegExp }> = [{ family: 'Qwen', test: /^qwen|^qwq/ },{ family: 'Gemma', test: /^gemma/ },@@ -359,7 +358,7 @@ function getModelFamily(modelName: string): string {return 'Other'}-// Family display order — Qwen/Gemma/Llama surface first since they're+// Family display order, Qwen/Gemma/Llama surface first since they're// the most common local-chat picks; cloud-only families (Claude/GPT)// come after the local ones; 'Other' always last.const FAMILY_ORDER: string[] = [@@ -391,7 +390,7 @@ function groupByFamily(models: AIModel[]): { family: string; models: AIModel[] }}/**- * K6 (3.0.1): GitHub #132, AppImage/Ubuntu 24.04 — "it adds models and then+ * K6 (3.0.1): GitHub #132, AppImage/Ubuntu 24.04, "it adds models and then* breaks the selection field... it's fixed by restarting". Not reproduced in* this pass (no Linux box available, see proof doc), but a restart-only fix* for a component with no error boundary of its own is the exact signature@@ -409,7 +408,7 @@ function groupByFamily(models: AIModel[]): { family: string; models: AIModel[] }* regression test more than it needs to stay physically inline.** On success: real grouping, unchanged behaviour. On a throw: falls back to- * one flat, ungrouped list (still fully usable — every model is still there+ * one flat, ungrouped list (still fully usable, every model is still there* and still clickable) instead of letting the exception reach React and take* the whole chat view with it, and logs which models were in play so the* NEXT report carries a stack trace pointing at the real field instead of@@ -456,11 +455,11 @@ export function computeModelGroups(//// Extracted as pure module-level functions so the select-time auto-load// decision is unit-testable without rendering the whole hook-heavy-// component (no test harness exists for ModelSelector — it depends on+// component (no test harness exists for ModelSelector, it depends on// several zustand stores + the Tauri bridge)./**- * The identifier LM Studio's CLI/bridge uses for `model` — its `lmsKey`+ * The identifier LM Studio's CLI/bridge uses for `model`, its `lmsKey`* when present (the exact key the loaded-list reports), else the model name.* Centralised so the row toggle, the loaded check, and the select-time* auto-load all agree on one id.@@ -469,7 +468,7 @@ export function computeModelGroups(* provider-scoped form "openai::qwen2.5-0.5b-instruct@q4_k_m" (getProviderForModel* routes on that `openai::`), but the `lms` CLI and LM Studio's /api/v0/models use* the BARE key "qwen2.5-0.5b-instruct@q4_k_m". Passing the prefixed name to- * `lms load` matches nothing — pre-`-y` it dropped into the interactive picker and+ * `lms load` matches nothing, pre-`-y` it dropped into the interactive picker and* the command hung forever (stuck "loading…" spinner, no error); post-`-y` it* exits 1. The loaded-check `loaded.has(lmsIdOf(...))` also silently failed* (bare keys from the API vs. a prefixed id), so rows showed perpetually unloaded@@ -478,8 +477,8 @@ export function computeModelGroups(*/export function lmsIdOf(model: AIModel): string {// `lmsKey` steht auf keinem der vier Glieder von `AIModel`. Seit TS 4.9- // verengt `'lmsKey' in model` trotzdem — auf `AIModel & Record<'lmsKey',- // unknown>` —, und die `typeof`-Pruefung dahinter macht daraus `string`.+ // verengt `'lmsKey' in model` trotzdem, auf `AIModel & Record<'lmsKey',+ // unknown>`, , und die `typeof`-Pruefung dahinter macht daraus `string`.// Beide Zusicherungen waren also nur die Handarbeit, die der Compiler seither// selbst macht; die aeussere `as string` hat obendrein verdeckt, dass die// innere Pruefung ueberhaupt etwas garantiert.@@ -492,7 +491,7 @@ export function lmsIdOf(model: AIModel): string {/*** True when selecting `model` must auto-load it into LM Studio first: it's* an LM Studio model AND it isn't already in the loaded set. Non-LM-Studio- * models (Ollama, cloud) always return false — they activate immediately.+ * models (Ollama, cloud) always return false, they activate immediately.*/export function shouldAutoLoadForSelect(model: AIModel,@@ -509,12 +508,12 @@ export function shouldAutoLoadForSelect(** `lms load` WITHOUT `-c` pins the instance at LM Studio's small default* (4096 on current builds). That silently breaks tool use: the chat-tools- * system prompt + the 5 curated tool schemas — let alone the full agent- * catalog — overflow 4K, and LM Studio answers /v1/chat/completions with a+ * system prompt + the 5 curated tool schemas, let alone the full agent+ * catalog, overflow 4K, and LM Studio answers /v1/chat/completions with a* context-overflow error that surfaces as the opaque "LM Studio: Request* failed", with NO retry (it's a 4xx). Proven live 2026-06-12: gemma-3-4b* @4096 failed every chat-tools / agent turn; the identical turn @16384- * worked first try. So we always request a usable window — capped by the+ * worked first try. So we always request a usable window, capped by the* model's real max so we never ask for more than it supports (an 8K model* stays 8K). 16K is enough for the tool schemas + a real conversation while* keeping the KV-cache VRAM modest for the small local models LU targets.@@ -629,7 +628,7 @@ export interface ModelSelectorProps {* they do not support tools are left out of the list entirely rather than* offered with a warning icon (David 2026-07-25: "Modelle ohne Tool-Support* z.B. nicht im Code-Bereich anzeigen"). Local models stay listed on every- * surface — there the fallback XML path often still works, and when it does+ * surface, there the fallback XML path often still works, and when it does* not the run says so.*/surface?: 'chat' | 'code'@@ -644,18 +643,17 @@ export interface ModelSelectorProps {answeredBy?: string | null}-// `openUpward` flips the dropdown to open above the trigger, right-aligned —-// used when the picker lives in the composer action bar (bottom of the screen)+// `openUpward` flips the dropdown to open above the trigger, right-aligned, // used when the picker lives in the composer action bar (bottom of the screen)// instead of the header. Header usage keeps the default downward/centered menu.export function ModelSelector({ openUpward = false, surface = 'chat', answeredBy = null }: ModelSelectorProps = {}) {const { models, activeModel, setActiveModel, fetchModels } = useModels()const isModelLoading = useModelStore((s) => s.isModelLoading)- // Welle 3, Listen-Ladezustand 3 von 4 — und der einzige, den es vorher gar+ // Welle 3, Listen-Ladezustand 3 von 4, und der einzige, den es vorher gar// nicht gab. `inventoryLoaded` ist die Frage „ist ueberhaupt schon einmal// eine Modellliste hier gelandet"; sie steht seit dem Zaehler-Nachschlag// (2026-08-29) im Store, aus genau demselben Grund: bis dahin darf man// keine Zahl und keine Leermeldung zeigen, sondern nur eine Ladeanzeige.- // Ohne sie ging der Waehler direkt von leer auf Liste — und „leer" rendert+ // Ohne sie ging der Waehler direkt von leer auf Liste, und „leer" rendert// hier als „No models available", also als Aussage ueber die Maschine// statt ueber den Ladezustand.const inventoryLoaded = useModelStore((s) => s.inventoryLoaded)@@ -675,7 +673,7 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredByconst textModelsEmptyRef = useRef(true)const [unloading, setUnloading] = useState(false)const [unloadDone, setUnloadDone] = useState(false)- // B3 — per-model LM Studio load/unload state. `lmsLoaded` is the set+ // B3, per-model LM Studio load/unload state. `lmsLoaded` is the set// of LM Studio model identifiers currently loaded in the server;// `togglingLms` is the one we're flipping right now (drives the// spinner on the row). LM Studio's HTTP server doesn't have load /@@ -683,7 +681,7 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredBy// bridge's `lmstudio_load_model` / `lmstudio_unload_model` commands.const [lmsLoaded, setLmsLoaded] = useState<Set<string>>(new Set())const [togglingLms, setTogglingLms] = useState<string | null>(null)- // B3/§18 — the LM Studio model we're auto-loading as part of *selecting* it+ // B3/§18, the LM Studio model we're auto-loading as part of *selecting* it// (distinct from `togglingLms`, the explicit power-button flow). Drives the// inline "loading…" state on the row and blocks a second click.const [selectingLms, setSelectingLms] = useState<string | null>(null)@@ -706,7 +704,7 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredBy*/const [imWechselZu, setImWechselZu] = useState<string | null>(null)const [selectError, setSelectError] = useState<string | null>(null)- // VRAM load state for Ollama rows — parity with `lmsLoaded` above, so+ // VRAM load state for Ollama rows, parity with `lmsLoaded` above, so// every LOCAL model shows a clear on/off load toggle (not just LM Studio).// Sourced from /api/ps on dropdown open.const [ollamaLoaded, setOllamaLoaded] = useState<Set<string>>(new Set())@@ -732,15 +730,15 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredBy// Keep the per-row On/Off LOAD state LIVE while the dropdown is open// (David 2026-06-12: "on und offload button sehr delayed und nicht immer- // akkurat — gemma4b ist geladen laut ollama aber in LU steht off"). The old+ // akkurat, gemma4b ist geladen laut ollama aber in LU steht off"). The old// code fetched the loaded set ONCE on open, so a model that loaded after the- // open — or a slow/transiently-failed first fetch — showed the wrong state+ // open, or a slow/transiently-failed first fetch, showed the wrong state// until the user reopened. Now: fetch immediately, then poll /api/ps + LM// Studio every 1.5 s so the toggle self-corrects within a beat. Both calls are// cheap loopback requests; we only poll while the panel is actually open.useEffect(() => {if (!open) return- setSelectError(null) // fresh open — drop any stale auto-load error+ setSelectError(null) // fresh open, drop any stale auto-load errorlet cancelled = falselet timer: ReturnType<typeof setTimeout> | undefined// Consecutive failed probes. A backend that answers keeps the brisk 1.5 s@@ -752,18 +750,18 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredBylet misses = 0const refresh = async () => {- // Skip the tick entirely while the window is hidden/minimized — there's+ // Skip the tick entirely while the window is hidden/minimized, there's// nothing to repaint and we re-sync the moment it's visible again. Stops a// backgrounded app from hitting Ollama / LM Studio every 1.5 s (#70).if (typeof document !== 'undefined' && document.hidden) return// Only probe LM Studio's loaded-state when LM Studio models are actually// listed. When its server is down there are NO LM Studio rows, so this- // skips the probe entirely — removing the last frontend reason the+ // skips the probe entirely, removing the last frontend reason the// dropdown ever stalled on a down LM Studio (the Rust side is now async +// port-pre-checked too). Ollama's /api/ps is a cheap loopback call and// always runs.// `providerName` steht auf ALLEN vier Gliedern von `AIModel` (auf dreien- // optional, auf `CloudModel` verpflichtend) — der `in`-Test und die+ // optional, auf `CloudModel` verpflichtend), der `in`-Test und die// Zusicherung waren beide ueberfluessig. `m.providerName` ist von sich aus// `string | undefined`, also genau das, was `isLmStudioProvider` nimmt.const hasLmsRows = useModelStore.getState().models.some((m) =>@@ -867,17 +865,16 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredBy}/**- * §18 — Select a model, auto-loading it into LM Studio first when needed.+ * §18, Select a model, auto-loading it into LM Studio first when needed.** Routing (getProviderForModel) keys only on the `openai::` prefix, so an* LM Studio model's HTTP requests go out regardless of whether the model- * is actually loaded in the server — picking an UNloaded one used to fail+ * is actually loaded in the server, picking an UNloaded one used to fail* silently at the HTTP layer (404 from LM Studio). So: if the picked row is* an LM Studio model that isn't loaded, load it (await) BEFORE activating,* showing an inline "loading…" state; only then setActiveModel + close. On* load failure we keep the dropdown open and surface the error instead of- * activating a model that can't answer. Non-LM-Studio rows are unaffected —- * they activate immediately exactly as before.+ * activating a model that can't answer. Non-LM-Studio rows are unaffected, * they activate immediately exactly as before.*/const handleSelectModel = async (model: AIModel) => {const id = lmsIdOf(model)@@ -1164,15 +1161,15 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredBy// model id, not just the `provider::model` prefix `displayModelName`// already stripped. An Ollama tag ("llama3.1:8b-instruct-q4_K_M") uses// a single colon as its OWN separator, so the header showed only- // "llama3.1" while the dropdown row below it — which never split on- // ':' — showed the real, full name. Dropped the split entirely so the+ // "llama3.1" while the dropdown row below it, which never split on+ // ':', showed the real, full name. Dropped the split entirely so the// header matches the row (both go through shortModelLabel only).shortModelLabel(displayModelName(gezeigtesModell)): 'Select Model'// Der Punkt folgt demselben Modell wie der Name daneben, sonst haette der// Knopf waehrend eines Wechsels zwei Aussagen in sich.const activeType = gezeigtesObj?.type || 'text'- // Chat dropdown shows TEXT models only — image/video live in the+ // Chat dropdown shows TEXT models only, image/video live in the// Create view's own picker. Everything here is grouped by the model// FAMILY (Qwen/Gemma/Llama/…), not by provider, because users pick// models by lineage first and the backend that serves them is a@@ -1236,7 +1233,7 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredBy// Laedt gerade ein Modell: `aria-busy` statt eines eigenen blauen// Rezepts mit Leuchtschatten. Das Rezept faerbt die Kante mit dem// Akzent, die Aussage steht damit im selben Vokabular wie der Rest- // der Leiste — und im Accessibility-Baum, wo sie hingehoert.+ // der Leiste, und im Accessibility-Baum, wo sie hingehoert.aria-busy={wechselLaeuft}className="lu-control">@@ -1245,7 +1242,7 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredByactiveType === 'text' ? 'bg-blue-400' : activeType === 'image' ? 'bg-purple-400' : 'bg-emerald-400'} ${wechselLaeuft ? 'animate-pulse' : ''}`} />- {/* Model name. Keine eigene Textfarbe mehr — sie wird vom Control+ {/* Model name. Keine eigene Textfarbe mehr, sie wird vom Controlgeerbt, sonst haette der Knopf zwei Graustufen in sich. */}<span className="max-w-[140px] truncate leading-none">{activeDisplayName}@@ -1284,7 +1281,7 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredByexit={{ opacity: 0, y: openUpward ? 6 : -6, scale: 0.98 }}transition={{ duration: MOTION_S.fast, ease: 'easeOut' }}>- {/* Bug Q v2.4.7 — surface "Start LM Studio Server" inline when+ {/* Bug Q v2.4.7, surface "Start LM Studio Server" inline whenLM Studio is on disk but its server is off. wakeywakeynow's"can't choose any models i have installed" symptom. */}<LmStudioServerHint onStarted={fetchModels} />@@ -1300,7 +1297,7 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredBy{/* K6: grouping threw and was caught above instead of crashing thewhole chat view. Says so, in the dropdown itself, with a way- to try again — the fallback list below still works, this is+ to try again, the fallback list below still works, this isjust honesty about why it looks flat. */}{groupingFailed && (<div className={`px-2.5 py-1.5 border-b border-black/5 dark:border-white/[0.06] text-[0.55rem] ${HINWEIS_TEXT.ruhig} flex items-center justify-between gap-2`}>@@ -1338,7 +1335,7 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredBy</div>)}- {/* §18 — surfaced when an LM Studio auto-load (on select) failed,+ {/* §18, surfaced when an LM Studio auto-load (on select) failed,so the user isn't left wondering why the model didn't switch. */}{selectError && (<div@@ -1502,7 +1499,7 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredBy{providerBadge.label}</span>)}- {/* 2.5.8 — tool-calling capability at a glance. Text+ {/* 2.5.8, tool-calling capability at a glance. Textmodels only.David 2026-08-06: "wieso ist es nicht toolfähig?@@ -1554,7 +1551,7 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredBy</span>)})()}- {/* §18 — inline load state while we auto-load this+ {/* §18, inline load state while we auto-load thisLM Studio model on the way to selecting it. */}{isSelectingThis && (<span className="inline-flex items-center gap-0.5 text-[0.5rem] text-blue-400">@@ -1567,7 +1564,7 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredBy{/* Details on right */}<div className="flex items-center gap-1 shrink-0">{/* `type === 'text'` verengt auf OllamaModel | CloudModel,- `'details' in model` von dort auf OllamaModel — und+ `'details' in model` von dort auf OllamaModel, undnur das hat `details`. Der Zugriff braucht deshalbkeine Zusicherung; `parameter_size` ist dort als`string` deklariert (types/models.ts:15). */}@@ -1576,7 +1573,7 @@ export function ModelSelector({ openUpward = false, surface = 'chat', answeredBy{model.details.parameter_size}</span>)}- {/* On/Off VRAM load toggle for LOCAL models — LM Studio+ {/* On/Off VRAM load toggle for LOCAL models, LM StudioAND Ollama both get it now (was LM-Studio-only). Theold active-row checkmark is gone; the active model isshown by the row highlight, and the dropdown shows adiff --git a/src/components/models/__tests__/compute-model-groups-k6.test.ts b/src/components/models/__tests__/compute-model-groups-k6.test.tsindex 7f931a99..2d75b826 100644--- a/src/components/models/__tests__/compute-model-groups-k6.test.ts+++ b/src/components/models/__tests__/compute-model-groups-k6.test.ts@@ -1,5 +1,5 @@/**- * K6 (3.0.1): GitHub locally-uncensored #132, AppImage/Ubuntu 24.04 —+ * K6 (3.0.1): GitHub locally-uncensored #132, AppImage/Ubuntu 24.04,* "closing... it looks like it adds models and then breaks the selection* field... it's fixed by restarting". A restart-only fix for a component with* no error boundary of its own is the signature of an uncaught render throw:@@ -21,11 +21,11 @@ vi.mock('../../../lib/logger', () => ({}))// A deterministic stand-in for "something in the real grouping pipeline-// threw" — the point of this test is the try/catch in computeModelGroups+// threw", the point of this test is the try/catch in computeModelGroups// itself, not any particular crash in splitBackendSwitchRows (which is// defensively written elsewhere in this codebase; the mock proves the SAFETY// NET works regardless of whether today's helper code happens to have a-// hole tomorrow — a freshly downloaded, not-yet-fully-normalized model entry+// hole tomorrow, a freshly downloaded, not-yet-fully-normalized model entry// is exactly the kind of value that could reach it).let throwOnSplit = falsevi.mock('../../../lib/lu-engine-rows', async (importOriginal) => {@@ -49,7 +49,7 @@ function textModel(name: string): AIModel {} as AIModel}-describe('K6 — computeModelGroups never crashes the picker', () => {+describe('K6: computeModelGroups never crashes the picker', () => {beforeEach(() => { vi.clearAllMocks(); throwOnSplit = false })it('groups normally when nothing throws', () => {@@ -66,7 +66,7 @@ describe('K6 — computeModelGroups never crashes the picker', () => {const { groups, groupingFailed, showHeadings } = computeModelGroups(models, false, null, null)expect(groupingFailed).toBe(true)expect(showHeadings).toBe(false)- // Nothing is lost — the fallback is flat, not empty. This is the+ // Nothing is lost, the fallback is flat, not empty. This is the// difference between "the picker looks a little plain" and "the picker// (and with it the whole chat view, see ChatView's ErrorBoundary) is// gone until the user restarts the app".diff --git a/src/components/models/__tests__/model-row-marks.test.tsx b/src/components/models/__tests__/model-row-marks.test.tsxindex c1b20a88..6690dd97 100644--- a/src/components/models/__tests__/model-row-marks.test.tsx+++ b/src/components/models/__tests__/model-row-marks.test.tsx@@ -33,8 +33,7 @@ describe('ModelRowMarks', () => {expect(screen.getByText('No refusals')).toBeTruthy()})- // K12 (3.0.1): the Discord report was "can't find it", not "it's wrong" —- // plain text at the smallest size on a crowded row, no icon at all. An+ // K12 (3.0.1): the Discord report was "can't find it", not "it's wrong", // plain text at the smallest size on a crowded row, no icon at all. An// icon is the cheapest signal that survives a quick scan of the list; the// text itself and the typography ladder step stay unchanged (see the// comment on the mark in ModelRowMarks.tsx).diff --git a/src/components/settings/ProviderConfig.tsx b/src/components/settings/ProviderConfig.tsxindex e3d416f4..bee6d256 100644--- a/src/components/settings/ProviderConfig.tsx+++ b/src/components/settings/ProviderConfig.tsx@@ -99,7 +99,7 @@ export function providerSlotView(id: ProviderId, config: ProviderConfig): SlotVi// server is not currently listening on :1234 (user closed the GUI, the// server toggle is off, etc.), the previous Settings UI offered only// `Test` and `Disable`. The clean Plug-and-Play path is to call the-// existing `start_lmstudio_server` Tauri command — same surface the+// existing `start_lmstudio_server` Tauri command, same surface the// onboarding's Fix-(d) card uses. This keeps the user inside LU instead// of forcing them through Re-run-onboarding to recover from a// transient server outage.@@ -123,7 +123,7 @@ export function ProviderSettings() {const [expandedProvider, setExpandedProvider] = useState<ProviderId | null>(null)- // Bug (g) state — LM-Studio-on-disk-but-server-off detection.+ // Bug (g) state, LM-Studio-on-disk-but-server-off detection.const [lmStudioInfo, setLmStudioInfo] = useState<LmStudioServerInfo | null>(null)const [startingLmStudioServer, setStartingLmStudioServer] = useState(false)@@ -132,7 +132,7 @@ export function ProviderSettings() {try {const status = await backendCall<LmStudioServerInfo>('lmstudio_server_status')setLmStudioInfo(status)- } catch { /* command unavailable on older builds — leave null */ }+ } catch { /* command unavailable on older builds, leave null */ }}// One status for one slot, and never a verdict nobody earned.@@ -318,8 +318,7 @@ export function ProviderSettings() {// switching to LM Studio/vLLM clears the built-in flag and re-selecting// Built-in restores it.// F3 (3.0.1, T4 Nebenfund): a real takeover must not leave the- // displaced backend's API key sitting in the shared slot's field —- // see takeoverClearsApiKey in lib/openai-slot-handover.ts. Checked+ // displaced backend's API key sitting in the shared slot's field, // see takeoverClearsApiKey in lib/openai-slot-handover.ts. Checked// against the same shape slotTakeoverUpdate itself reads below.if (takeoverClearsApiKey(providers.openai, {name: preset.name, baseUrl: preset.baseUrl, isLocal: preset.isLocal, managed: preset.managed,@@ -536,7 +535,7 @@ export function ProviderSettings() {{/* Expanded config */}{isExpanded && (<div className="px-2 pb-2 space-y-1.5 border-t border-white/[0.04]">- {/* Endpoint — an edit box only where editing it does something.+ {/* Endpoint, an edit box only where editing it does something.The built-in engine and LU Cloud both run on an address theapp pins, so they show it instead of pretending. */}{!view.endpointEditable ? (@@ -752,7 +751,7 @@ export function ProviderSettings() {</button>{/* Hellmodus-Luecke aus Welle 2, in f336b91e gemeldet stattgeaendert. Die Flaeche war `bg-[#363636]` OHNE `dark:`, blieb im- Hellmodus also dunkel — waehrend der Rescue-Layer in index.css+ Hellmodus also dunkel, waehrend der Rescue-Layer in index.cssdie Schrift darin nach unten dreht (`.light .text-gray-500 →#374151`). Ergebnis: #374151 auf #363636 = 1,17:1, praktischunsichtbar; jetzt 10,31:1. Kein zweites Literal, sonderndiff --git a/src/components/settings/SettingsPage.tsx b/src/components/settings/SettingsPage.tsxindex 70655fde..4d9bc31a 100644--- a/src/components/settings/SettingsPage.tsx+++ b/src/components/settings/SettingsPage.tsx@@ -161,7 +161,7 @@ function Section({ title, children, defaultOpen = false }: { title: string; chilclassName="w-full flex items-center justify-between py-2.5 group">{/* D-S28: zwoelfmal 11,96px/600 uppercase gray-500 war kein Rang,- sondern zwoelfmal dieselbe Betonung — und im Dunkelmodus mit+ sondern zwoelfmal dieselbe Betonung, und im Dunkelmodus mit3.37:1 (gray-500 #6b7280 auf #202020) unter WCAG AA. Der Kopf istjetzt eine echte Ueberschrift auf der Stufe darunter: 0.82rem =15,1px bei 18,4px Wurzelmass, Satzstellung statt Versalien,@@ -649,7 +649,7 @@ export function ImportLocalModels() {</button>{errors.scan && <div className="text-[0.6rem] text-red-400">{errors.scan}</div>}{/* Welle 3, Listen-Ladezustand 4 von 4: waehrend des Scans stand hier- nichts — der Knopf sagte „Scanning…" und darunter blieb es leer, bis+ nichts, der Knopf sagte „Scanning…" und darunter blieb es leer, bisdie Liste da war und den Rest der Sektion nach unten schob. DasSkelett haelt den Platz, den die Kandidatenzeilen einnehmen. */}{scanning && <ImportScanSkeleton />}@@ -691,18 +691,18 @@ export function ImportLocalModels() {/*** Antwort von `comfyui_status` (`src-tauri/src/commands/process.rs:1989`).*- * Der Typ stand als Ganzes schon da — als der inline notierte Zustandstyp von+ * Der Typ stand als Ganzes schon da, als der inline notierte Zustandstyp von* `useState` eine Zeile weiter unten. Nur der Weg dorthin trug `any`, und der* hat zwei Abweichungen zugedeckt, die beide nachgemessen sind:** 1. `path` ist auf der Rust-Seite `Option<String>`, kommt also als `null`- * an — nicht als `undefined`. Der Zustandstyp sagte `path?: string`; ein+ * an, nicht als `undefined`. Der Zustandstyp sagte `path?: string`; ein* `null` haette dort nie hineingedurft, und `any` hat es hineingelassen.* Beide Lesestellen (`status?.path || ''`) vertragen `null` ohnehin.* 2. Der Dev-Server, den der Browser-Modus statt Tauri anspricht, sendet von* den zehn Schluesseln nur sechs (`dev-server/comfy.ts:461`): `stalled`,* `complete`, `port`, `host` und `isLocal` fehlen dort. Deshalb sind sie- * hier optional — im Browser sind sie wirklich nicht da.+ * hier optional, im Browser sind sie wirklich nicht da.*/interface ComfyStatusResponse {running: boolean@@ -711,7 +711,7 @@ interface ComfyStatusResponse {starting?: booleanstalled?: booleancomplete?: boolean- /** `null`, solange kein Pfad gespeichert ist — auch bei `found: true`. */+ /** `null`, solange kein Pfad gespeichert ist, auch bei `found: true`. */path?: string | nullport?: numberhost?: string@@ -934,9 +934,9 @@ export function ComfyUISettings() {setStatus(prev => prev ? { ...prev, running: false } : null)} catch (e) {// Level (c): a stop that failed leaves the panel showing "running", which- // is the truth — but without this line the button reads as a dud. Same+ // is the truth, but without this line the button reads as a dud. Same// channel as the start failure, right under the same pair of buttons.- setStartError(withDetail('ComfyUI did not stop. It may still be running — try again, or close it in its own window.', e))+ setStartError(withDetail('ComfyUI did not stop. It may still be running, try again, or close it in its own window.', e))}}@@ -1130,7 +1130,7 @@ export function ComfyUISettings() {</button>)}{/* GH #98: a from-source install whose Python env broke (shared system- Python, dead torch) needs a rebuild, not a re-install — pip reports+ Python, dead torch) needs a rebuild, not a re-install, pip reportsbroken packages as already satisfied. Rebuilds ComfyUI/venv.Blau, weil es in dieser Knopfreihe noch frei war: Gruen gehoert@@ -1159,7 +1159,7 @@ export function ComfyUISettings() {)}{status?.found && status?.complete !== false && installIdle && (// 2.5.8: the specialized local lanes (music / talking character /- // motion) need node families that ship with current cores — this is+ // motion) need node families that ship with current cores, this is// the one-click git pull + dependency refresh the lane errors point// to. Reuses the installer's status channel and log panel.<button@@ -1322,7 +1322,7 @@ function CodexAgentSettings() {/></div>- {/* /loop — unlimited by default. The stop button and the loop bar above+ {/* /loop, unlimited by default. The stop button and the loop bar abovethe composer are the brake; a number here is only for people who wanta hard stop after N passes. */}<div className="pt-1.5 border-t border-white/[0.04]" />@@ -1403,7 +1403,7 @@ const SETTINGS_TABS: { id: SettingsTab; label: string; icon: ReactNode }[] = [{ id: 'voice-remote', label: 'Voice & Remote', icon: <Phone size={11} /> },]-// GitHub #59 — the old single "Reset to Defaults" button fired silently with+// GitHub #59, the old single "Reset to Defaults" button fired silently with// no confirm and no feedback, so users reported it as "does nothing". Now:// arm-then-confirm (second click within 4s), per-tab scope, and an explicit// success line after the reset.@@ -1423,8 +1423,7 @@ function ResetSection({ tab }: { tab: SettingsTab }) {const resetPermissions = usePermissionStore((s) => s.resetToDefaults)// The arm records the tab it was made on, so "still armed?" is a question// that can be answered while rendering. Switching tabs while armed must- // disarm — otherwise a click armed on General would confirm-fire on Agent —- // and armedScopeFor() is that rule (src/lib/reset-arming.ts). It replaces a+ // disarm, otherwise a click armed on General would confirm-fire on Agent, // and armedScopeFor() is that rule (src/lib/reset-arming.ts). It replaces a// `useEffect(..., [tab])` that disarmed one render too late.const [arm, setArm] = useState<ResetArm<SettingsTab>>(null)const armed = armedScopeFor(arm, tab)@@ -1472,11 +1471,11 @@ function ResetSection({ tab }: { tab: SettingsTab }) {return (<div className="pt-3 pb-6 space-y-2.5">- {/* D-S29: die beiden Reset-Aktionen sahen gleich aus — zwei graue+ {/* D-S29: die beiden Reset-Aktionen sahen gleich aus, zwei graueTextlinks nebeneinander, von denen einer sehr viel mehr loescht.Die gefaehrlichere traegt jetzt eine eigene Form (umrandeteGefahrfarbe statt Textlink), eine eigene Zeile und einen Satz, der- den Unterschied benennt — Text UND Kante durch WCAG, also auch+ den Unterschied benennt, Text UND Kante durch WCAG, also auch1.4.11 (3:1) fuer die Umrandung. Vorher stand "Reset all settings"im Dunkelmodus auf gray-600, war also ausgerechnet die unlesbarereder beiden.@@ -1484,7 +1483,7 @@ function ResetSection({ tab }: { tab: SettingsTab }) {ZWEITER DURCHGANG (01.09.2026), und er hat den Rest des Befundesumgedreht. Die Matrix fuehrte hier eine offene Luecke: „dertab-weite Reset-Link steht im Dunkelmodus weiter auf 3.37:1". Diese- Zahl war aus KLASSENNAMEN gerechnet — gray-500 #6b7280 auf einem+ Zahl war aus KLASSENNAMEN gerechnet, gray-500 #6b7280 auf einemangenommenen #202020. Im laufenden Fenster (Chromium, Farben ausgetComputedStyle, oklch ueber eine 1x1-Canvas aufgeloest) stehtnichts davon:@@ -1494,7 +1493,7 @@ function ResetSection({ tab }: { tab: SettingsTab }) {Ruhe hell gray-500 -> #374151 10.31:1 ✓ AADer Rescue-Layer (index.css:867/873) hebt `.dark .text-gray-500`- auf gray-400 und `.light .text-gray-500` auf gray-700 — die Luecke+ auf gray-400 und `.light .text-gray-500` auf gray-700, die Lueckewar zu, bevor dieser Durchgang begann.Was NICHT zu war und in keiner Zeile stand: der SCHARFE Zustand@@ -1513,7 +1512,7 @@ function ResetSection({ tab }: { tab: SettingsTab }) {Die Klassen dieses Knopfs sind woertlich gepinnt, und zwar in einerFREMDEN Datei: src/lib/__tests__/reset-arming-is-visible.test.ts.- Deren Farbzeile ist mitgezogen worden — bewusst, im Bericht+ Deren Farbzeile ist mitgezogen worden, bewusst, im Berichtbenannt, und mit demselben Biss wie vorher (voller Literalvergleichbeider Zweige). */}<button@@ -1555,7 +1554,7 @@ function ResetSection({ tab }: { tab: SettingsTab }) {export function SettingsPage() {const { settings, updateSettings } = useSettingsStore()- // ENG-2 — the expert panel only exists when the openai slot IS the+ // ENG-2, the expert panel only exists when the openai slot IS the// app-managed built-in engine (same gate as the send-path self-heal).const builtinManaged = useProviderStore((s) => !!s.providers.openai?.enabled && s.providers.openai?.managed === true)const { setView } = useUIStore()@@ -1577,7 +1576,7 @@ export function SettingsPage() {if (typeof window !== 'undefined') {// Level (a): silent on purpose. This only remembers which tab was open// for the next visit. If storage is full or blocked (private window),- // Settings opens on General next time — a convenience lost, not an+ // Settings opens on General next time, a convenience lost, not an// action failed, and nothing the user could act on.try { window.localStorage.setItem(SETTINGS_TAB_KEY, tab) } catch { /* see above */ }}@@ -1585,7 +1584,7 @@ export function SettingsPage() {// D-S27: die Bedingungen, unter denen einzelne Sektionen ueberhaupt- // erscheinen, stehen ab hier EINMAL — die Rail liest sie ueber+ // erscheinen, stehen ab hier EINMAL, die Rail liest sie ueber// sectionsFor(), das JSX weiter unten benutzt dieselben Ausdruecke.const sectionFlags: SettingsSectionFlags = {gpuPicker: !isMlxImageHost(),@@ -1598,18 +1597,18 @@ export function SettingsPage() {return (<div className="h-full overflow-y-auto scrollbar-thin">- {/* D-S27 / D-S48: vorher `max-w-lg mx-auto` — eine 552px-Spalte, die in+ {/* D-S27 / D-S48: vorher `max-w-lg mx-auto`, eine 552px-Spalte, die inder Fenstermitte schwebte und bei 1600px links und rechts je ~524pxLeere stehen liess. Die Zeilenlaenge war richtig, die Aufhaengungnicht. Jetzt: 200px-Rail links, Inhalt linksbuendig daneben, gedeckeltauf 640px (Soll des Audits). Die Rail erscheint ab `lg` (1024pxFensterbreite); darunter bleibt die waagerechte Tab-Leiste, weil200 + 640 in einem 900px-Fenster mit Sidebar nicht nebeneinander- passen — und bei 900px sah der Screen laut Audit ohnehin besser aus+ passen, und bei 900px sah der Screen laut Audit ohnehin besser ausals bei 1600px.D-S48, zweiter Durchgang: `justify-center`. Die Spaltenbreite bleibt- unangetastet — die Zeilenlaenge war laut Audit richtig, und ein+ unangetastet, die Zeilenlaenge war laut Audit richtig, und einInhalt, der mit dem Fenster mitwaechst, waere ein anderer, nichtbehobener Befund. Falsch war nur die VERTEILUNG des Rests: er standvollstaendig rechts. Gemessen im laufenden Fenster (Chromium,@@ -1622,11 +1621,11 @@ export function SettingsPage() {1920 px 36,8 / 871,2 454,0 / 454,0Zentriert wird das PAAR aus Rail und Inhalt, nicht der Inhalt- allein — sonst haenge die Spalte wieder frei in der Mitte, und+ allein, sonst haenge die Spalte wieder frei in der Mitte, undgenau das war D-S27. Sie haengt weiterhin an der Rail, das Paarsteht jetzt nur mittig im verfuegbaren Raum. Ueberlaufsicher: unter`lg` faellt die Rail auf `display:none` und der Inhalt hat- `min-w-0` — es bleibt kein freier Raum uebrig, den `justify-center`+ `min-w-0`, es bleibt kein freier Raum uebrig, den `justify-center`verteilen koennte, und die Zeile bricht nicht nach links aus. */}<div className="flex justify-center gap-6 px-4 py-4 lg:px-8"><nav@@ -1638,7 +1637,7 @@ export function SettingsPage() {<ArrowLeft size={16} /></button>{/* D-S28: die Spitze der Leiter. 1.15rem = 21,2px bei 18,4px- Wurzelmass — eine Stufe der 12/13/15/17/21/28-Skala des+ Wurzelmass, eine Stufe der 12/13/15/17/21/28-Skala desAudits, und endlich groesser als ein Sektionskopf. */}<h1 className="text-[1.15rem] font-semibold leading-tight text-gray-900 dark:text-gray-100">Settings</h1></div>@@ -1651,8 +1650,7 @@ export function SettingsPage() {Der ausgewaehlte Tab spricht jetzt die Zustandssprache:Akzentflaeche + Akzentkante links. Aktionen behalten dieneutrale graue Flaeche. Gerechnet: die Kante- #8b7cf0 auf Weiss 3.37:1 und #a094f8 auf #202020 6.27:1 —- beide ueber den 3:1 aus WCAG 1.4.11 fuer Nicht-Text. */}+ #8b7cf0 auf Weiss 3.37:1 und #a094f8 auf #202020 6.27:1, beide ueber den 3:1 aus WCAG 1.4.11 fuer Nicht-Text. */}<buttononClick={() => setTab(t.id)}aria-current={tab === t.id ? 'page' : undefined}@@ -1685,7 +1683,7 @@ export function SettingsPage() {</nav><div className="min-w-0 w-full max-w-[640px]">- {/* Header — nur unterhalb von `lg`; ab da traegt die Rail Titel und+ {/* Header, nur unterhalb von `lg`; ab da traegt die Rail Titel undZurueck-Knopf. */}<div className="lg:hidden flex items-center gap-2 mb-4"><button onClick={() => setView('chat')} className="p-1 rounded hover:bg-gray-200 dark:hover:bg-white/5 text-gray-500 hover:text-gray-900 dark:hover:text-white transition-colors">@@ -1696,7 +1694,7 @@ export function SettingsPage() {{/* P5: top-level tabs. Sticky so the user can switch tabs fromanywhere in a long Section without scrolling back up. Ab `lg`- uebernimmt die Rail diese Aufgabe — zwei gleichzeitig sichtbare+ uebernimmt die Rail diese Aufgabe, zwei gleichzeitig sichtbareNavigationen fuer dieselbe Sache waeren genau der Befund, denD-S27 beschreibt. */}<div className="lg:hidden sticky top-0 z-10 -mx-4 px-4 pb-2 mb-2 bg-white/80 dark:bg-[#202020]/80 backdrop-blur supports-[backdrop-filter]:bg-white/60 dark:supports-[backdrop-filter]:bg-[#202020]/60 border-b border-gray-100 dark:border-white/[0.06]">@@ -1774,8 +1772,8 @@ export function SettingsPage() {{/* D-S30, zweite Haelfte des Befundes: „Dark" (ein ZUSTAND) und„Upload" in AvatarSetting (eine AKTION) trugen beide`bg-gray-200 dark:bg-white/10`. Zustand spricht ab hier- ueberall dieselbe Sprache wie der aktive Tab — Akzentflaeche- mit Akzentkante — und die neutrale graue Flaeche bleibt den+ ueberall dieselbe Sprache wie der aktive Tab, Akzentflaeche+ mit Akzentkante, und die neutrale graue Flaeche bleibt denAktionen. */}<div className="flex items-center justify-between"><span className="text-[0.7rem] text-gray-700 dark:text-gray-400">Theme</span>@@ -1807,7 +1805,7 @@ export function SettingsPage() {<SliderControl label="Top K" value={settings.topK} min={1} max={100} step={1} onChange={(v) => updateSettings({ topK: v })} />{/* Die drei Zahlenzeilen dieser Sektion stehen auf der Leiter stattin eckigen Klammern (D-T04). Sie taten es nicht, und als 2.6.8- eine vierte dazukam, hat die Sperrklinke das gefangen — der+ eine vierte dazukam, hat die Sperrklinke das gefangen, derAusweg war nicht, den Deckel zu heben, sondern die Zeilen zustellen. `.t-micro` ist der schlichte Kleintext der Leiter,`.t-mono` ihr Rezept fuer eine Zahl (Ziffernbreite fest, damit@@ -1824,7 +1822,7 @@ export function SettingsPage() {className="w-20 px-1.5 py-0.5 rounded bg-transparent border border-white/8 t-mono text-right text-gray-300 focus:outline-none focus:border-white/20"/></div>- {/* Bug AA v2.5.0 — Ollama num_ctx override. 0 = use the provider+ {/* Bug AA v2.5.0, Ollama num_ctx override. 0 = use the providerdefault (Ollama default = 2048 on most builds, which silentlyclips RAG / long chats). Bump up to use the model's fullcontext window. Ignored by Anthropic / OpenAI providers. */}@@ -1845,8 +1843,8 @@ export function SettingsPage() {</div>{/* 2.6.8 auto-compact. Shown as a percentage and stored as afraction, because the threshold is compared against a ratio- (compact-trigger.ts). Same shape as the row above — a number- input whose 0 is the off state — rather than a slider, because+ (compact-trigger.ts). Same shape as the row above, a number+ input whose 0 is the off state, rather than a slider, becausea slider has no way to express "off" at all. */}<div className="flex items-center justify-between"><span@@ -1877,12 +1875,12 @@ export function SettingsPage() {</Section>- {/* Bug BB v2.5.0 — BobbyT GPU picker. Lazy-loads the GPU list when+ {/* Bug BB v2.5.0, BobbyT GPU picker. Lazy-loads the GPU list whenthe section opens via detect_gpus probe (nvidia-smi + rocm-smi +lspci/wmic). */}{/* Not on macOS: every knob in there is a no-op on Apple Silicon.The vendor picker forwards CUDA_VISIBLE_DEVICES / HIP_* /- ONEAPI_* to Ollama and ComfyUI — none of which exist here (Metal,+ ONEAPI_* to Ollama and ComfyUI, none of which exist here (Metal,unified memory, and ComfyUI never launches). Showing a deadNVIDIA/AMD/Intel selector is worse than showing nothing. */}{!isMlxImageHost() && (@@ -1891,7 +1889,7 @@ export function SettingsPage() {</Section>)}- {/* Feature CC v2.5.0 — MikeS++ chatbot export importer. Parses+ {/* Feature CC v2.5.0, MikeS++ chatbot export importer. ParsesChatGPT / Claude / Gemini export JSON (or .zip), pre-selectsevery conversation, feeds the chosen ones into the activechat's RAG store. */}@@ -1903,7 +1901,7 @@ export function SettingsPage() {<ChatBackupSettings /></Section>- {/* ComfyUI-only knobs — cloud renders use server-side limits, and the+ {/* ComfyUI-only knobs, cloud renders use server-side limits, and theMac's MLX pipeline has its own fixed timeout, so hide there too. */}{settings.appMode !== 'cloud' && !isMlxImageHost() && (<Section title="Image / Video Generation Timeouts">@@ -1941,7 +1939,7 @@ export function SettingsPage() {<Section title="Privacy">{settings.appMode === 'cloud' ? (- /* Cloud mode: the 100%-local pledge doesn't hold — say so+ /* Cloud mode: the 100%-local pledge doesn't hold, say sohonestly, mirroring the Speech section's cloud copy. */<div className="space-y-2 py-1 text-[0.65rem] text-gray-500 dark:text-gray-400 leading-relaxed"><div className="flex items-start gap-2">@@ -1992,8 +1990,7 @@ export function SettingsPage() {// The line above is what actually re-runs the wizard: AppShell// gates it on settings.onboardingDone, and that store is// persisted, so it survives the reload below. The backend call- // only clears the marker FILE, which is read in one place —- // the NSIS-update recovery in AppShell, and only when the+ // only clears the marker FILE, which is read in one place, // the NSIS-update recovery in AppShell, and only when the// store itself was lost.//// Level (a): silent on purpose. The visible action succeeds@@ -2053,7 +2050,7 @@ export function SettingsPage() {</Section>)}- {/* ComfyUI never runs on the Mac (MLX-only local media) — hide the whole+ {/* ComfyUI never runs on the Mac (MLX-only local media), hide the wholepanel there so it isn't a dead Install/Start surface. The Mac getsthe MLX installer in its place; without it a fresh Mac has no wayto set up local image/video at all (MAC-3). */}@@ -2118,8 +2115,7 @@ export function SettingsPage() {dort nicht. Der Gegenstand ist auch ein anderer: beim Hauptlaufsitzt der Nutzer davor und kann Stop druecken, ein Sub-Agentlaeuft ohne Zuschauer. Darum sind diese Zahlen klein und darum- heisst 0 hier "Vorgabe" und nicht "unbegrenzt" —- Unbegrenztheit soll man an einer unbeaufsichtigten Schleife+ heisst 0 hier "Vorgabe" und nicht "unbegrenzt", Unbegrenztheit soll man an einer unbeaufsichtigten Schleifenicht aus Versehen einstellen. */}<div className="flex items-center justify-between"><span@@ -2156,7 +2152,7 @@ export function SettingsPage() {/></div><div className="t-micro text-gray-500 dark:text-gray-500 leading-relaxed pt-0.5">- 0 = use the defaults (10 calls, 5 steps). A sub-agent runs unattended, so these stay deliberately tight — raise them only for a task you know is long.+ 0 = use the defaults (10 calls, 5 steps). A sub-agent runs unattended, so these stay deliberately tight, raise them only for a task you know is long.</div></Section>)}@@ -2235,7 +2231,7 @@ export function SettingsPage() {<Section title="Remote Access"><RemoteAccessSettings />- {/* §16 — real step-by-step docs (F5/X2 shipped only a 1-line+ {/* §16, real step-by-step docs (F5/X2 shipped only a 1-lineblurb). Collapsed by default so the settings stay compact. */}<Disclosure label="How it works"><RemoteAccessDocs />@@ -2288,7 +2284,7 @@ export function UpdateSection() {<span className="text-[0.65rem] text-gray-300 font-mono">v{currentVersion}</span></div>- {/* Latest version — only show if it's actually newer than current */}+ {/* Latest version, only show if it's actually newer than current */}{displayLatestVersion && (<div className="flex items-center justify-between"><span className="text-[0.65rem] text-gray-500">Latest Version</span>@@ -2422,7 +2418,7 @@ export function UpdateSection() {</div>)}- {/* Auto-download. Downloads only — installing always stays a click, so+ {/* Auto-download. Downloads only, installing always stays a click, sothe app never restarts under the user's hands. */}<label className="flex items-start justify-between gap-3 cursor-pointer"><span>@@ -2452,7 +2448,7 @@ export function UpdateSection() {)}-// ── B7 Troubleshoot section — one-shot diagnostic probe ───────+// ── B7 Troubleshoot section, one-shot diagnostic probe ───────export interface BackendProbe {status: 'ok' | 'unreachable' | 'not_installed' | 'error'@@ -2470,7 +2466,7 @@ interface SystemHealthReport {ram_gb: numberdisk_free_gb: number// §17: VRAM of the biggest NVIDIA GPU. null on non-NVIDIA boxes / when- // the nvidia-smi probe fails — rendered as "—".+ // the nvidia-smi probe fails, rendered as ", ".vram_total_gb: number | nullvram_free_gb: number | null}@@ -2503,16 +2499,16 @@ export function ProbeBadge({ probe, switchedOff }: { probe: BackendProbe; switcherror: 'Error',}// D1 (3.0.1): the probe itself only asks the fixed default address whether- // something answers there — it does not know, and cannot say, whether LU+ // something answers there, it does not know, and cannot say, whether LU// has this backend switched OFF in Settings. Reachable-but-off used to read// as plain "Reachable", telling a customer with Ollama installed but turned// off that it is in use when it plainly is not. This is the half of the fix// this file can make on its own: the word changes to name both facts at- // once. The other half — asking the CONFIGURED address instead of the- // hard-coded default — is Rust (health.rs) and stays open (see report).+ // once. The other half, asking the CONFIGURED address instead of the+ // hard-coded default, is Rust (health.rs) and stays open (see report).const label = probe.status === 'ok' && switchedOff ? `${labels.ok}, switched off` : labels[probe.status]// Emerald reads as "in use", which is exactly the wrong colour once the- // sentence itself says the opposite — the quiet grey used for the other+ // sentence itself says the opposite, the quiet grey used for the other// off states says so at a glance too.const color = probe.status === 'ok' && switchedOff ? RUHIG : colors[probe.status]return (@@ -2529,7 +2525,7 @@ function TroubleshootSection() {const [report, setReport] = useState<SystemHealthReport | null>(null)const [loading, setLoading] = useState(false)const [hinweis, setHinweis] = useState<TroubleshootHinweis | null>(null)- // D1 (3.0.1): the one fact the probe itself cannot know — see ProbeBadge.+ // D1 (3.0.1): the one fact the probe itself cannot know, see ProbeBadge.const ollamaEnabled = useProviderStore((s) => s.providers.ollama.enabled)const run = async () => {@@ -2572,7 +2568,7 @@ function TroubleshootSection() {</div>)}- {/* Audit #01 — where the log file is. Above the probe result because+ {/* Audit #01, where the log file is. Above the probe result because"send us the log" is the most common outcome of opening this panel. */}<LogFileSettings />diff --git a/src/components/settings/__tests__/probe-badge-switched-off.test.tsx b/src/components/settings/__tests__/probe-badge-switched-off.test.tsxindex cc789ed8..6e7300c9 100644--- a/src/components/settings/__tests__/probe-badge-switched-off.test.tsx+++ b/src/components/settings/__tests__/probe-badge-switched-off.test.tsx@@ -3,11 +3,11 @@* D1 (3.0.1): Troubleshoot showed "Reachable" for Ollama even with the* provider switched off in Settings, and (the other direction, T5) "Not* running" a moment after a real 200 answer. `health.rs:246` probes a fixed- * default address and knows nothing about the frontend's on/off switch — the+ * default address and knows nothing about the frontend's on/off switch, the* Rust half of the fix (ask the CONFIGURED address, `AppState::ollama_base`)* is out of scope for this repo/pass (no Rust here). This is the half TS can- * fix on its own: the badge now says BOTH facts when they disagree —- * reachable, but the user turned it off — instead of a plain "Reachable"+ * fix on its own: the badge now says BOTH facts when they disagree,+ * reachable, but the user turned it off, instead of a plain "Reachable"* that reads as "in use".** Run: npx vitest run src/components/settings/__tests__/probe-badge-switched-off.test.tsx@@ -18,7 +18,7 @@ import { ProbeBadge, type BackendProbe } from '../SettingsPage'const reachable: BackendProbe = { status: 'ok', detail: '', endpoint: 'http://127.0.0.1:11434' }-describe('D1 — ProbeBadge names both facts when they disagree', () => {+describe('D1: ProbeBadge names both facts when they disagree', () => {it('plain "Reachable" when the backend is on, same as before', () => {render(<ProbeBadge probe={reachable} switchedOff={false} />)expect(screen.getByText('Reachable')).toBeTruthy()@@ -30,7 +30,7 @@ describe('D1 — ProbeBadge names both facts when they disagree', () => {expect(screen.queryByText('Reachable')).toBeNull()})- it('switchedOff has no effect on a real "Not running" — never invents a sentence for a status that already says no', () => {+ it('switchedOff has no effect on a real "Not running": never invents a sentence for a status that already says no', () => {const unreachable: BackendProbe = { status: 'unreachable', detail: '', endpoint: 'http://127.0.0.1:11434' }render(<ProbeBadge probe={unreachable} switchedOff={true} />)expect(screen.getByText('Not running')).toBeTruthy()diff --git a/src/hooks/__tests__/signing-out-must-not-lie.test.ts b/src/hooks/__tests__/signing-out-must-not-lie.test.tsindex 4c978520..65844f65 100644--- a/src/hooks/__tests__/signing-out-must-not-lie.test.ts+++ b/src/hooks/__tests__/signing-out-must-not-lie.test.ts@@ -5,7 +5,7 @@* session survives (api/cloud/supabase.ts, "Signed out, but the saved session* could not be removed"). That throw was swallowed and the store was flipped* to signed-out regardless, so the app said "signed out" while a valid refresh- * token stayed in the OS vault — and the 5-minute probe signed the account+ * token stayed in the OS vault, and the 5-minute probe signed the account* back in. On a shared or handed-over machine that is the whole account.*/import { describe, it, expect, vi, beforeEach } from 'vitest'@@ -94,7 +94,7 @@ describe('a sign-out that did not happen', () => {describe('a failure that still emptied this machine', () => {it('completes the sign-out when the tombstone landed', async () => {// removeItem could not delete the entry but did overwrite it, so getItem- // reports the session as absent — this machine is clean.+ // reports the session as absent, this machine is clean.signOut.mockRejectedValue(new Error('Signed out, but the saved session could not be removed from the keychain.'))getSession.mockResolvedValue({ data: { session: null }, error: null })@@ -113,13 +113,13 @@ describe('a failure that still emptied this machine', () => {})})-describe('B1 Nachbesserung 1 (Opus-Review) — Abmelden stoppt Hintergrundagenten', () => {+describe('B1 Nachbesserung 1 (Opus-Review): Abmelden stoppt Hintergrundagenten', () => {/*** Vor dieser Nachbesserung liess signOutAccount() jeden laufenden- * delegate_task-Hintergrundagenten unangetastet — er feuerte nach dem+ * delegate_task-Hintergrundagenten unangetastet, er feuerte nach dem* Abmelden mit einem Konto weiter, das der Nutzer gerade verlassen hat.* `stopAllBackgroundWork()` laeuft ueber ALLE Konversationen, nicht nur die- * gerade sichtbare — Abmelden trifft die ganze Sitzung.+ * gerade sichtbare, Abmelden trifft die ganze Sitzung.*/it('a successful sign-out cancels every running background task, in any conversation', async () => {signOut.mockResolvedValue({ error: null })diff --git a/src/lib/__tests__/background-shutdown.test.ts b/src/lib/__tests__/background-shutdown.test.tsindex d00924b1..c2ecef52 100644--- a/src/lib/__tests__/background-shutdown.test.ts+++ b/src/lib/__tests__/background-shutdown.test.ts@@ -79,7 +79,7 @@ describe('stopAllBackgroundWork', () => {stopAllBackgroundWork()- // cancelAll only touches 'running' tasks — a done one keeps its own+ // cancelAll only touches 'running' tasks, a done one keeps its own// signal untouched, but the conversation is marked stopped regardless,// exactly like a Stop press after the work already finished.expect(c.signal.aborted).toBe(false)@@ -87,7 +87,7 @@ describe('stopAllBackgroundWork', () => {})})-describe('installBackgroundShutdown — App beenden (pagehide + beforeunload)', () => {+describe('installBackgroundShutdown: App beenden (pagehide + beforeunload)', () => {it('pagehide stops every running background task', () => {installBackgroundShutdown()const c = laufendeAufgabe('task-x', 'conv-1')@@ -98,7 +98,7 @@ describe('installBackgroundShutdown — App beenden (pagehide + beforeunload)',expect(isRunStopped('conv-1')).toBe(true)})- it('beforeunload stops every running background task too — the earlier of the pair', () => {+ it('beforeunload stops every running background task too: the earlier of the pair', () => {installBackgroundShutdown()const c = laufendeAufgabe('task-y', 'conv-1')@@ -108,7 +108,7 @@ describe('installBackgroundShutdown — App beenden (pagehide + beforeunload)',})})-describe('installBackgroundShutdown — Netzabbruch (offline)', () => {+describe('installBackgroundShutdown: Netzabbruch (offline)', () => {it('a dropped connection stops every running background task', () => {installBackgroundShutdown()const c = laufendeAufgabe('task-z', 'conv-1')@@ -120,15 +120,15 @@ describe('installBackgroundShutdown — Netzabbruch (offline)', () => {})})-describe('installBackgroundShutdown — Fenster schliessen (app:hidden, nicht onCloseRequested)', () => {+describe('installBackgroundShutdown: Fenster schliessen (app:hidden, nicht onCloseRequested)', () => {/*** main.rs intercepts CloseRequested with api.prevent_close() and hides to- * the tray — the window's X does not quit this app. A JS onCloseRequested+ * the tray, the window's X does not quit this app. A JS onCloseRequested* listener would fire on that exact same click and stop every background* agent on a plain tray-hide, which is not what "Fenster schliessen" as a* Stop trigger should mean here. main.rs already relays that moment to the* frontend as `app:hidden` (useVoice.ts listens to it for the identical- * reason — mic/playback must not keep running behind a hidden window), so+ * reason, mic/playback must not keep running behind a hidden window), so* this module reuses that signal instead of registering a second listener* for the same event.*/@@ -154,7 +154,7 @@ describe('installBackgroundShutdown — Fenster schliessen (app:hidden, nicht on})})-describe('installBackgroundShutdown — idempotent', () => {+describe('installBackgroundShutdown: idempotent', () => {it('installing twice wires only one set of window listeners', () => {const addSpy = vi.spyOn(window, 'addEventListener')installBackgroundShutdown()diff --git a/src/lib/__tests__/builtin-card-survives-add-provider.test.ts b/src/lib/__tests__/builtin-card-survives-add-provider.test.tsindex 83454bbf..3e323dd6 100644--- a/src/lib/__tests__/builtin-card-survives-add-provider.test.ts+++ b/src/lib/__tests__/builtin-card-survives-add-provider.test.ts@@ -243,7 +243,7 @@ describe('the wiring, so the rule reaches the screen', () => {})// Opus-Review Nachbesserung 6 (3.0.1, F3): Enable on the standby card used- // to come back with no key and a silent 401 — the slot's name/URL were+ // to come back with no key and a silent 401, the slot's name/URL were// restored through slotHandbackUpdate, but nothing ever restored the// parked backend's own apiKey. Every path that hands the slot to a// REMEMBERED backend must read `displaced.apiKey` and push it through@@ -255,7 +255,7 @@ describe('the wiring, so the rule reaches the screen', () => {expect(body).toMatch(/const parked = providers\.openai\.displaced\?\.apiKey/)expect(body).toMatch(/restoreParkedApiKey\(parked\)/)// Reads the parked value BEFORE overwriting `providers.openai` with the- // handback patch — read-after-write here would read the NEW (wrong) slot.+ // handback patch, read-after-write here would read the NEW (wrong) slot.expect(body.indexOf('const parked')).toBeLessThan(body.indexOf("setProviderConfig('openai', update)"))})diff --git a/src/lib/__tests__/model-label-colon.test.ts b/src/lib/__tests__/model-label-colon.test.tsindex d66b4c5b..2f9ed18c 100644--- a/src/lib/__tests__/model-label-colon.test.ts+++ b/src/lib/__tests__/model-label-colon.test.ts@@ -1,6 +1,6 @@/*** F3 (3.0.1, T4 Nebenfund): the chat model button showed only "Model: C" for- * a name that continues past a colon — ModelSelector.tsx applied+ * a name that continues past a colon, ModelSelector.tsx applied* `.split(':')[0]` on TOP of `displayModelName` (which already strips only* the `provider::model` prefix), so an Ollama tag like* "llama3.1:8b-instruct-q4_K_M" lost everything from its own colon onward.@@ -18,7 +18,7 @@ import { resolve } from 'node:path'import { shortModelLabel } from '../model-label'import { displayModelName } from '../../api/providers/model-name'-describe('F3 — the model header keeps everything after a colon', () => {+describe('F3: the model header keeps everything after a colon', () => {it('a plain Ollama tag survives whole', () => {const name = 'llama3.1:8b-instruct-q4_K_M'expect(shortModelLabel(displayModelName(name))).toBe('llama3.1:8b-instruct-q4_K_M')diff --git a/src/lib/__tests__/openai-slot-handover-api-key.test.ts b/src/lib/__tests__/openai-slot-handover-api-key.test.tsindex 319eec63..7b6d0fb9 100644--- a/src/lib/__tests__/openai-slot-handover-api-key.test.ts+++ b/src/lib/__tests__/openai-slot-handover-api-key.test.ts@@ -1,7 +1,7 @@/*** F3 (3.0.1, T4 Nebenfund): "a freshly added provider comes with a prefilled* value". Add Provider pushes a new backend into the shared `openai` slot via- * `slotTakeoverUpdate`, whose patch never mentions `apiKey` — the plain store+ * `slotTakeoverUpdate`, whose patch never mentions `apiKey`, the plain store* merge in ProviderConfig.tsx's setProviderConfig therefore left whatever key* the DISPLACED backend had sitting in the field, so a brand new custom* OpenAI-compatible provider showed (and would have submitted) a secret that@@ -16,8 +16,8 @@ const jan: HandoverSlot = {enabled: true, name: 'Jan', baseUrl: 'http://localhost:1337/v1', isLocal: true, managed: false,}-describe('F3 — a slot takeover clears the inherited API key', () => {- it('a genuinely different backend clears it — the old key belongs elsewhere', () => {+describe('F3: a slot takeover clears the inherited API key', () => {+ it('a genuinely different backend clears it: the old key belongs elsewhere', () => {const incoming = { name: 'My Server', baseUrl: 'http://localhost:5001/v1', isLocal: true, managed: false }expect(takeoverClearsApiKey(jan, incoming)).toBe(true)})@@ -42,14 +42,14 @@ describe('F3 — a slot takeover clears the inherited API key', () => {/*** Opus-Review Nachbesserung 6 (3.0.1, F3): closing the leak by clearing the- * key on takeover was only half the fix — the DISPLACED backend's own key+ * key on takeover was only half the fix, the DISPLACED backend's own key* has to survive somewhere, or handing the slot back later comes with no key* and a silent 401. `displaced.apiKey` is that somewhere; these tests pin the* pure carry-through (the actual restore into the store + keychain is* ProviderConfig.tsx's job, see das there and background-shutdown-adjacent* tests for the store-level partialize stripping).*/-describe('Nachbesserung 6 — the displaced backend keeps its own key', () => {+describe('Nachbesserung 6: the displaced backend keeps its own key', () => {it('a real takeover remembers the OUTGOING backend key in displaced.apiKey', () => {const janWithKey: HandoverSlot = { ...jan, apiKey: 'obf-jan-key' }const incoming = { name: 'My Server', baseUrl: 'http://localhost:5001/v1', isLocal: true, managed: false }@@ -70,7 +70,7 @@ describe('Nachbesserung 6 — the displaced backend keeps its own key', () => {displaced: { name: 'Built-in Engine', baseUrl: 'http://127.0.0.1:8127/v1', isLocal: true, managed: true, apiKey: 'obf-builtin-parked' },}const update = slotHandbackUpdate(slotWithDisplacedKey)- // The base patch itself never carries an apiKey field — ProviderConfig.tsx+ // The base patch itself never carries an apiKey field, ProviderConfig.tsx// reads the parked value straight off `providers.openai.displaced.apiKey`// BEFORE calling this, exactly so a plain merge of this patch cannot// corrupt the store's separately-obfuscated apiKey field (see thediff --git a/src/lib/__tests__/run-stop.test.ts b/src/lib/__tests__/run-stop.test.tsindex 854b09b2..1963e736 100644--- a/src/lib/__tests__/run-stop.test.ts+++ b/src/lib/__tests__/run-stop.test.ts@@ -1,10 +1,10 @@/**- * Audit M1 — Stop must end a /loop that a DIFFERENT hook instance started.+ * Audit M1, Stop must end a /loop that a DIFFERENT hook instance started.** The bug, exactly: the Code view and the chat view unmount on a tab switch. The* /loop driver lives in the `finally` of the pass, inside the closure of the* instance that started it. Stop set `userStoppedRef.current = true` on the- * REMOUNTED instance — a different ref object — so the old closure read `false`,+ * REMOUNTED instance, a different ref object, so the old closure read `false`,* scheduled the next pass, and the loop came back. The loop has no pass ceiling* by design ("there is NO built-in ceiling … the stop button is the brake"), so* that left an unattended agent with full shell and write access running with no@@ -39,7 +39,7 @@ function mountHook(conversationId: string) {}}-describe('run-stop — the stop outlives the hook instance', () => {+describe('run-stop: the stop outlives the hook instance', () => {beforeEach(() => { __resetRunStopsForTests() })it('a Stop pressed by a REMOUNTED instance ends the loop the old one is driving', () => {@@ -65,7 +65,7 @@ describe('run-stop — the stop outlives the hook instance', () => {expect(hook.wouldScheduleNextPass()).toBe(true)})- it('a /loop PASS does not clear it — Stop ends the loop, not just the pass', () => {+ it('a /loop PASS does not clear it: Stop ends the loop, not just the pass', () => {const conv = 'conv-c'beginRun(conv)stopRun(conv)@@ -90,7 +90,7 @@ describe('run-stop — the stop outlives the hook instance', () => {})})-describe('run-stop — both loop surfaces are wired to it', () => {+describe('run-stop: both loop surfaces are wired to it', () => {const codex = read('../../hooks/useCodex.ts')const agent = read('../../hooks/useAgentChat.ts')@@ -113,7 +113,7 @@ describe('run-stop — both loop surfaces are wired to it', () => {it('B1 (3.0.1): both stop buttons also cancel background delegate_task agents of the conversation', () => {// Before this fix, a `delegate_task background: true` run kept billing- // compute after Stop — the main answer ended, the sub-agent did not, and+ // compute after Stop, the main answer ended, the sub-agent did not, and// the Orchestrator's decision is that Stop means stop for both.for (const src of [codex, agent]) {expect(src).toContain('useAgentTaskStore.getState().cancelAll(stoppedConvId')diff --git a/src/lib/openai-slot-handover.ts b/src/lib/openai-slot-handover.tsindex 537d0b0f..8b6c3275 100644--- a/src/lib/openai-slot-handover.ts+++ b/src/lib/openai-slot-handover.ts@@ -64,7 +64,7 @@ export interface SlotOccupant {/*** Opus-Review Nachbesserung 6 (3.0.1, F3): carried through untouched, the* same obfuscated representation `ProviderConfig.apiKey` itself uses. This- * module never decodes it — it only moves the value between the slot and+ * module never decodes it, it only moves the value between the slot and* its `displaced` memory, so a takeover stops destroying the pushed-out* backend's key along with clearing the leak the original F3 fix closed.* See ProviderConfig.tsx's `applyPreset`/`handBackSlot` for the actual@@ -96,8 +96,8 @@ export function isDifferentBackend(slot: SlotOccupant, incoming: SlotOccupant):/*** F3 (3.0.1, T4 Nebenfund): "a freshly added provider comes with a prefilled- * value". `slotTakeoverUpdate`'s patch never mentions `apiKey` — it only- * decides `name`/`baseUrl`/`isLocal`/`managed`/`displaced` — so the plain+ * value". `slotTakeoverUpdate`'s patch never mentions `apiKey`, it only+ * decides `name`/`baseUrl`/`isLocal`/`managed`/`displaced`, so the plain* store merge in `setProviderConfig` left whatever key the DISPLACED backend* had sitting in the shared `openai` slot's `apiKey` field. The new* provider's key box then showed, and would have submitted, a secret thatdiff --git a/src/stores/__tests__/memory-markdown-roundtrip.test.ts b/src/stores/__tests__/memory-markdown-roundtrip.test.tsindex 0924cf7e..df772f08 100644--- a/src/stores/__tests__/memory-markdown-roundtrip.test.ts+++ b/src/stores/__tests__/memory-markdown-roundtrip.test.ts@@ -1,7 +1,7 @@/*** R2-25 (Logikkontrolle) / J (3.0.1-Liste): the Markdown export/import round- * trip lost everything past a memory's first line — the rest of a multi-line- * content, the source and the date — because the importer reads the export+ * trip lost everything past a memory's first line, the rest of a multi-line+ * content, the source and the date, because the importer reads the export* one physical line at a time and a real line break inside `entry.content`* split ONE list item across several lines. See the comment on* `escapeMdContent` in `../memoryStore.ts` for the full mechanism.@@ -19,7 +19,7 @@ function reset() {})}-describe('memory markdown round trip — multi-line content', () => {+describe('memory markdown round trip: multi-line content', () => {beforeEach(reset)it('a multi-line content survives export + import unchanged, with source and date', () => {@@ -42,7 +42,7 @@ describe('memory markdown round trip — multi-line content', () => {expect(back.content).toBe(multiline)expect(back.title).toBe('Mehrzeiliger Eintrag')expect(back.source).toBe('unit-test')- // The date round-trips too — a lost date falls back to "now" (today),+ // The date round-trips too, a lost date falls back to "now" (today),// which a same-day test cannot tell apart from a real bug. Assert the// export actually carries a source/date suffix on the item's own line// instead, which is the thing that was silently dropped before the fix.@@ -76,12 +76,12 @@ describe('memory markdown round trip — multi-line content', () => {/*** Opus-Review Nachbesserung 5: `\n` alone was not the whole data-loss class.* A JS regex's `.` refuses every LINE TERMINATOR the spec defines, not just- * `\n` — `\r`, U+2028 (LINE SEPARATOR) and U+2029 (PARAGRAPH SEPARATOR)+ * `\n`, `\r`, U+2028 (LINE SEPARATOR) and U+2029 (PARAGRAPH SEPARATOR)* silently dropped the entire entry the same way `\n` used to. This is the* property test the review asked for: round trip a list of hostile contents* and require content, source, date and title all identical afterward.*/-describe('memory markdown round trip — the whole data-loss class (Opus-Review Nachbesserung 5)', () => {+describe('memory markdown round trip: the whole data-loss class (Opus-Review Nachbesserung 5)', () => {beforeEach(reset)const HOSTILE_CONTENTS: Array<[string, string]> = [@@ -116,8 +116,7 @@ describe('memory markdown round trip — the whole data-loss class (Opus-Reviewexpect(after.content).toBe(before.content)expect(after.title).toBe(before.title)expect(after.source).toBe(before.source)- // The date round trips to DAY precision only (see isoTag/isoBack) —- // that is the export format, not a bug this test should flag.+ // The date round trips to DAY precision only (see isoTag/isoBack), // that is the export format, not a bug this test should flag.const beforeDay = new Date(before.updatedAt).toISOString().slice(0, 10)const afterDay = new Date(after.updatedAt).toISOString().slice(0, 10)expect(afterDay).toBe(beforeDay)@@ -125,7 +124,7 @@ describe('memory markdown round trip — the whole data-loss class (Opus-Review}})-describe('memory markdown import — Rueckwaertskompatibilitaet (Opus-Review Nachbesserung 5)', () => {+describe('memory markdown import: Rueckwaertskompatibilitaet (Opus-Review Nachbesserung 5)', () => {beforeEach(reset)it('an old export (no format marker) is read back without mutating a literal backslash-n', () => {@@ -141,7 +140,7 @@ describe('memory markdown import — Rueckwaertskompatibilitaet (Opus-Review Nacexpect(result.added).toBe(1)const back = useMemoryStore.getState().entries[0]// A real fix must not silently turn this file's literal backslash-n into- // a line break — that would be a silent mutation of a file nobody asked+ // a line break, that would be a silent mutation of a file nobody asked// to have rewritten, not a bug fix.expect(back.content).toBe('the path is C:\\nope\\here')})diff --git a/src/stores/__tests__/providerStore.keychain.test.ts b/src/stores/__tests__/providerStore.keychain.test.tsindex 29dff375..089673bd 100644--- a/src/stores/__tests__/providerStore.keychain.test.ts+++ b/src/stores/__tests__/providerStore.keychain.test.ts@@ -14,7 +14,7 @@ const { secretGet, secretSet, secretDelete } = vi.hoisted(() => ({secretDelete: vi.fn(),}))-// Audit W-T2: Pfadanpassung — clearProviderCache wohnt jetzt in+// Audit W-T2: Pfadanpassung, clearProviderCache wohnt jetzt in// providers/client-cache.ts (siehe dort). Gleiche Attrappe, gleicher Zweck.vi.mock('../../api/providers/client-cache', () => ({ clearProviderCache: vi.fn() }))vi.mock('../../api/backend', () => ({ secretGet, secretSet, secretDelete }))@@ -30,7 +30,7 @@ const obf = (k: string) => btoa(k.split('').reverse().join(''))// The default vitest env here is 'node' (no DOM). zustand persist reads// `window.localStorage` (createJSONStorage default), so install a Map-backed// store on BOTH `localStorage` and `window.localStorage` (same map) BEFORE the-// store module loads — otherwise persist silently no-ops and the localStorage+// store module loads, otherwise persist silently no-ops and the localStorage// assertions below pass trivially.function installLocalStorage() {const map = new Map<string, string>()@@ -124,7 +124,7 @@ describe('providerStore keychain (H5)', () => {it('does not revert concurrent provider changes made while hydrate awaits the vault', async () => {// Locked-keychain scenario: the first secret_get blocks (macOS unlock- // prompt) while the app keeps running — e.g. useCloudAuth enables the+ // prompt) while the app keeps running, e.g. useCloudAuth enables the// lu-cloud provider. The final set() must overlay only the vault-loaded// keys, never replace the providers map with a pre-await snapshot.let release!: (value: string | null) => void@@ -162,7 +162,7 @@ describe('providerStore keychain (H5)', () => {// Opus-Review Nachbesserung 6 (3.0.1, F3): a parked `displaced.apiKey` has// no vault entry of its own (the OS keychain holds one credential per// ProviderId, already spoken for by whichever backend is active), so it- // must never reach localStorage in the clear — on ANY platform, keychain+ // must never reach localStorage in the clear, on ANY platform, keychain// active or not, unlike the active `apiKey` field which at least gets the// localStorage fallback when the vault write fails.it('a parked displaced.apiKey never reaches persisted localStorage, keychain active', async () => {@@ -179,12 +179,12 @@ describe('providerStore keychain (H5)', () => {expect(raw).not.toContain('sk-parked-secret')expect(raw).not.toContain(obf('sk-parked-secret'))// The rest of the parked record (name/baseUrl/managed) is not a secret- // and still needs to survive a restart — only the key is stripped.+ // and still needs to survive a restart, only the key is stripped.expect(raw).toContain('Built-in Engine')})it('a parked displaced.apiKey never reaches persisted localStorage, no keychain on this platform either', async () => {- // Never probed / probe found nothing usable — keychainReady stays false,+ // Never probed / probe found nothing usable, keychainReady stays false,// the same path Linux and the web build take. The ACTIVE apiKey field// keeps its localStorage fallback here (unchanged behavior); the parked// one still must not, because there is no vault to have "failed" into.diff --git a/src/stores/memoryStore.ts b/src/stores/memoryStore.tsindex 4203b213..f322dbae 100644--- a/src/stores/memoryStore.ts+++ b/src/stores/memoryStore.ts@@ -21,12 +21,12 @@ const MEMORY_EMBED_MODEL = 'nomic-embed-text'// a fake (or a thrower, to exercise the offline fallback).type MemoryEmbedFn = (texts: string[]) => Promise<number[][]>let _embedFn: MemoryEmbedFn = (texts) => generateEmbeddings(texts, MEMORY_EMBED_MODEL)-/** Test hook — override the embedding function. Pass nothing to reset. */+/** Test hook, override the embedding function. Pass nothing to reset. */export function __setMemoryEmbedFn(fn?: MemoryEmbedFn): void {_embedFn = fn ?? ((texts) => generateEmbeddings(texts, MEMORY_EMBED_MODEL))}-// ── Content hashing (djb2 — same trick as embedding-router) ───────+// ── Content hashing (djb2, same trick as embedding-router) ───────// The text we embed is title + content; re-embed only when this hash changes.function embedText(m: Pick<MemoryFile, 'title' | 'content'>): string {return `${m.title}\n${m.content}`@@ -42,7 +42,7 @@ export interface MemoryInjectOpts {* Drop memories that are raw TOOL RESULTS (extracted from agent sessions as* "web_search result: web_search({...}) → …"). Injected into a PLAIN chat* they read as worked tool-call examples and prime the model to attempt a- * tool call it was never offered — gemma4 then spends the whole turn in its+ * tool call it was never offered, gemma4 then spends the whole turn in its* thinking channel deciding to "use the web_search tool", emits zero* content, and the user stares at a silent empty bubble (live find* 2026-06-11, David's no-answer report). Agent chats keep them: there the@@ -128,7 +128,7 @@ function hashContent(s: string): string {/*** Best-effort: embed a single memory and persist its vector to IndexedDB.- * Fire-and-forget — never throws (Ollama down, IDB missing in tests, etc.).+ * Fire-and-forget, never throws (Ollama down, IDB missing in tests, etc.).* Skips when the existing stored vector already matches the content hash.*/async function enqueueEmbedding(entry: Pick<MemoryFile, 'id' | 'title' | 'content'>): Promise<void> {@@ -155,7 +155,7 @@ async function enqueueEmbedding(entry: Pick<MemoryFile, 'id' | 'title' | 'conten}await saveVector(entry.id, record, isCurrent)} catch {- // Embedding is best-effort — retrieval falls back to keyword scoring.+ // Embedding is best-effort, retrieval falls back to keyword scoring.}}@@ -172,7 +172,7 @@ export function getMemoryBudget(contextTokens: number) {* Memory budget after applying the user's manual override. null / <=0 → the* context-tier budget unchanged. A positive override sets the injected count,* grows the token budget (~150 tok/memory, never below the tier's) so the extra- * entries actually fit, and allows all types — so the user isn't locked to+ * entries actually fit, and allows all types, so the user isn't locked to* "32k ctx = 15 memories" (David 2026-06-07). Exported for unit testing.*/export function effectiveMemoryBudget(contextTokens: number, override?: number | null): MemoryBudgetTier {@@ -258,7 +258,7 @@ const TYPE_ORDER: MemoryType[] = ['user', 'feedback', 'project', 'reference']* Hard ceiling for the injected memory block, in tokens (plan 2.6.6 A7).** The budget tiers hand out up to 4000 tokens of memory on a large-context- * model, and that block rides along in EVERY request of EVERY turn — it is+ * model, and that block rides along in EVERY request of EVERY turn, it is* paid for again on each step of an agent run, forever, whether or not a* single memory was relevant. 1k is the ceiling; a block that already fits* under it is injected in full and unchanged, so the cap only ever bites the@@ -270,7 +270,7 @@ export const MEMORY_CONTEXT_TOKEN_CAP = 1000* Render an ALREADY-ORDERED, ALREADY-FILTERED list of memories into the* grouped <remembered_context> block, respecting the tier's char budget and* sanitizing every injected line. Shared by the sync (keyword) and async- * (embedding-blended) retrieval paths — ONLY the candidate ordering differs+ * (embedding-blended) retrieval paths, ONLY the candidate ordering differs* between them, so the output formatting lives here once.** The A7 cap is applied HERE, at the one place the string is built, so every@@ -378,7 +378,7 @@ interface MemoryState {// WHY EVERY FIELD IS CHECKED HERE. A migration reads data an OLDER build of// this app wrote, and zustand gives it no second chance: a migrate that throws// lands in persist's `.catch`, hydration is abandoned, the store keeps its-// empty default — and the next write persists that empty list back over the+// empty default, and the next write persists that empty list back over the// stored blob. One entry the migration cannot read would take every memory// with it, permanently. So each entry is checked on its own and a broken one// is dropped alone.@@ -440,7 +440,7 @@ function migrateV1toV2(oldState: unknown): unknown {// ── Migration from v2 to v3 (Feature FF) ──────────────────────//// v3 adds OPTIONAL MemoryFile fields (supersededBy / supersedesId / stale /-// validFrom). Existing entries are already valid without them — this+// validFrom). Existing entries are already valid without them, this// migration is intentionally a near-identity that just guarantees the// `stale` flag is a concrete boolean (false) on every entry, so retrieval's// `isStale` and the "Show outdated" filter behave deterministically on@@ -515,7 +515,7 @@ function readAccountMemory(raw: unknown): MemoryFile {}/**- * The persist `migrate` hook. Exported so a test can drive it directly — the+ * The persist `migrate` hook. Exported so a test can drive it directly, the* persist internals are not reachable from vitest (same reason* migratePermissionState is exported).*/@@ -735,7 +735,7 @@ export const useMemoryStore = create<MemoryState>()(],lastSynced: Date.now(),}))- // Embed in the background — never blocks the synchronous add.+ // Embed in the background, never blocks the synchronous add.void enqueueEmbedding({ id, title: memory.title, content: trimmedContent })return id},@@ -847,7 +847,7 @@ export const useMemoryStore = create<MemoryState>()(// Embed the query, hydrate candidate vectors from IndexedDB, blend-score// (semantic + keyword + recency + type boost), then reuse the EXACT same// budget tiers / type filter / sanitization / grouped output as the sync- // path — only the candidate ORDERING changes. Wrapped so ANY failure+ // path, only the candidate ORDERING changes. Wrapped so ANY failure// (Ollama unreachable, nomic missing, IDB absent, dim mismatch) falls// back to the keyword result. Offline correctness invariant: this never// returns empty/incorrect when the sync path would have returned text.@@ -871,7 +871,7 @@ export const useMemoryStore = create<MemoryState>()(try {const budget = effectiveMemoryBudget(contextTokens, get().settings.maxMemoriesOverride)// No-op cases (no budget, no candidates, empty query) must return- // EXACTLY what the sync keyword path would — defer to fallback()+ // EXACTLY what the sync keyword path would, defer to fallback()// rather than re-deriving '' so behaviour stays identical (and so a// stubbed sync method in tests is honoured).if (budget.budgetTokens === 0 || budget.maxMemories === 0) return fallback()@@ -908,7 +908,7 @@ export const useMemoryStore = create<MemoryState>()(})// If NOT A SINGLE candidate has a usable vector, the blend reduces to- // keyword+recency with no semantic lift — the sync keyword path is+ // keyword+recency with no semantic lift, the sync keyword path is// the better-tested equivalent, so fall back to it.if (!blendCandidates.some(c => c.vector)) return fallback()@@ -916,7 +916,7 @@ export const useMemoryStore = create<MemoryState>()(const ordered = scored.slice(0, budget.maxMemories).map(s => s.memory)// An empty blend is a legitimate answer ("nothing here belongs to- // this question"), not a degenerate one — see MIN_RAW_SEMANTIC. We+ // this question"), not a degenerate one, see MIN_RAW_SEMANTIC. We// still ask the keyword path, because it is the second, independent// gate: it only returns entries that share a word with the query, so// it cannot re-admit what the blend just rejected as unrelated. What@@ -1019,7 +1019,7 @@ export const useMemoryStore = create<MemoryState>()(}}} catch {- // Best-effort backfill — ignore failures.+ // Best-effort backfill, ignore failures.}return embedded},@@ -1054,8 +1054,7 @@ export const useMemoryStore = create<MemoryState>()(md += `## ${typeTitles[type]}\n\n`for (const entry of typeEntries) {const date = isoTag(entry.updatedAt)- // R2-25: escaped so a multi-line entry stays ONE physical line —- // see escapeMdContent. The bracket-ending check below still reads+ // R2-25: escaped so a multi-line entry stays ONE physical line, // see escapeMdContent. The bracket-ending check below still reads// the RAW content: `\n`-escaping never adds or removes a// trailing `]`, and checking the escaped form would be the same// answer read through an extra step.@@ -1078,7 +1077,7 @@ export const useMemoryStore = create<MemoryState>()(// escaped `\n`/`\r`/backslash sequences that need undoing. An older// export (or a hand-written one) never escaped anything, so its// literal backslash-n is content, not a line break waiting to be- // restored — see MD_FORMAT_MARKER's comment.+ // restored, see MD_FORMAT_MARKER's comment.const escaped = MD_FORMAT_MARKER_RE.test(markdown)const lines = markdown.split('\n')const pool: MemoryFile[] = [...get().entries]@@ -1106,7 +1105,7 @@ export const useMemoryStore = create<MemoryState>()(// R2-25: undo escapeMdContent's `\n`/backslash escaping so a// multi-line memory comes back with its real line breaks instead// of the literal two-character escape. Only when the format- // marker says this file was escaped in the first place — see+ // marker says this file was escaped in the first place, see// MD_FORMAT_MARKER.const content = escaped ? unescapeMdContent(itemMatch[2].trim()) : itemMatch[2].trim()const tags = itemMatch[3] ? itemMatch[3].split(',').map(t => t.trim()).filter(Boolean) : []@@ -1157,8 +1156,7 @@ export const useMemoryStore = create<MemoryState>()(return { added: 0, updated: 0, alreadyPresent: 0 }}// Tolerant shape handling: accept LU's own {entries:[...]} export, a- // bare [...] array, or {memories:[...]} (konata-session 2026-06-07 —- // imports silently produced 0 entries on any other shape).+ // bare [...] array, or {memories:[...]} (konata-session 2026-06-07, // imports silently produced 0 entries on any other shape).const entriesField = prop(raw, 'entries')const memoriesField = prop(raw, 'memories')const arr: unknown[] = Array.isArray(raw) ? raw@@ -1178,7 +1176,7 @@ export const useMemoryStore = create<MemoryState>()(for (const e of arr) {const scope = prop(e, 'scope')if (scope !== undefined && (typeof scope !== 'string' || !scope.trim())) continue- // `content` may also arrive as `text` / `value` — a foreign export's+ // `content` may also arrive as `text` / `value`, a foreign export's// spelling. Only a real string counts: the old String(...) turned an// object into the literal "[object Object]" and imported that.const content = (asString(prop(e, 'content')) ?? asString(prop(e, 'text')) ?? asString(prop(e, 'value')) ?? '').trim()@@ -1291,11 +1289,11 @@ export const useMemoryStore = create<MemoryState>()({name: 'locally-uncensored-memory',// v3 (Feature FF): adds optional staleness/supersession fields to- // MemoryFile. They default to unset, so old entries remain valid — the+ // MemoryFile. They default to unset, so old entries remain valid, the// bump exists only to run migrateV2toV3 so the shape is explicit and// future migrations have a clean baseline.version: 3,- // IndexedDB (idbStorage) instead of localStorage — memories + their growth+ // IndexedDB (idbStorage) instead of localStorage, memories + their growth// shouldn't be capped at ~5 MB; idb is disk-backed and migrates existing// localStorage data on first read. createJSONStorage wrap still required// (zustand v5 PersistStorage; raw StateStorage → "[object Object]", FIX-3).diff --git a/src/stores/providerStore.ts b/src/stores/providerStore.tsindex 4c2fa6b0..2e7e3742 100644--- a/src/stores/providerStore.ts+++ b/src/stores/providerStore.ts@@ -1,5 +1,5 @@/**- * Provider Store — manages provider configurations.+ * Provider Store, manages provider configurations.** Stores endpoint URLs, API keys (encrypted), and enabled state.* Ollama is always enabled by default.@@ -64,10 +64,10 @@ const _keychainFailed = new Set<ProviderId>()// ── Default provider configs ───────────────────────────────────-// 2.5.7 — the default backend is now the app's built-in engine (bundled+// 2.5.7, the default backend is now the app's built-in engine (bundled// llama-server, managed lifecycle) so a fresh install can chat without// installing Ollama/LM Studio. It occupies the `openai` slot (OpenAI-compatible)-// with `managed: true`. Ollama/LM Studio stay available as "Advanced" — the user+// with `managed: true`. Ollama/LM Studio stay available as "Advanced", the user// can re-enable them from Settings → Providers. This default only applies to a// FRESH store; existing `lu-providers` persistence is untouched.const DEFAULT_PROVIDERS: Record<ProviderId, ProviderConfig> = {@@ -96,8 +96,7 @@ const DEFAULT_PROVIDERS: Record<ProviderId, ProviderConfig> = {apiKey: '',isLocal: false,},- // LU Cloud chat (lu-labs.ai inference proxy). apiKey stays empty forever —- // auth is the user's Supabase session token, injected per request by+ // LU Cloud chat (lu-labs.ai inference proxy). apiKey stays empty forever, // auth is the user's Supabase session token, injected per request by// LuCloudProvider. useCloudAuth flips `enabled` with the account state.'lu-cloud': {id: 'lu-cloud',@@ -222,7 +221,7 @@ export const useProviderStore = create<ProviderState>()(// When the OS vault is active, store the real key there; partialize then// keeps it out of localStorage. If the vault WRITE fails (locked / policy// / full), mark this id so partialize RETAINS the obfuscated key in- // localStorage — otherwise it would vanish on the next restart with no+ // localStorage, otherwise it would vanish on the next restart with no// trace (the in-memory value only serves this session).if (keychainReady) {_keychainFailed.delete(id)@@ -304,7 +303,7 @@ export const useProviderStore = create<ProviderState>()(} else {// Nothing in the vault yet. Migrate an existing localStorage key// (an upgrading user) into the vault, once. Read the CURRENT- // store value — a key set while an earlier secret_get awaited+ // store value, a key set while an earlier secret_get awaited// must not be missed.const existing = deobfuscate(get().providers[id]?.apiKey || '')if (existing) {@@ -315,7 +314,7 @@ export const useProviderStore = create<ProviderState>()(}} catch {if (usable === null) { usable = false; break } // no keychain here- // otherwise a transient per-key error — keep the others+ // otherwise a transient per-key error, keep the others}}if (!usable) return@@ -347,8 +346,7 @@ export const useProviderStore = create<ProviderState>()(// throws every configured backend away. Harmless today (no blob carries a// numeric version yet), fatal the day this store goes to 2.migrate: keepPersistedState,- // Blobs persisted before the lu-cloud provider existed lack its entry —- // backfill every missing provider from defaults so getProvider() can't+ // Blobs persisted before the lu-cloud provider existed lack its entry, // backfill every missing provider from defaults so getProvider() can't// hit an undefined config after an update.merge: (persisted: unknown, current: ProviderState): ProviderState => {const p = (persisted ?? {}) as Partial<ProviderState>@@ -401,11 +399,11 @@ export const useProviderStore = create<ProviderState>()(providers: Object.fromEntries(Object.entries(state.providers).map(([id, p]) => {// Strip the ACTIVE key (it lives in the vault) UNLESS the vault- // write failed for this id — then keep the obfuscated fallback.+ // write failed for this id, then keep the obfuscated fallback.const stripActive = keychainReady && !_keychainFailed.has(id as ProviderId)const withActive = stripActive ? { ...p, apiKey: '' } : p// Opus-Review Nachbesserung 6: a PARKED key on the `displaced`- // memory has no vault entry of its own — the OS keychain holds+ // memory has no vault entry of its own, the OS keychain holds// exactly one credential per ProviderId, already spoken for by// whichever backend is active. Persisting it in the clear would// put a secret into localStorage with none of the protection