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
tech(T-67/T-70): der Katalog gegen die Wirklichkeit — drei tote Adressen gefunden
Davidece5e9af19ed
diff --git a/src/api/__tests__/custom-node-cache-break.test.ts b/src/api/__tests__/custom-node-cache-break.test.tsnew file mode 100644index 00000000..2c0cc9b4--- /dev/null+++ b/src/api/__tests__/custom-node-cache-break.test.ts@@ -0,0 +1,212 @@+/**+ * T-67 · die Custom-Node-Installation leert den /object_info-Cache nicht.+ *+ * `getAllNodeInfo` haelt ComfyUIs vollstaendigen Knotenkatalog fuenf Minuten+ * im Speicher (comfyui-nodes.ts:60). Wer waehrend dieser fuenf Minuten ein+ * Knotenpaket installiert, aendert die Wirklichkeit, aber nicht die Antwort:+ * der Workflow-Bauer liest weiter den Katalog von vorher und raet dem Nutzer,+ * zu installieren, was er gerade installiert hat.+ *+ * Der Befund ist ein Fall des Musters, das dieses Projekt immer wieder trifft:+ * ZWEI PFADE, DIE DASSELBE TUN SOLLEN, UND NUR EINER WIRD GEPFLEGT. Es gab+ * `installCustomNodes` — und eine handkopierte Schleife in `installBundle`,+ * die dasselbe Backend-Kommando rief. Keiner der beiden brach den Cache; drei+ * Aufrufer im UI holten das per Hand nach, jeder auf seine Weise+ * (CreateContext.tsx:346 und :407, useCreate.ts:991), der vierte — der+ * Download-Pfad — gar nicht. Der Neustart der Kopie war ausserdem ein+ * stop / 2 s schlafen / start, das ein fremdes ComfyUI nicht erkennt.+ *+ * Zusammengefuehrt: `installCustomNodes` ist der eine Weg, bricht den Cache+ * selbst und faehrt den Neustart ueber `restartComfyForNewNodes`. Diese Tests+ * pinnen genau das.+ *+ * Der Cache hier ist der ECHTE aus comfyui-nodes.ts, nicht nachgebaut: die+ * Tests zaehlen, wie oft /object_info wirklich abgerufen wird. Ersetzt ist nur+ * die Tauri-Bruecke, die es im Node-Lauf ohnehin nicht gibt.+ *+ * Lauf: npx vitest run src/api/__tests__/custom-node-cache-break.test.ts+ */+import { describe, it, expect, vi, beforeEach, beforeAll } from 'vitest'+import type { ModelBundle } from '../discover'++const backendCall = vi.fn<(cmd: string, args?: unknown) => Promise<unknown>>()+const localFetch = vi.fn<(url: string, opts?: unknown) => Promise<Response>>()++vi.mock('../backend', () => ({+ backendCall: (...a: unknown[]) => backendCall(...(a as [string, unknown])),+ localFetch: (...a: unknown[]) => localFetch(...(a as [string, unknown])),+ comfyuiUrl: (p: string) => `http://localhost:8188${p}`,+ fetchExternal: vi.fn(),+ fetchLocalhostBytes: vi.fn(),+ isTauri: () => true,+}))++import { installCustomNodes, installBundleComplete } from '../discover'+import { getAllNodeInfo, clearNodeCache } from '../comfyui-nodes'++/** Wie oft der volle Knotenkatalog wirklich vom Server geholt wurde. */+let objectInfoAbrufe = 0+/** Wie oft jemand gefragt hat, ob auf dem Port noch etwas laeuft. Genau das+ * unterscheidet `restartComfyForNewNodes` von der Kopie, die es ersetzt hat:+ * die schlief zwei Sekunden und startete blind. */+let lebendfragen = 0++const KNOTEN = { VHS_VideoCombine: { input: { required: {} }, output: [] } }++beforeAll(() => {+ // installBundleComplete verkuendet seine Urteile auf window; der Node-Lauf+ // hat keins.+ ;(globalThis as unknown as { window: EventTarget }).window = new EventTarget()+})++beforeEach(() => {+ objectInfoAbrufe = 0+ lebendfragen = 0+ clearNodeCache()+ backendCall.mockReset().mockResolvedValue({ status: 'installed' })+ localFetch.mockReset().mockImplementation(async (url: string) => {+ if (url.endsWith('/object_info')) {+ objectInfoAbrufe+++ return new Response(JSON.stringify(KNOTEN), { status: 200 })+ }+ if (url.endsWith('/system_stats')) {+ lebendfragen+++ // Der Port ist still: LU hat sein eigenes ComfyUI beendet. Der Fall+ // "da antwortet ein fremdes ComfyUI" gehoert zu+ // `restartComfyForNewNodes` selbst und steht in comfy-restart.test.ts.+ return new Response('{}', { status: 503 })+ }+ return new Response('{}', { status: 200 })+ })+})++describe('T-67 · der Cache ueberlebt die Installation nicht', () => {+ it('der Cache ist echt: zweimal fragen holt einmal', async () => {+ // Ohne diese Zeile beweist der Test darunter nichts — ein Cache, der nie+ // greift, wird durch jeden "Bruch" scheinbar bestaetigt.+ await getAllNodeInfo()+ await getAllNodeInfo()+ expect(objectInfoAbrufe).toBe(1)+ })++ it('nach der Installation muss die Knotenliste neu geholt werden', async () => {+ await getAllNodeInfo()+ await getAllNodeInfo()+ expect(objectInfoAbrufe).toBe(1)++ await installCustomNodes(['videohelpersuite'])++ await getAllNodeInfo()+ expect(objectInfoAbrufe, 'die Installation hat den /object_info-Cache nicht gebrochen').toBe(2)+ })++ it('auch eine gescheiterte Installation bricht den Cache', async () => {+ // Ein Paket, dessen `pip install` auf halber Strecke stirbt, kann seine+ // Knoten trotzdem registriert haben — und ein Fehlschlag ist genau der+ // Moment, in dem niemand ans Aufraeumen denkt. Deshalb steht der Bruch in+ // einem `finally`.+ await getAllNodeInfo()+ expect(objectInfoAbrufe).toBe(1)++ backendCall.mockResolvedValue({ status: 'update_failed' })+ await expect(installCustomNodes(['videohelpersuite'])).rejects.toThrow(/update_failed/)++ await getAllNodeInfo()+ expect(objectInfoAbrufe).toBe(2)+ })++ it('ein unbekannter Schluessel aendert nichts und wirft nicht', async () => {+ await installCustomNodes(['gibt-es-nicht'])+ expect(backendCall).not.toHaveBeenCalled()+ })+})++describe('T-67 · der Bruch NACH dem Neustart ist der, auf den es ankommt', () => {+ it('was waehrend des Neustarts gelesen wurde, gilt danach nicht mehr', async () => {+ // Zwischen Klonen und Neustart sind die neuen Knoten noch nicht+ // registriert. Fragt in diesem Fenster jemand — der Model Manager pollt,+ // die Create-Oberflaeche baut einen Workflow —, bekommt er die alte+ // Antwort und schreibt sie wieder in den Cache. Ein einziger Bruch direkt+ // nach dem Klonen waere damit wertlos.+ backendCall.mockImplementation(async (cmd: string) => {+ if (cmd === 'stop_comfyui') await getAllNodeInfo() // jemand fragt dazwischen+ return { status: 'installed' }+ })++ await installCustomNodes(['videohelpersuite'], { restart: true })++ const vorDerFrage = objectInfoAbrufe+ await getAllNodeInfo()+ expect(objectInfoAbrufe, 'der Cache aus dem Neustart-Fenster steht noch').toBe(vorDerFrage + 1)+ })++ it('der Neustart laeuft ueber restartComfyForNewNodes, nicht ueber stop/schlafen/start', async () => {+ await installCustomNodes(['videohelpersuite'], { restart: true })+ expect(backendCall.mock.calls.map((c) => c[0]))+ .toEqual(['install_custom_node', 'stop_comfyui', 'start_comfyui'])+ // Und dazwischen wurde gefragt, ob der Port frei geworden ist. Genau das+ // tat die ersetzte Kopie nicht — sie schlief zwei Sekunden und startete.+ // Was passiert, wenn der Port belegt bleibt, steht in comfy-restart.test.ts.+ expect(lebendfragen).toBeGreaterThan(0)+ })++ it('ohne restart bleibt der Neustart Sache des Aufrufers', async () => {+ // Die drei Aufrufer in der Create-Oberflaeche fahren ihren Neustart mit+ // eigenem Fortschrittstext. Ihnen darf hier keiner dazwischenfunken.+ await installCustomNodes(['videohelpersuite'])+ expect(backendCall.mock.calls.map((c) => c[0])).toEqual(['install_custom_node'])+ })+})++describe('T-67 · der Download-Pfad geht denselben Weg', () => {+ const buendel = (): ModelBundle => ({+ name: 'Talking Character',+ description: '',+ tags: [],+ totalSizeGB: 1,+ vramRequired: '8 GB',+ customNodes: ['videohelpersuite'],+ files: [{+ name: '', description: '', pulls: '', tags: [], updated: '',+ downloadUrl: 'https://example.test/m.safetensors',+ filename: 'm.safetensors',+ subfolder: 'diffusion_models',+ sizeGB: 1,+ }],+ } as unknown as ModelBundle)++ const backend = () => backendCall.mockImplementation(async (cmd: string) => {+ if (cmd === 'check_model_sizes') return []+ if (cmd === 'check_download_space') return { fits: true }+ if (cmd === 'download_model') return { status: 'started', id: '1' }+ return { status: 'installed' }+ })++ it('der Bruch des Knoten-Caches passiert auf diesem Pfad ueberhaupt', async () => {+ // Der Kern von T-67. Der Download-Pfad hatte seine eigene Kopie der+ // Installationsschleife und brach nur ComfyUIs MODELL-Verzeichnisscan+ // (`refreshComfyModels`) — ein voellig anderer Cache. Der Knotenkatalog+ // blieb fuenf Minuten stehen.+ backend()+ await getAllNodeInfo()+ expect(objectInfoAbrufe).toBe(1)++ await installBundleComplete(buendel())+ // Die Knoteninstallation laeuft absichtlich neben dem Download her.+ await vi.waitFor(() => expect(backendCall.mock.calls.map((c) => c[0])).toContain('start_comfyui'))++ await getAllNodeInfo()+ expect(objectInfoAbrufe, 'der Download-Pfad hat den Knoten-Cache stehen lassen').toBe(2)+ }, 30_000)++ it('und zwar ueber denselben Weg, nicht ueber eine zweite Kopie', async () => {+ backend()+ await installBundleComplete(buendel())+ await vi.waitFor(() => expect(backendCall.mock.calls.map((c) => c[0])).toContain('start_comfyui'))++ // Die ersetzte Kopie schlief zwei Sekunden und rief `start_comfyui`+ // bedingungslos. Wer hier fragt, ob der Port frei geworden ist, ist+ // `restartComfyForNewNodes` — also der gemeinsame Weg.+ expect(lebendfragen).toBeGreaterThan(0)+ }, 30_000)+})diff --git a/src/api/__tests__/hf-catalog-addresses.live.test.ts b/src/api/__tests__/hf-catalog-addresses.live.test.tsnew file mode 100644index 00000000..1fe3728b--- /dev/null+++ b/src/api/__tests__/hf-catalog-addresses.live.test.ts@@ -0,0 +1,140 @@+/**+ * T-70 · das Tor, das den Katalog gegen die Wirklichkeit prueft.+ *+ * Der Befund: ueber hundert von Hand getippte HuggingFace-Adressen, und nichts+ * hat je nachgefragt, ob es die Dateien noch gibt. Der Nutzer erfaehrt es als+ * Erster — beim Klick, nach dem Warten.+ *+ * WARUM DAS HIER STEHT UND NICHT IN DER APP. Die naheliegende Reparatur, beim+ * Start alle Adressen anzuklopfen, waere schlechter als der Befund: gut hundert+ * HEAD-Anfragen, bevor der Nutzer irgendetwas verlangt hat, und eine+ * Netzabhaengigkeit, die eine lokal laufende App nicht hatte. Offline muesste+ * so eine Pruefung entweder luegen ("alles kaputt") oder ignoriert werden, und+ * eine ignorierte Pruefung ist keine. Vor allem aber kann sie nichts+ * reparieren: die Adressen sind Konstanten. Die ausfuehrliche Begruendung steht+ * im Quelltext, Abschnitt "The catalog against reality" in discover.ts.+ *+ * Der traege Teil — die Antwort auf die Anfrage, die der Nutzer WIRKLICH+ * gestellt hat — ist bereits gebaut und kostet keine zusaetzliche Anfrage:+ * `http_error_message` (src-tauri/src/commands/download.rs) benennt den Grund,+ * `isPermanentDownloadError` nimmt den Wiederholen-Knopf weg, wo er nie helfen+ * kann. Was fehlte, ist dieses Tor: die Pruefung VOR der Auslieferung.+ *+ * Er holt nur Kopfzeilen, ein HEAD pro EINDEUTIGER Adresse, keine Nutzdaten,+ * kein Konto, keine Anmeldung. Er haengt am Netz, deshalb laeuft er nur mit+ * `LIVE_HF=1` und nicht im normalen Gate — wie der Groessen-Waechter nebenan.+ *+ * LIVE_HF=1 npx vitest run src/api/__tests__/hf-catalog-addresses.live.test.ts+ *+ * Was er NICHT beweist: dass die Datei hinter der Adresse die richtige ist. Ein+ * HEAD sagt "da liegt etwas", nicht "da liegt das Modell, das der Katalog+ * verspricht". Die Groesse prueft der Waechter nebenan, den Inhalt nur der+ * SHA-256 beim echten Download.+ */+import { describe, it, expect } from 'vitest'+import { catalogAddresses, classifyAddressProbe, type AddressVerdict } from '../discover'++const LIVE = process.env.LIVE_HF === '1'++/** Gleichzeitige Anfragen. Klein gehalten: das Tor soll den Anbieter nicht+ * aergern, und ein 429 macht die Antwort wertlos statt rot. */+const PARALLEL = 4+const TIMEOUT_PRO_ANFRAGE_MS = 20_000++interface Befund {+ url: string+ where: string[]+ status: number+ verdict: AddressVerdict+ note?: string+}++async function klopfen(url: string): Promise<{ status: number; note?: string }> {+ try {+ const r = await fetch(url, {+ method: 'HEAD',+ redirect: 'follow',+ signal: AbortSignal.timeout(TIMEOUT_PRO_ANFRAGE_MS),+ })+ return { status: r.status }+ } catch (err) {+ // Kein Netz, DNS weg, Zeit abgelaufen: das ist keine Aussage ueber die+ // Adresse. Status 0 laeuft durch classifyAddressProbe auf 'unclear'.+ return { status: 0, note: String(err) }+ }+}++async function alleKlopfen(): Promise<Befund[]> {+ const adressen = catalogAddresses()+ const befunde: Befund[] = []+ let naechste = 0+ const arbeiter = Array.from({ length: PARALLEL }, async () => {+ for (let i = naechste++; i < adressen.length; i = naechste++) {+ const a = adressen[i]+ const { status, note } = await klopfen(a.url)+ befunde.push({ url: a.url, where: a.where, status, verdict: classifyAddressProbe(status), note })+ }+ })+ await Promise.all(arbeiter)+ return befunde+}++const zeile = (b: Befund) => `HTTP ${b.status} ${b.url}\n genannt von: ${b.where.join(', ')}${b.note ? `\n ${b.note}` : ''}`++/**+ * Adressen, die nachweislich tot sind und fuer die es KEINEN geprueften Ersatz+ * gibt. Sie stehen hier, damit ein Tor, das an ihnen dauerhaft rot waere, kein+ * Tor mehr waere — ein dauerhaft rotes Gate wird ignoriert, und dann faellt+ * die naechste Adresse, die stirbt, niemandem mehr auf.+ *+ * Die Liste kann nicht zum Friedhof werden: der zweite Test unten wird ROT,+ * sobald eine Adresse von hier wieder antwortet. Wer einen Eintrag hier+ * ablegt, muss den Grund im Katalog selbst dokumentieren.+ */+const BEKANNT_TOT: Record<string, string> = {+ 'https://huggingface.co/huihui-ai/Huihui-DeepSeek-V4-Flash-abliterated-GGUF/resolve/main/DeepSeek-V4-Flash-UD-IQ1_M.gguf':+ 'Repo privat oder geloescht (HTTP 401), kein geprueftes Ersatz-Repo · Begruendung bei den Eintraegen in discover.ts',+ 'https://huggingface.co/huihui-ai/Huihui-DeepSeek-V4-Flash-abliterated-GGUF/resolve/main/ggml-model-Q3_K_S.gguf':+ 'Repo privat oder geloescht (HTTP 401), kein geprueftes Ersatz-Repo · Begruendung bei den Eintraegen in discover.ts',+}++describe.runIf(LIVE)('Katalog-Adressen gegen die echten Dateien', () => {+ it('keine Adresse des Katalogs stirbt unbemerkt', { timeout: 600_000 }, async () => {+ const befunde = await alleKlopfen()+ const tot = befunde.filter((b) => b.verdict === 'dead')+ const unklar = befunde.filter((b) => b.verdict === 'unclear')+ const erreichbar = befunde.length - tot.length - unklar.length++ console.log(`[T-70] ${befunde.length} eindeutige Adressen geklopft · erreichbar ${erreichbar} · tot ${tot.length} · unklar ${unklar.length}`)+ for (const b of unklar) console.log(`[T-70] unklar: ${zeile(b)}`)++ // ZUERST: hat der Lauf ueberhaupt stattgefunden? Ein Tor, das gruen wird,+ // weil der Anbieter jede Anfrage abgewiesen hat, beweist nichts und ist+ // schlimmer als keins. Antwortet die Mehrheit nicht, ist der LAUF kaputt,+ // nicht der Katalog — und das muss laut gesagt werden.+ expect(+ erreichbar,+ `Nur ${erreichbar} von ${befunde.length} Adressen haben ueberhaupt geantwortet. ` ++ `Der Lauf selbst ist unbrauchbar (Netz? Ratenbremse?), er sagt nichts ueber den Katalog.\n` ++ unklar.slice(0, 5).map(zeile).join('\n'),+ ).toBeGreaterThan(befunde.length / 2)++ const neuTot = tot.filter((b) => !(b.url in BEKANNT_TOT))+ expect(+ neuTot.map(zeile),+ `Tote oder gesperrte Katalog-Adressen (${neuTot.length}):\n${neuTot.map(zeile).join('\n')}`,+ ).toEqual([])+ })++ it('die Ausnahmeliste ist keine Ablage: was wieder lebt, muss raus', { timeout: 120_000 }, async () => {+ const wiederDa: string[] = []+ for (const url of Object.keys(BEKANNT_TOT)) {+ const { status } = await klopfen(url)+ if (classifyAddressProbe(status) === 'reachable') wiederDa.push(`HTTP ${status} ${url}`)+ }+ expect(+ wiederDa,+ `Diese Adressen antworten wieder. Raus aus BEKANNT_TOT (und den Kommentar im Katalog nachziehen):\n${wiederDa.join('\n')}`,+ ).toEqual([])+ })+})diff --git a/src/api/__tests__/hf-catalog-addresses.test.ts b/src/api/__tests__/hf-catalog-addresses.test.tsnew file mode 100644index 00000000..963b742e--- /dev/null+++ b/src/api/__tests__/hf-catalog-addresses.test.ts@@ -0,0 +1,172 @@+/**+ * T-70, die Haelfte, die ohne Netz laeuft.+ *+ * Der Befund lautet: der Katalog haelt ueber hundert von Hand getippte+ * HuggingFace-Adressen, und nichts hat je nachgefragt, ob es die Dateien noch+ * gibt. Die Antwort dieses Zweigs ist bewusst KEINE Pruefung zur Laufzeit+ * (Begruendung steht im Kopf des Abschnitts "The catalog against reality" in+ * discover.ts), sondern ein Tor, das der Entwickler faehrt. Das Tor selbst+ * haengt am Netz und steht in `hf-catalog-addresses.live.test.ts`.+ *+ * Hier steht, was das Tor traegt und was ohne Netz beweisbar ist:+ *+ * 1. Das Tor kann nicht veralten. Jede fest getippte `/resolve/`-Adresse in+ * discover.ts UND in model-bundles.ts muss durch `catalogAddresses()`+ * erreichbar sein. Waere die Liste im Testordner von Hand gefuehrt, waere+ * sie ein zweiter Katalog zum Vergessen — genau der Fehler aus T-67.+ * 2. "Ich konnte nicht fragen" ist nicht "die Antwort ist nein". Ein 429 darf+ * das Tor nicht rot machen, ein 404 muss.+ * 3. Tor und Download-Pfad streiten nicht darueber, was "kaputt" heisst:+ * beide lesen `PERMANENT_HTTP_STATUSES`.+ *+ * Lauf: npx vitest run src/api/__tests__/hf-catalog-addresses.test.ts+ */+import { describe, it, expect } from 'vitest'+import { readFileSync } from 'node:fs'+import { fileURLToPath } from 'node:url'+import {+ catalogAddresses,+ classifyAddressProbe,+ isPermanentDownloadError,+ PERMANENT_HTTP_STATUSES,+ COMPONENT_REGISTRY,+} from '../discover'++const quelle = (datei: string) =>+ readFileSync(fileURLToPath(new URL(`../${datei}`, import.meta.url)), 'utf8')++/**+ * Alle fest getippten Download-Adressen aus dem Quelltext, direkt aus den+ * Zeichenketten gelesen.+ *+ * Zwei Schreibweisen, beide erfasst:+ *+ * · die ausgeschriebene Adresse, wie sie in COMPONENT_REGISTRY und in den+ * Buendeln steht;+ * · der Aufruf `HF('repo', 'datei')`, mit dem der Text-Katalog seine+ * Adressen baut. Ohne diesen zweiten Fall waere der gesamte Text-Katalog+ * — und damit jeder Vision-Projektor — ausserhalb des Waechters, und+ * genau dort steckte der 404, den das Tor am 01.09.2026 gefunden hat.+ *+ * `/resolve/` ist die Grenze mit Absicht: eine huggingface.co-Adresse OHNE+ * diesen Teil ist die Modellseite fuer den "mehr dazu"-Link, kein Download.+ * Uebrige Vorlagen mit `${...}` fallen raus — der Rumpf des `HF()`-Helfers+ * selbst und die beiden Adressen, die zur Laufzeit aus der HF-Baum-API gebaut+ * werden, sind keine getippten Konstanten, sondern Ergebnisse.+ */+function getippteAdressen(datei: string): string[] {+ const text = quelle(datei)+ const wortwoertlich = (text.match(/https:\/\/huggingface\.co\/[^'"`\s)]+/g) ?? [])+ .filter((u) => u.includes('/resolve/') && !u.includes('${'))+ const ueberHelfer = [...text.matchAll(/\bHF\(\s*'([^']+)'\s*,\s*'([^']+)'\s*\)/g)]+ .map(([, repo, datei]) => `https://huggingface.co/${repo}/resolve/main/${datei}`)+ return [...new Set([...wortwoertlich, ...ueberHelfer])]+}++describe('T-70 · das Katalog-Tor kann nicht veralten', () => {+ it('jede getippte /resolve/-Adresse ist durch catalogAddresses() erreichbar', () => {+ const erfasst = new Set(catalogAddresses().map((a) => a.url))+ const uebersehen: string[] = []+ for (const datei of ['discover.ts', 'model-bundles.ts']) {+ for (const url of getippteAdressen(datei)) {+ if (!erfasst.has(url)) uebersehen.push(`${datei}: ${url}`)+ }+ }+ expect(+ uebersehen,+ `Diese Adressen stehen im Quelltext, aber das Tor sieht sie nicht:\n${uebersehen.join('\n')}`,+ ).toEqual([])+ })++ it('der Quelltext-Scan findet ueberhaupt etwas — sonst beweist der Test oben nichts', () => {+ // Ein Scan, der nichts findet, ist gruen und wertlos. Beide Dateien MUESSEN+ // getippte Adressen enthalten, sonst ist das Auslesen kaputt und nicht der+ // Katalog leer.+ expect(getippteAdressen('discover.ts').length).toBeGreaterThan(10)+ expect(getippteAdressen('model-bundles.ts').length).toBeGreaterThan(10)+ })++ it('die Komponenten-Adressen sind vollstaendig, Slot fuer Slot', () => {+ // COMPONENT_REGISTRY geht den Weg ueber die Komponenten-Vervollstaendigung+ // und steht in keinem Buendel.+ //+ // Geprueft wird die HERKUNFT, nicht nur die Adresse. Mehrere dieser Slots+ // nennen dieselbe Datei wie ein Buendel — `clip_l.safetensors` etwa —, und+ // dann bleibt die URL auch dann im Tor, wenn der Slot im Sammler fehlt.+ // Eine Pruefung auf die blosse URL waere also gruen geblieben, waehrend+ // die Fehlermeldung des Tores den Schuldigen nicht mehr haette nennen+ // koennen. Genau daran ist diese Zeile beim Sondieren aufgefallen.+ const nachHerkunft = new Set(catalogAddresses().flatMap((a) => a.where))+ const fehlend: string[] = []+ for (const [typ, req] of Object.entries(COMPONENT_REGISTRY)) {+ for (const [slot, spec] of [['vae', req.vae], ['clip', req.clip], ['clipSecondary', req.clipSecondary]] as const) {+ if (spec?.downloadUrl && !nachHerkunft.has(`COMPONENT_REGISTRY.${typ}.${slot}`)) fehlend.push(`${typ}.${slot}`)+ }+ }+ expect(fehlend, `Slots ohne Eintrag im Tor: ${fehlend.join(', ')}`).toEqual([])+ })++ it('geteilte Adressen nennen alle ihre Opfer, jeden genau einmal', () => {+ // Mehrere Modelltypen laden denselben grossen Text-Encoder — dieselbe+ // Wan-VAE steht in vier Buendeln. Faellt die Adresse aus, ist nicht ein+ // Eintrag kaputt, sondern jeder, der sie nennt; die Meldung muss sie alle+ // aufzaehlen koennen, ohne denselben Namen viermal zu wiederholen.+ const geteilt = catalogAddresses().filter((a) => a.where.length > 1)+ expect(geteilt.length).toBeGreaterThan(0)+ for (const a of geteilt) expect(new Set(a.where).size).toBe(a.where.length)+ // Und mindestens eine Adresse wird wirklich von zwei Quellen genannt:+ // COMPONENT_REGISTRY steht in keinem Buendel, taucht aber mit denselben+ // Text-Encodern auf. Ohne diese Zeile koennte der Sammler die halbe+ // Herkunft verlieren und der Test bliebe gruen.+ expect(geteilt.some((a) => a.where.some((w) => w.startsWith('COMPONENT_REGISTRY.'))+ && a.where.some((w) => !w.startsWith('COMPONENT_REGISTRY.')))).toBe(true)+ })++ it('jede Adresse hat eine Herkunft und ist eine https-Adresse', () => {+ for (const a of catalogAddresses()) {+ expect(a.where.length).toBeGreaterThan(0)+ expect(a.url.startsWith('https://')).toBe(true)+ }+ })+})++describe('T-70 · "konnte nicht fragen" ist nicht "die Antwort ist nein"', () => {+ it('eine tote Adresse heisst tot', () => {+ for (const s of PERMANENT_HTTP_STATUSES) expect(classifyAddressProbe(s)).toBe('dead')+ })++ it('ein Erfolg heisst erreichbar', () => {+ for (const s of [200, 206, 301, 302, 307]) expect(classifyAddressProbe(s)).toBe('reachable')+ })++ it('ein schlechter Moment beim Anbieter macht das Tor nicht rot', () => {+ // Genau hier liegt der Unterschied zum Groessen-Waechter nebenan, der jede+ // Nicht-OK-Antwort gleich behandelt (`if (echt === null) continue`) und+ // deshalb ueber einen 404 hinweggeht.+ for (const s of [0, 408, 429, 500, 502, 503, 504]) expect(classifyAddressProbe(s)).toBe('unclear')+ })++ it('kein Status wird stillschweigend zu "erreichbar"', () => {+ // Die eine Eigenschaft, an der alles haengt: was nicht als Erfolg+ // ankommt, darf das Tor nie gruen faerben.+ for (let s = 100; s < 600; s++) {+ if (s >= 200 && s < 400) continue+ expect(classifyAddressProbe(s), `HTTP ${s}`).not.toBe('reachable')+ }+ })+})++describe('T-70 · Tor und Download-Pfad meinen dasselbe mit "kaputt"', () => {+ it('was die Fehlermeldung dauerhaft nennt, nennt das Tor tot — und umgekehrt', () => {+ // Zwei Leser, eine Liste. Haette einer eine eigene Kopie, wuerde der Streit+ // still bleiben: das Tor liesse eine Adresse durch, die der Download-Pfad+ // als endgueltig tot behandelt.+ const uneins: number[] = []+ for (let s = 100; s < 600; s++) {+ const ausDerMeldung = isPermanentDownloadError(`ae.safetensors ist weg (HTTP ${s}).`)+ const ausDerProbe = classifyAddressProbe(s) === 'dead'+ if (ausDerMeldung !== ausDerProbe) uneins.push(s)+ }+ expect(uneins, `Uneinig bei: ${uneins.join(', ')}`).toEqual([])+ })+})diff --git a/src/api/discover.ts b/src/api/discover.tsindex 27d653d5..4c75d92b 100644--- a/src/api/discover.ts+++ b/src/api/discover.ts@@ -1,5 +1,7 @@import { backendCall, fetchExternal } from "./backend"import { getCheckpoints, getDiffusionModels, getVAEModels, getCLIPModels, getGgufUnetModels, getAnimateDiffModels, getLoraModels, filterPartialFiles, refreshComfyModels } from "./comfyui"+import { clearNodeCache } from "./comfyui-nodes"+import { restartComfyForNewNodes } from "./comfy-restart"import type { ProviderId } from "./providers/types"import { log } from "../lib/logger"import { waitForModelsVisible } from "../lib/bundle-install"@@ -70,17 +72,32 @@ export async function clearDownloadEntry(id: string): Promise<void> {await backendCall("clear_download_entry", { id })}-/** Statuses that mean the address itself is dead, so Retry cannot work. */-const PERMANENT_HTTP = /\(HTTP (401|403|404|410)\)/+/**+ * The four answers that mean the ADDRESS is dead rather than the connection:+ * gone (404/410) and gated-or-private (401/403). Everything else — a transport+ * error, a rate limit, a 5xx — is the host having a bad minute and stays+ * retryable.+ *+ * ONE list, read from two directions. `isPermanentDownloadError` reads it out+ * of the message a failed download carries back from Rust; `classifyAddressProbe`+ * (below, used by the catalog gate) reads it out of a bare HTTP status. Two+ * hand-written copies of "what counts as broken" would be two chances to+ * disagree, and the disagreement would be silent: the gate would pass an+ * address the download path calls permanently dead.+ */+export const PERMANENT_HTTP_STATUSES: readonly number[] = [401, 403, 404, 410]++const PERMANENT_HTTP = new RegExp(`\\(HTTP (${PERMANENT_HTTP_STATUSES.join('|')})\\)`)/*** Would pressing Retry on this error ever succeed?*- * The catalog hard-codes 106 HuggingFace addresses. When one of those repos is- * renamed, gated or taken down, every attempt answers the same 404/403 forever,- * and the old UI answered with a bare "HTTP 404" and a Retry button — a loop- * with no exit. The status code inside the message is the contract; it is put- * there by `http_error_message` in src-tauri/src/commands/download.rs.+ * The catalog hard-codes its HuggingFace addresses (`catalogAddresses()` walks+ * every one of them). When one of those repos is renamed, gated or taken down,+ * every attempt answers the same 404/403 forever, and the old UI answered with+ * a bare "HTTP 404" and a Retry button — a loop with no exit. The status code+ * inside the message is the contract; it is put there by `http_error_message`+ * in src-tauri/src/commands/download.rs.** A transport error, a rate limit and a 5xx are all temporary and stay* retryable: only an address that is gone is permanent.@@ -436,22 +453,91 @@ export function assertNodeInstallOk(result: unknown, name: string): void {}}-export async function installCustomNodes(nodeKeys: string[]): Promise<void> {- for (const key of nodeKeys) {- const entry = CUSTOM_NODE_REGISTRY[key]- if (!entry) {- log.warn(`[discover] Unknown custom node key: ${key}`)- continue- }- try {- const result = await backendCall('install_custom_node', { repoUrl: entry.repo, nodeName: entry.name })- assertNodeInstallOk(result, entry.name)- log.info(`[discover] Installed custom node: ${entry.name}`)- } catch (err) {- log.error(`[discover] Failed to install ${entry.name}`, { err })- throw new Error(`Failed to install ${entry.name}: ${err}`)+/** Where the callers of a node install genuinely differ — and nothing else. */+export interface CustomNodeInstallOptions {+ /**+ * Keep going when one pack fails, instead of throwing on the first.+ *+ * True for the bundle download, where the packs are an extra alongside+ * gigabytes of models and one broken clone must not cost the rest. False —+ * the default — for the Create flows, which install exactly the pack the+ * next step needs and have nothing to do without it.+ */+ keepGoing?: boolean+ /**+ * Restart ComfyUI afterwards so the packs actually register.+ *+ * A cloned pack is Python that only loads at ComfyUI startup, so without+ * this the install is on disk and invisible. The callers in the Create+ * surface do their own restart around their own progress text; the bundle+ * download has no such surface and asks for it here.+ */+ restart?: boolean+ /** Progress text for a caller that has somewhere to put it. */+ onProgress?: (message: string) => void+}++/**+ * Install node packs — and leave this process's idea of "which nodes exist"+ * broken behind you, because it is now a lie.+ *+ * THE ONE PATH. There used to be two: this function, and a hand-copied loop+ * inside `installBundleComplete` below. They drifted, as copies do. This one never+ * touched `clearNodeCache()`, so every caller had to remember; three of them+ * did, each in its own hand-written sequence (CreateContext.tsx:346 and :407,+ * useCreate.ts:991). The copy in `installBundleComplete` did not — it restarted+ * ComfyUI and refreshed the MODEL lists, which is a different cache entirely.+ * `getAllNodeInfo` holds `/object_info` for five minutes+ * (comfyui-nodes.ts:60), so after a bundle install the workflow builder kept+ * reading the pre-install catalogue and kept telling the user to install the+ * pack he had just installed. T-67.+ *+ * The cache break is in a `finally` on purpose. A pack whose `pip install`+ * died halfway can still have registered its nodes, and a failed install is+ * exactly the moment nobody remembers to invalidate anything. Dropping a+ * five-minute cache costs one `/object_info` fetch; keeping a stale one costs+ * the user a wrong instruction he cannot argue with.+ *+ * It is broken a SECOND time after the restart, and that is the one that+ * matters: between install and restart the nodes are still not registered, so+ * anything that refetches in that window would just re-cache the same stale+ * answer. The restart is when the truth changes.+ */+export async function installCustomNodes(nodeKeys: string[], opts: CustomNodeInstallOptions = {}): Promise<void> {+ try {+ for (const key of nodeKeys) {+ const entry = CUSTOM_NODE_REGISTRY[key]+ if (!entry) {+ log.warn(`[discover] Unknown custom node key: ${key}`)+ continue+ }+ try {+ opts.onProgress?.(`Installing ${entry.name}…`)+ const result = await backendCall('install_custom_node', { repoUrl: entry.repo, nodeName: entry.name })+ assertNodeInstallOk(result, entry.name)+ log.info(`[discover] Installed custom node: ${entry.name}`)+ } catch (err) {+ if (!opts.keepGoing) {+ log.error(`[discover] Failed to install ${entry.name}`, { err })+ throw new Error(`Failed to install ${entry.name}: ${err}`)+ }+ log.warn('[discover] Custom node install failed', { err })+ }}+ } finally {+ clearNodeCache()}++ if (!opts.restart) return+ // `restartComfyForNewNodes`, not a hand-rolled stop/sleep/start. The copy+ // this replaced slept two seconds and started again unconditionally, which+ // is exactly wrong for a ComfyUI that LU did not spawn: the old process+ // keeps the port and its old node list, the new one never gets the port, and+ // the user is sent hunting an IMPORT FAILED line nobody ever wrote (measured+ // on the test box 2026-08-15, see comfy-restart.ts).+ opts.onProgress?.('Restarting ComfyUI so the new nodes register…')+ await restartComfyForNewNodes()+ clearNodeCache()}/** How long an install click itself waits for ComfyUI to notice a file that is@@ -652,36 +738,24 @@ export async function installBundleComplete(bundle: ModelBundle): Promise<void>// Step 2: Install custom nodes in BACKGROUND (fire-and-forget, non-blocking)// This runs git clone + pip install which can take minutes · never block downloads+ //+ // Through `installCustomNodes`, not a copy of it. The loop that used to stand+ // here was the second of two paths doing the same job, and it was the one+ // nobody maintained: it never broke the /object_info cache, so the workflow+ // builder went on recommending the pack this very call had just installed+ // (T-67), and its restart was a hand-rolled sleep that could not tell a+ // ComfyUI LU owns from one it does not.if (bundle.customNodes && bundle.customNodes.length > 0) {- const nodeKeys = [...bundle.customNodes]- void (async () => {- for (const key of nodeKeys) {- try {- const entry = CUSTOM_NODE_REGISTRY[key]- if (!entry) continue- const result = await backendCall('install_custom_node', { repoUrl: entry.repo, nodeName: entry.name })- assertNodeInstallOk(result, entry.name)- log.info(`[discover] Installed custom node: ${entry.name}`)- } catch (err) {- log.warn('[discover] Custom node install failed', { err })- }- }- // Restart ComfyUI after custom nodes are done (needed for node registration)- try {- await backendCall('stop_comfyui')- await new Promise(resolve => setTimeout(resolve, 2000))- await backendCall('start_comfyui')- log.info('[discover] ComfyUI restarted after custom node install')- } catch (err) {- log.warn('[discover] ComfyUI restart after custom node install failed', { err })- }- })()+ void installCustomNodes([...bundle.customNodes], { keepGoing: true, restart: true })+ .catch((err) => log.warn('[discover] Custom node install/restart failed', { err }))}// Force ComfyUI to re-scan model directories so new files appear in /object_info.- // Without this, ComfyUI's cached model list stays stale on Windows.+ // Without this, ComfyUI's cached model list stays stale on Windows. This is+ // the MODEL scan (ComfyUI's own), not the node catalogue — the node half is+ // `clearNodeCache()` inside installCustomNodes above, and confusing the two+ // is what left T-67 open.try {- const { refreshComfyModels } = await import('./comfyui')await refreshComfyModels()} catch { /* non-fatal · fetchModels also calls refresh */ }@@ -816,10 +890,18 @@ const HF = (repo: string, file: string) => `https://huggingface.co/${repo}/resol* Derived, never hand-written in the catalog, because the built-in engine has* to find the projector from the model path alone (src-tauri engine.rs mirrors* this exact rule). The upstream repos disagree on naming (`mmproj-F16.gguf`,- * `mmproj-model-bf16.gguf`, `Qwen3.8-27B-Uncensored-vision-f16.gguf`), and the+ * `mmproj-model-bf16.gguf`, `mmproj-Qwen3.8-27B-Uncensored-F16.gguf`), and the* built-in models dir is FLAT, so keeping the upstream name would leave two* models fighting over one projector file. Tying the name to the model also* keeps the pairing right when a user downloads several quants of one model.+ *+ * The third example used to read `Qwen3.8-27B-Uncensored-vision-f16.gguf`.+ * That file never existed: the address built from it answered 404, and all six+ * Qwen 3.8 27B entries pointed at it, so every one of them would have fetched+ * 11-29 GB of model and then failed on the projector. Nothing noticed for as+ * long as nobody asked the host — which is the whole of T-70. Corrected+ * against the repo's own file list on 2026-09-01, first run of the gate in+ * `__tests__/hf-catalog-addresses.live.test.ts`.*/export function mmprojFileName(modelFilename: string): string {const stem = modelFilename.replace(/\.gguf$/i, '')@@ -903,12 +985,12 @@ export function getUncensoredTextModels(): DiscoverModel[] {// ships inside these GGUFs loads fine on the pinned llama.cpp b9949, which// implements the qwen35 MTP block, so we point at the plain files and not// at JonathanColetti's noMTP cut.- { name: 'Qwen 3.8 27B Uncensored', group: 'Qwen 3.8 27B Uncensored', description: 'Qwen 3.8 27B dense · the viral uncensored build. Vision + thinking, 262K context. Recommended quant. The 0.9 GB vision projector comes with it.', pulls: '1M+', tags: ['27B', 'Vision', 'Q4_K_M', '17 GB'], updated: 'Hot', agent: true, released: '2026-08', downloadUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'Qwen3.8-27B-Uncensored-Q4_K_M.gguf'), filename: 'Qwen3.8-27B-Uncensored-Q4_K_M.gguf', sizeGB: 16.8, mmprojUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'Qwen3.8-27B-Uncensored-vision-f16.gguf'), mmprojSizeGB: 0.93 },- { name: 'Qwen 3.8 27B Uncensored IQ2_M', group: 'Qwen 3.8 27B Uncensored', description: 'Qwen 3.8 27B uncensored · smallest quant, fits a 12 GB card. Real quality tradeoff, but it runs.', pulls: '1M+', tags: ['27B', 'Vision', 'IQ2_M', '11 GB'], updated: 'Hot', agent: true, released: '2026-08', downloadUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'Qwen3.8-27B-Uncensored-IQ2_M.gguf'), filename: 'Qwen3.8-27B-Uncensored-IQ2_M.gguf', sizeGB: 10.6, mmprojUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'Qwen3.8-27B-Uncensored-vision-f16.gguf'), mmprojSizeGB: 0.93 },- { name: 'Qwen 3.8 27B Uncensored IQ4_XS', group: 'Qwen 3.8 27B Uncensored', description: 'Qwen 3.8 27B uncensored · IQ4_XS, the cheapest 4 bit. Close to Q4_K_M on 16 GB cards.', pulls: '1M+', tags: ['27B', 'Vision', 'IQ4_XS', '15 GB'], updated: 'New', agent: true, released: '2026-08', downloadUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'Qwen3.8-27B-Uncensored-IQ4_XS.gguf'), filename: 'Qwen3.8-27B-Uncensored-IQ4_XS.gguf', sizeGB: 15.3, mmprojUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'Qwen3.8-27B-Uncensored-vision-f16.gguf'), mmprojSizeGB: 0.93 },- { name: 'Qwen 3.8 27B Uncensored Q5_K_M', group: 'Qwen 3.8 27B Uncensored', description: 'Qwen 3.8 27B uncensored · Q5, higher quality. For 24 GB cards.', pulls: '1M+', tags: ['27B', 'Vision', 'Q5_K_M', '20 GB'], updated: 'New', agent: true, released: '2026-08', downloadUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'Qwen3.8-27B-Uncensored-Q5_K_M.gguf'), filename: 'Qwen3.8-27B-Uncensored-Q5_K_M.gguf', sizeGB: 19.5, mmprojUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'Qwen3.8-27B-Uncensored-vision-f16.gguf'), mmprojSizeGB: 0.93 },- { name: 'Qwen 3.8 27B Uncensored Q6_K', group: 'Qwen 3.8 27B Uncensored', description: 'Qwen 3.8 27B uncensored · Q6, near-lossless. High-VRAM setups.', pulls: '1M+', tags: ['27B', 'Vision', 'Q6_K', '22 GB'], updated: 'New', agent: true, released: '2026-08', downloadUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'Qwen3.8-27B-Uncensored-Q6_K.gguf'), filename: 'Qwen3.8-27B-Uncensored-Q6_K.gguf', sizeGB: 22.4, mmprojUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'Qwen3.8-27B-Uncensored-vision-f16.gguf'), mmprojSizeGB: 0.93 },- { name: 'Qwen 3.8 27B Uncensored Q8_0', group: 'Qwen 3.8 27B Uncensored', description: 'Qwen 3.8 27B uncensored · Q8, full quality. 32 GB+ or CPU with lots of RAM.', pulls: '1M+', tags: ['27B', 'Vision', 'Q8_0', '29 GB'], updated: 'New', agent: true, released: '2026-08', downloadUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'Qwen3.8-27B-Uncensored-Q8_0.gguf'), filename: 'Qwen3.8-27B-Uncensored-Q8_0.gguf', sizeGB: 29, mmprojUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'Qwen3.8-27B-Uncensored-vision-f16.gguf'), mmprojSizeGB: 0.93 },+ { name: 'Qwen 3.8 27B Uncensored', group: 'Qwen 3.8 27B Uncensored', description: 'Qwen 3.8 27B dense · the viral uncensored build. Vision + thinking, 262K context. Recommended quant. The 0.9 GB vision projector comes with it.', pulls: '1M+', tags: ['27B', 'Vision', 'Q4_K_M', '17 GB'], updated: 'Hot', agent: true, released: '2026-08', downloadUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'Qwen3.8-27B-Uncensored-Q4_K_M.gguf'), filename: 'Qwen3.8-27B-Uncensored-Q4_K_M.gguf', sizeGB: 16.8, mmprojUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'mmproj-Qwen3.8-27B-Uncensored-F16.gguf'), mmprojSizeGB: 0.93 },+ { name: 'Qwen 3.8 27B Uncensored IQ2_M', group: 'Qwen 3.8 27B Uncensored', description: 'Qwen 3.8 27B uncensored · smallest quant, fits a 12 GB card. Real quality tradeoff, but it runs.', pulls: '1M+', tags: ['27B', 'Vision', 'IQ2_M', '11 GB'], updated: 'Hot', agent: true, released: '2026-08', downloadUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'Qwen3.8-27B-Uncensored-IQ2_M.gguf'), filename: 'Qwen3.8-27B-Uncensored-IQ2_M.gguf', sizeGB: 10.6, mmprojUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'mmproj-Qwen3.8-27B-Uncensored-F16.gguf'), mmprojSizeGB: 0.93 },+ { name: 'Qwen 3.8 27B Uncensored IQ4_XS', group: 'Qwen 3.8 27B Uncensored', description: 'Qwen 3.8 27B uncensored · IQ4_XS, the cheapest 4 bit. Close to Q4_K_M on 16 GB cards.', pulls: '1M+', tags: ['27B', 'Vision', 'IQ4_XS', '15 GB'], updated: 'New', agent: true, released: '2026-08', downloadUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'Qwen3.8-27B-Uncensored-IQ4_XS.gguf'), filename: 'Qwen3.8-27B-Uncensored-IQ4_XS.gguf', sizeGB: 15.3, mmprojUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'mmproj-Qwen3.8-27B-Uncensored-F16.gguf'), mmprojSizeGB: 0.93 },+ { name: 'Qwen 3.8 27B Uncensored Q5_K_M', group: 'Qwen 3.8 27B Uncensored', description: 'Qwen 3.8 27B uncensored · Q5, higher quality. For 24 GB cards.', pulls: '1M+', tags: ['27B', 'Vision', 'Q5_K_M', '20 GB'], updated: 'New', agent: true, released: '2026-08', downloadUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'Qwen3.8-27B-Uncensored-Q5_K_M.gguf'), filename: 'Qwen3.8-27B-Uncensored-Q5_K_M.gguf', sizeGB: 19.5, mmprojUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'mmproj-Qwen3.8-27B-Uncensored-F16.gguf'), mmprojSizeGB: 0.93 },+ { name: 'Qwen 3.8 27B Uncensored Q6_K', group: 'Qwen 3.8 27B Uncensored', description: 'Qwen 3.8 27B uncensored · Q6, near-lossless. High-VRAM setups.', pulls: '1M+', tags: ['27B', 'Vision', 'Q6_K', '22 GB'], updated: 'New', agent: true, released: '2026-08', downloadUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'Qwen3.8-27B-Uncensored-Q6_K.gguf'), filename: 'Qwen3.8-27B-Uncensored-Q6_K.gguf', sizeGB: 22.4, mmprojUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'mmproj-Qwen3.8-27B-Uncensored-F16.gguf'), mmprojSizeGB: 0.93 },+ { name: 'Qwen 3.8 27B Uncensored Q8_0', group: 'Qwen 3.8 27B Uncensored', description: 'Qwen 3.8 27B uncensored · Q8, full quality. 32 GB+ or CPU with lots of RAM.', pulls: '1M+', tags: ['27B', 'Vision', 'Q8_0', '29 GB'], updated: 'New', agent: true, released: '2026-08', downloadUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'Qwen3.8-27B-Uncensored-Q8_0.gguf'), filename: 'Qwen3.8-27B-Uncensored-Q8_0.gguf', sizeGB: 29, mmprojUrl: HF('JonathanColetti/Qwen3.8-27B-Uncensored-GGUF', 'mmproj-Qwen3.8-27B-Uncensored-F16.gguf'), mmprojSizeGB: 0.93 },{ name: 'Qwen 3.8 27B Abliterated', group: 'Qwen 3.8 27B Abliterated', description: 'huihui Qwen 3.8 27B abliterated · clean uncensor of the newest Qwen dense model. Vision + thinking. Note the quant is called Q4_K, not Q4_K_M.', pulls: '635K+', tags: ['27B', 'Vision', 'Q4_K', '17 GB'], updated: 'Hot', agent: true, released: '2026-08', downloadUrl: HF('huihui-ai/Huihui-Qwen3.8-27B-abliterated-GGUF', 'Huihui-Qwen3.8-27B-abliterated-Q4_K.gguf'), filename: 'Huihui-Qwen3.8-27B-abliterated-Q4_K.gguf', sizeGB: 16.8, mmprojUrl: HF('huihui-ai/Huihui-Qwen3.8-27B-abliterated-GGUF', 'mmproj-model-bf16.gguf'), mmprojSizeGB: 0.93 },{ name: 'Qwen 3.8 27B Abliterated Q2_K', group: 'Qwen 3.8 27B Abliterated', description: 'huihui Qwen 3.8 27B abliterated · smallest quant for 12 GB cards.', pulls: '635K+', tags: ['27B', 'Vision', 'Q2_K', '11 GB'], updated: 'New', agent: true, released: '2026-08', downloadUrl: HF('huihui-ai/Huihui-Qwen3.8-27B-abliterated-GGUF', 'Huihui-Qwen3.8-27B-abliterated-Q2_K.gguf'), filename: 'Huihui-Qwen3.8-27B-abliterated-Q2_K.gguf', sizeGB: 10.9, mmprojUrl: HF('huihui-ai/Huihui-Qwen3.8-27B-abliterated-GGUF', 'mmproj-model-bf16.gguf'), mmprojSizeGB: 0.93 },{ name: 'Qwen 3.8 27B Abliterated Q5_K', group: 'Qwen 3.8 27B Abliterated', description: 'huihui Qwen 3.8 27B abliterated · Q5, higher quality. For 24 GB cards.', pulls: '635K+', tags: ['27B', 'Vision', 'Q5_K', '20 GB'], updated: 'New', agent: true, released: '2026-08', downloadUrl: HF('huihui-ai/Huihui-Qwen3.8-27B-abliterated-GGUF', 'Huihui-Qwen3.8-27B-abliterated-Q5_K.gguf'), filename: 'Huihui-Qwen3.8-27B-abliterated-Q5_K.gguf', sizeGB: 19.5, mmprojUrl: HF('huihui-ai/Huihui-Qwen3.8-27B-abliterated-GGUF', 'mmproj-model-bf16.gguf'), mmprojSizeGB: 0.93 },@@ -991,6 +1073,21 @@ export function getUncensoredTextModels(): DiscoverModel[] {// exists yet (checked 2026-08-01, one day after the 0731 drop; only FP8// and MLX abliterations are out). Watchlist: swap to the 0731 uncensor// the day huihui or DavidAU ships one.+ //+ // BOTH ADDRESSES BELOW ANSWER 401 (measured 2026-09-01, first run of the+ // catalog gate in __tests__/hf-catalog-addresses.live.test.ts).+ // `huihui-ai/Huihui-DeepSeek-V4-Flash-abliterated-GGUF` is private or gone+ // — HuggingFace answers 401 for both, on purpose, so which one it is+ // cannot be told from outside. They are LEFT AS THEY ARE and not repointed,+ // because there is nothing verified to repoint them to: the two surviving+ // huihui repos with similar names+ // (`...-abliterated-ds4-GGUF`, `...-0731-abliterated-GGUF`) carry neither+ // `DeepSeek-V4-Flash-UD-IQ1_M.gguf` nor `ggml-model-Q3_K_S.gguf`, and their+ // quants (Q2/Q2_K/Q4_K) are different files at different sizes. Swapping a+ // dead 87 GB promise for an unverified one is not a fix, it is a new bug+ // with a nicer address. Until someone confirms a replacement, the user+ // clicking these gets the gated-repo sentence from `http_error_message`+ // and no Retry button (T-07), which is the honest end of the road.{ name: 'DeepSeek V4 Flash Abliterated IQ1', group: 'DeepSeek V4 Flash Abliterated', description: 'huihui abliterated DeepSeek V4-Flash · 284B MoE (13B active), the most-downloaded uncensored model of 2026 so far. Smallest quant, single 87 GB file, runs on 96 GB RAM rigs. MIT.', pulls: '115K+', tags: ['284B MoE', 'UD-IQ1_M', '87 GB'], updated: 'Hot', agent: true, released: '2026-05', downloadUrl: HF('huihui-ai/Huihui-DeepSeek-V4-Flash-abliterated-GGUF', 'DeepSeek-V4-Flash-UD-IQ1_M.gguf'), filename: 'DeepSeek-V4-Flash-UD-IQ1_M.gguf', sizeGB: 86.8 },{ name: 'DeepSeek V4 Flash Abliterated Q3', group: 'DeepSeek V4 Flash Abliterated', description: 'huihui abliterated DeepSeek V4-Flash · Q3_K_S, higher fidelity. Single 122 GB file for big-RAM setups. MIT.', pulls: '115K+', tags: ['284B MoE', 'Q3_K_S', '122 GB'], updated: 'Hot', agent: true, released: '2026-05', downloadUrl: HF('huihui-ai/Huihui-DeepSeek-V4-Flash-abliterated-GGUF', 'ggml-model-Q3_K_S.gguf'), filename: 'ggml-model-Q3_K_S.gguf', sizeGB: 122 },{ name: 'GLM 5.2 Abliterated', description: 'huihui abliterated GLM 5.2 · 744B MoE (40B active) uncensored frontier coder. Multi-part download, ~356 GB. MIT.', pulls: '13K+', tags: ['744B MoE', 'UD-Q3_K_M', '356 GB', 'Multi-part'], updated: 'New', agent: true, released: '2026-06', downloadUrl: HF('huihui-ai/Huihui-GLM-5.2-abliterated-GGUF', 'UD-Q3_K_M/GLM-5.2-UD-Q3_K_M-00001-of-00009.gguf'), filename: 'GLM-5.2-UD-Q3_K_M-00001-of-00009.gguf', sizeGB: 356 },@@ -1440,6 +1537,111 @@ export function catalogFilenames(): string[] {}+// ─── The catalog against reality (T-70) ───+//+// THERE IS DELIBERATELY NO LIVENESS CHECK AT RUNTIME, and this is the reason.+//+// The audit's complaint is true: every download address in this app is a+// string a human typed, and nothing ever asked HuggingFace whether the file is+// still there. The obvious repair — probe them when the app starts — is worse+// than the disease:+//+// · It buys the app a hundred-odd HEAD requests before the user has asked+// for anything, on every start.+// · It invents a network dependency LU does not have. This is a local-first+// app; the Models tab has to render on a train. A probe that fails offline+// either lies ("all of these are broken") or is ignored, and an ignored+// check is not a check.+// · It cannot fix anything. These URLs are compile-time constants. Knowing+// at 09:00 that one is dead does not give the running app a working+// address — it only lets it phrase a better refusal.+//+// And the better refusal is already built, one layer down and at zero cost:+// the Rust downloader turns the status of the request the USER started into a+// sentence that names the cause (`http_error_message`,+// src-tauri/src/commands/download.rs), and `isPermanentDownloadError` above+// stops the UI offering Retry on an address that can never answer. That is the+// lazy check, at the moment of actual access, and it costs no extra request.+//+// What was genuinely missing is the other half: nobody checks the catalog+// BEFORE it ships. So the check moved to where it belongs — a gate the+// developer and CI run, never the user:+//+// LIVE_HF=1 npx vitest run src/api/__tests__/hf-catalog-addresses.live.test.ts+//+// The two functions below are that gate's eyes. They live here, next to the+// catalog, and they are derived from it rather than copied out of it: a URL+// added to COMPONENT_REGISTRY or to any bundle is inside the gate the moment+// it is written. A hand-kept list in the test file would have been a second+// catalog to forget to update — the same mistake as T-67, in a new place.++/** One address the catalog can hand to the downloader. */+export interface CatalogAddress {+ url: string+ /** Every catalog slot that names this URL, each named once. Several entries+ * share the big text encoders — the same Wan VAE sits in four bundles — and+ * a dead address has to be able to name all of its victims. */+ where: string[]+}++/**+ * Every hardcoded download address the catalog holds, deduplicated by URL.+ *+ * Two sources, because there are two: the model catalog `catalogEntries()`+ * already walks (bundles + text models, model file and vision projector), and+ * `COMPONENT_REGISTRY`, whose VAE/CLIP addresses are handed to+ * `startModelDownload` by the component-completion path and appear in no+ * bundle at all.+ */+export function catalogAddresses(): CatalogAddress[] {+ const byUrl = new Map<string, Set<string>>()+ const add = (url: string | undefined, where: string) => {+ if (!url) return+ const seen = byUrl.get(url)+ if (seen) seen.add(where)+ else byUrl.set(url, new Set([where]))+ }++ for (const m of catalogEntries()) {+ add(m.downloadUrl, m.filename ? `${m.name} · ${m.filename}` : m.name)+ add(m.mmprojUrl, `${m.name} · vision projector`)+ }++ for (const [type, req] of Object.entries(COMPONENT_REGISTRY)) {+ add(req.vae?.downloadUrl, `COMPONENT_REGISTRY.${type}.vae`)+ add(req.clip?.downloadUrl, `COMPONENT_REGISTRY.${type}.clip`)+ add(req.clipSecondary?.downloadUrl, `COMPONENT_REGISTRY.${type}.clipSecondary`)+ }++ return [...byUrl].map(([url, where]) => ({ url, where: [...where] }))+}++/** What a probe of a catalog address proved. */+export type AddressVerdict =+ /** The host serves this file. */+ | 'reachable'+ /** The address is gone or gated — the user's download would fail forever. */+ | 'dead'+ /** The host did not answer the question (rate limit, 5xx, no network). */+ | 'unclear'++/**+ * Read one HTTP status as a verdict about the ADDRESS.+ *+ * The third case is the point. The size watcher next door+ * (`bundle-size-drift.live.test.ts`) treats every non-OK answer the same way —+ * `if (echt === null) continue` — so a 404 is silently skipped and the run+ * still goes green. "I could not ask" and "the answer is no" are different+ * facts, and a gate that cannot tell them apart passes exactly when it should+ * shout. A 429 must not fail the build; a 404 must.+ */+export function classifyAddressProbe(status: number): AddressVerdict {+ if (PERMANENT_HTTP_STATUSES.includes(status)) return 'dead'+ if (status >= 200 && status < 400) return 'reachable'+ return 'unclear'+}++// ─── CivitAI Model Search ───export interface CivitAIModelResult {