Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

tech(AS-10b, KF-9): src/components auf null Lint-Meldungen, und der Kontextknopf sagt seine Zahl

Davidde9780efb5a9
diff --git a/e2e/builtin-ctx.spec.ts b/e2e/builtin-ctx.spec.ts
index bb886bc3..3da1f724 100644
--- a/e2e/builtin-ctx.spec.ts
+++ b/e2e/builtin-ctx.spec.ts
@@ -71,12 +71,29 @@ async function completeBuiltinOnboarding(page: Page) {
test('context dropdown relaunches the built-in engine and the counter follows', async ({ page }) => {
await completeBuiltinOnboarding(page)
- // Der eine Waehler. Sein Name ist gesetzt (`aria-label`), sein Text
- // wechselt — deshalb wird er ueber den Namen gegriffen und nie ueber das,
- // was gerade darin steht.
- const trigger = page.getByRole('button', { name: 'Context window', exact: true })
+ // Der eine Waehler, weiterhin ueber seinen Namen gegriffen und nie ueber
+ // das, was gerade darin steht.
+ //
+ // KF-9 hat `exact: true` gekostet, und zwar begruendet. Der Name war
+ // „Context window" — ein `aria-label`, das den SICHTBAREN Text („117/16.4k")
+ // ersetzte statt ihn zu enthalten. Das ist der Verstoss gegen WCAG 2.5.3
+ // (Label in Name), und seit D-S06 ist dieser Knopf die einzige Stelle, an
+ // der die Zahl noch steht: fuer einen Screenreader war sie nirgends mehr zu
+ // holen. Der Name lautet jetzt „Context window 117/16.4k" (unsichtbares
+ // Praefix via `aria-labelledby`, dahinter der gerenderte Text).
+ //
+ // Beides zugleich — Messwert hoerbar UND Name buchstabengleich stabil — geht
+ // nicht: ein exakter Name „Context window" schliesst die Zahl per Definition
+ // aus. Was stabil BLEIBT, ist das Praefix, und genau darauf greift der
+ // Teilstring-Treffer hier. Er ist keine Lockerung: „Context window" trifft
+ // in dieser App weiterhin genau ein Bedienelement, und der Zaehler dahinter
+ // wird unten ohnehin Ziffer fuer Ziffer geprueft.
+ const trigger = page.getByRole('button', { name: 'Context window' })
await openNewChat(page)
+ // Der Teilstring trifft genau einen Knopf — sonst waere die Lockerung oben
+ // eine Verschlechterung und nicht bloss eine andere Schreibweise.
+ await expect(trigger).toHaveCount(1)
// Leerer Chat: `TokenCounter` liefert `null`, also traegt der Knopf die
// Lesart des WAEHLERS — `ctx.contextWindow` aus seiner eigenen
// `useActiveContextWindow(tick)`-Instanz. Default-Tuning = -c 8192.
diff --git a/src/components/agents/ToolCallCard.tsx b/src/components/agents/ToolCallCard.tsx
index ad6746b3..5a2daf76 100644
--- a/src/components/agents/ToolCallCard.tsx
+++ b/src/components/agents/ToolCallCard.tsx
@@ -2,6 +2,7 @@ import { motion } from 'framer-motion'
import { Loader2, Check, X } from 'lucide-react'
import { GlowButton } from '../ui/GlowButton'
import type { ToolCall } from '../../types/agents'
+import type { ToolArgs } from '../../api/mcp/types'
interface Props {
toolCall: ToolCall
@@ -9,7 +10,10 @@ interface Props {
onReject?: () => void
}
-function formatArgs(args: Record<string, any>): string {
+// Der einzige Aufrufer uebergibt `toolCall.args`, und das IST `ToolArgs`
+// (types/agents.ts:45). Die Funktion serialisiert nur — sie greift auf keinen
+// einzigen Schluessel zu, `unknown` kostet hier also nichts.
+function formatArgs(args: ToolArgs): string {
try {
return JSON.stringify(args, null, 2)
} catch {
diff --git a/src/components/agents/WorkflowBuilder.tsx b/src/components/agents/WorkflowBuilder.tsx
index 3b6581f2..08d87eff 100644
--- a/src/components/agents/WorkflowBuilder.tsx
+++ b/src/components/agents/WorkflowBuilder.tsx
@@ -187,7 +187,13 @@ export function WorkflowBuilder({ workflowId, onSave, onCancel }: WorkflowBuilde
<input
value={step.toolArgTemplates ? JSON.stringify(step.toolArgTemplates) : ''}
onChange={(e) => {
- try { updateStep(step.id, { toolArgTemplates: JSON.parse(e.target.value) }) } catch {}
+ // Halb getippter JSON ist der Normalfall, nicht der
+ // Fehlerfall: das Feld wird bei JEDEM Tastendruck
+ // geparst, und `{"q"` ist auf dem Weg zu `{"q": 1}`
+ // unvermeidlich ungueltig. Der letzte gueltige Stand
+ // bleibt stehen, bis wieder einer da ist — deshalb
+ // wird hier nichts gemeldet und nichts gesetzt.
+ try { updateStep(step.id, { toolArgTemplates: JSON.parse(e.target.value) }) } catch { /* siehe oben */ }
}}
placeholder='Args JSON: {"query": "{{user_input}}"}'
className="w-full px-2 py-1 rounded bg-white/5 border border-white/10 text-[0.65rem] text-gray-300 placeholder-gray-600 focus:outline-none"
diff --git a/src/components/chat/ContextDropdown.tsx b/src/components/chat/ContextDropdown.tsx
index a51b9696..cc6e56ae 100644
--- a/src/components/chat/ContextDropdown.tsx
+++ b/src/components/chat/ContextDropdown.tsx
@@ -1,4 +1,4 @@
-import { useState, type ReactNode } from 'react'
+import { useId, useState, type ReactNode } from 'react'
import { ChevronDown, Check, Loader2, AlertTriangle } from 'lucide-react'
import { useModelStore } from '../../stores/modelStore'
import { useChatStore } from '../../stores/chatStore'
@@ -52,6 +52,12 @@ const fmt = (n: number) =>
* entfernt, wo er vorher stand.
*/
export function ContextDropdown({ children }: { children?: ReactNode }) {
+ // `useId` und keine Modulkonstante: die Kopfzeile kann diesen Knopf mehr als
+ // einmal rendern (Vergleichsmodus), und doppelte `id`s machen aus
+ // `aria-labelledby` einen Zeiger auf den erstbesten Treffer im Dokument.
+ const uid = useId()
+ const labelId = `${uid}-ctx-label`
+ const valueId = `${uid}-ctx-value`
const activeModel = useModelStore((s) => s.activeModel)
const override = useSettingsStore((s) => s.settings.contextWindowOverride)
const updateSettings = useSettingsStore((s) => s.updateSettings)
@@ -148,16 +154,41 @@ export function ContextDropdown({ children }: { children?: ReactNode }) {
onClick={() => setOpen((o) => !o)}
disabled={busy}
title={`Context window: ${ctx.provider === 'lmstudio' ? "LM Studio's loaded context" : ctx.provider === 'builtin' ? "the built-in engine's loaded context" : 'Ollama num_ctx'}. Changing it reloads the model so it takes effect now.`}
- aria-label="Context window"
+ /* KF-9 — der Knopf verdeckte seinen eigenen Messwert.
+ *
+ * Hier stand `aria-label="Context window"`. Ein `aria-label` ERSETZT
+ * den Namen aus dem Inhalt; sichtbar steht im Knopf aber „117/16.4k".
+ * Damit war der Name genau das, was WCAG 2.5.3 (Label in Name)
+ * verbietet: er enthielt die sichtbare Beschriftung nicht. Und seit
+ * D-S06 die zwei Anzeigen zusammengelegt hat, ist dieser Knopf die
+ * EINZIGE Stelle, an der die Zahl ueberhaupt noch steht — ein
+ * Screenreader-Nutzer bekam sie nirgends mehr.
+ *
+ * `aria-labelledby` statt eines zusammengebauten `aria-label`-Strings:
+ * der Name zeigt damit auf den GERENDERTEN Knoten und kann nicht von
+ * ihm abweichen. Ein `aria-label={`Context window ${…}`}` waere eine
+ * zweite Ableitung derselben Zahl — also genau der zweite Pflegeweg,
+ * den D-S06 gerade weggenommen hat.
+ *
+ * Der Name lautet jetzt „Context window 117/16.4k" bzw. „Context
+ * window ctx 8K": das unsichtbare Wort zuerst (es sagt, WAS der Knopf
+ * ist), der sichtbare Text danach (er ist die Beschriftung). Der Name
+ * bleibt damit ueber ein STABILES Praefix greifbar, obwohl er sich
+ * mitbewegt — siehe die Anpassung in e2e/builtin-ctx.spec.ts.
+ */
+ aria-labelledby={`${labelId} ${valueId}`}
aria-expanded={open}
aria-haspopup="menu"
className="flex items-center gap-1 px-1.5 py-0.5 rounded border border-gray-200 dark:border-white/[0.06] hover:border-gray-400 dark:hover:border-white/15 text-gray-500 transition-colors text-[0.55rem] lu-hud-num disabled:opacity-60"
>
+ <span id={labelId} className="sr-only">Context window</span>
{busy ? <Loader2 size={9} className="animate-spin" /> : null}
{applyError && !busy ? <AlertTriangle size={9} className="text-red-400" /> : null}
{/* Der Fuellstand IST die Beschriftung. Nur wenn es keinen gibt (leerer
Chat), steht hier wieder das Fenster allein. */}
- {hasFill ? children : <span>ctx {fmt(ctx.contextWindow)}</span>}
+ <span id={valueId}>
+ {hasFill ? children : <span>ctx {fmt(ctx.contextWindow)}</span>}
+ </span>
<ChevronDown size={8} className={`transition-transform ${open ? 'rotate-180' : ''}`} />
</button>
{applyError && !open && (
diff --git a/src/components/chat/ModelPickerCard.tsx b/src/components/chat/ModelPickerCard.tsx
index a1b30ef8..61a1231f 100644
--- a/src/components/chat/ModelPickerCard.tsx
+++ b/src/components/chat/ModelPickerCard.tsx
@@ -4,6 +4,7 @@ import { useModelPickStore, MODEL_PICK_TIMEOUT_MS, type ModelPickKind, type Mode
import { useSettingsStore } from '../../stores/settingsStore'
import { getImageModels, getVideoModels, isI2VModel, isT2VCapable } from '../../api/comfyui'
import type { AgentToolCall } from '../../types/agent-mode'
+import type { ToolArgs } from '../../api/mcp/types'
/**
* Model-Picker UI (v2.5.3, David 2026-06-10). Two faces of one feature:
@@ -39,8 +40,13 @@ export const PICK_PREF_KEY: Record<ModelPickKind, 'preferredImageModel' | 'prefe
export function pickKindForToolCall(toolCall: Pick<AgentToolCall, 'toolName' | 'args'>): ModelPickKind | null {
if (toolCall.toolName === 'image_generate') return 'image'
if (toolCall.toolName !== 'video_generate') return null
- const a = (toolCall.args ?? {}) as Record<string, any>
- const s = (a.settings && typeof a.settings === 'object' ? a.settings : {}) as Record<string, any>
+ // `AgentToolCall['args']` ist bereits `ToolArgs` (types/agent-mode.ts:91), es
+ // braucht also gar keine Zusicherung. `s` verengt `unknown` mit derselben
+ // Pruefung wie vorher — nur dass das Ergebnis jetzt auch `unknown` ist und die
+ // `typeof inputImage === 'string'`-Pruefung unten wirklich etwas tut, statt
+ // eine schon durchgewinkte Zusage zu wiederholen.
+ const a: ToolArgs = toolCall.args ?? {}
+ const s: ToolArgs = a.settings && typeof a.settings === 'object' ? (a.settings as ToolArgs) : {}
const inputImage = a.inputImage ?? a.input_image ?? a.image ?? s.inputImage ?? s.input_image ?? s.image
return typeof inputImage === 'string' && inputImage ? 'video-i2v' : 'video-t2v'
}
diff --git a/src/components/chat/StagedChangesPanel.tsx b/src/components/chat/StagedChangesPanel.tsx
index 03bb881a..a8ef2e3f 100644
--- a/src/components/chat/StagedChangesPanel.tsx
+++ b/src/components/chat/StagedChangesPanel.tsx
@@ -71,7 +71,13 @@ export function StagedChangesPanel({ chatId }: Props) {
async function applyAll() {
if (!chatId) return
for (const change of [...changes]) {
- // eslint-disable-next-line no-await-in-loop
+ // Sequential on purpose, not an oversight: two changes can touch the same
+ // file, and `applyOne` reads-modifies-writes. In parallel the later write
+ // would be based on a snapshot taken before the earlier one landed.
+ // (Hier stand eine Unterdrueckung der Regel `no-await-in-loop`. Die ist
+ // in KEINER Config dieses Baums eingeschaltet — die Zeile hat nie etwas
+ // unterdrueckt, sie hat nur behauptet, es gaebe ein Gate. Der Grund war
+ // richtig, die Form war eine Luege; der Grund bleibt.)
await applyOne(change)
}
}
diff --git a/src/components/chat/ToolCallBlock.tsx b/src/components/chat/ToolCallBlock.tsx
index 17955dea..6c30e64c 100644
--- a/src/components/chat/ToolCallBlock.tsx
+++ b/src/components/chat/ToolCallBlock.tsx
@@ -285,7 +285,7 @@ function ToolCallBlockImpl({ toolCall, onApprove, onReject }: Props) {
// Keyed off the RAW result line, not the resolved one: a file:// URL takes a
// moment to read off disk, and the kind of element to render must not depend
// on whether that read has landed yet.
- const isVideoResult = !!rawLocalUrl
+ const isVideoResult = rawLocalUrl
? toolCall.toolName === 'video_generate'
: !!effectivePreviewUrl && isInlineVideoUrl(effectivePreviewUrl)
diff --git a/src/components/chat/__tests__/tool-media-lifetime.test.ts b/src/components/chat/__tests__/tool-media-lifetime.test.ts
index 21191a78..1baf7e65 100644
--- a/src/components/chat/__tests__/tool-media-lifetime.test.ts
+++ b/src/components/chat/__tests__/tool-media-lifetime.test.ts
@@ -88,6 +88,18 @@ describe('the viewer owns the blob, so it can end', () => {
it('picks the element kind from the raw result, not the resolved URL', () => {
// Reading off disk is async; keying the video/image decision on the
// resolved URL would render the wrong element for the first frame.
- expect(block).toMatch(/const isVideoResult = !!rawLocalUrl/)
+ //
+ // Hier stand `/const isVideoResult = !!rawLocalUrl/`. Das doppelte
+ // Nicht-Nicht war nie Teil dieser Behauptung: in einer Bedingung ist es
+ // wirkungslos, und `no-extra-boolean-cast` hat es (AS-10b, zweiter
+ // Durchgang) entfernt. Der Test hielt damit die Zeichensetzung fest statt
+ // die Aussage. Jetzt steht hier, was die Ueberschrift verspricht — WELCHER
+ // Wert entscheidet, und wohin der Ja-Zweig greift.
+ expect(block).toMatch(
+ /const isVideoResult = rawLocalUrl\s*\?\s*toolCall\.toolName === 'video_generate'/,
+ )
+ // Und die Gegenprobe zur Ueberschrift: der aufgeloeste URL darf die
+ // Entscheidung NICHT tragen. Er kommt erst im Nein-Zweig vor.
+ expect(block).not.toMatch(/const isVideoResult = effectivePreviewUrl/)
})
})
diff --git a/src/components/import/ChatbotImporter.tsx b/src/components/import/ChatbotImporter.tsx
index be72f8b2..8502c377 100644
--- a/src/components/import/ChatbotImporter.tsx
+++ b/src/components/import/ChatbotImporter.tsx
@@ -89,7 +89,7 @@ export function ChatbotImporter() {
setError(null)
setDoneCount(0)
let done = 0
- let failed: string[] = []
+ const failed: string[] = []
for (const conv of toImport) {
try {
const file = conversationToFile(conv)
diff --git a/src/components/layout/AppShell.tsx b/src/components/layout/AppShell.tsx
index 16e09e78..7fc5a3c1 100644
--- a/src/components/layout/AppShell.tsx
+++ b/src/components/layout/AppShell.tsx
@@ -34,6 +34,8 @@ import { idbKeysToRestore, mayReloadForIdbRestore } from '../../lib/idb-restore'
import { log } from '../../lib/logger'
import { withDetail } from '../../lib/error-text'
import { pickForMode } from '../../lib/active-model-mode'
+import type { TextChunk } from '../../types/rag'
+import type { Role } from '../../types/chat'
import { useKeyboardShortcuts } from '../../hooks/useKeyboardShortcuts'
import { useCloudAuth } from '../../hooks/useCloudAuth'
import { useCloudAuthStore, deriveCloudAvailable } from '../../stores/cloudAuthStore'
@@ -52,6 +54,31 @@ import { Titlebar } from './Titlebar'
// Modulkonstante, das Set also genauso konstant.
const STORE_KEYS_SET = new Set(STORE_KEYS)
+/**
+ * Was das Ereignis `remote-chat-message` traegt (Nutzlast von
+ * `src-tauri/src/commands/remote.rs:950`, `ChatEventPayload`).
+ *
+ * `role` steht hier ENGER als `Role` (das vier Werte hat), und das ist keine
+ * Annahme, sondern die gemessene Zusicherung der Gegenseite: `remote.rs:976`
+ * weist jede Anfrage mit einer anderen Rolle mit HTTP 400 ab, BEVOR das
+ * Ereignis ueberhaupt ausgesendet wird — der Kommentar dort nennt es Bug #9,
+ * „role must be 'user' or 'assistant' (never 'system' or arbitrary text)".
+ * Der Empfaenger kann also gar nichts anderes sehen, und das frueher hier
+ * stehende `role as any` hat genau diese schon erledigte Pruefung verdeckt.
+ *
+ * Die vier optionalen Felder tragen drueben `#[serde(default)]`: sie sind auf
+ * dem Draht immer da, aber als leerer String. Der Code unten liest sie mit
+ * Wahrheitspruefungen, was fuer „fehlt" und fuer „leer" dasselbe tut.
+ */
+type RemoteChatMessage = {
+ role: Extract<Role, 'user' | 'assistant'>
+ content: string
+ model?: string
+ mode?: string
+ chat_id?: string
+ chat_title?: string
+}
+
// The backup triad must never write %APPDATA%/store_backup.json before the
// restore decision — on a post-NSIS boot the first doBackup would otherwise
// snapshot the wiped localStorage over the only good backup. Resolved on every
@@ -349,7 +376,7 @@ function AppShellTree() {
const live = await exportAllChunks()
// Only import entries the live store is missing — never clobber
// newer in-app activity with a stale backup.
- const toImport: Record<string, any> = {}
+ const toImport: Record<string, TextChunk[]> = {}
for (const [docId, chunks] of Object.entries(parsed)) {
if (!live[docId] && Array.isArray(chunks) && chunks.length > 0) {
toImport[docId] = chunks
@@ -409,7 +436,13 @@ function AppShellTree() {
// Feature FF: restore memory embeddings, then RAG chunks.
const ragOnly = await restoreMemoryVectorsFrom(parsedRag as Record<string, unknown>)
const { importAllChunks } = await import('../../lib/ragDB')
- await importAllChunks(ragOnly as Record<string, any>)
+ // Der Wert kommt aus JSON.parse, ist also `unknown`. Die
+ // Pruefung, die der Zweig oben (Zeile ~355) selbst macht,
+ // steht hier in `importAllChunks` — `ragDB.ts:133`
+ // ueberspringt jeden Eintrag, der kein nichtleeres Array
+ // ist. Die Zusicherung ist deshalb nur ein Typ-Schritt,
+ // kein Vertrauensvorschuss zur Laufzeit.
+ await importAllChunks(ragOnly as Record<string, TextChunk[]>)
}
}
} catch { /* best-effort */ }
@@ -699,7 +732,10 @@ function AppShellTree() {
const afterHydration = () => {
// Either hydration already finished (so we run now) or we register a
// one-shot callback for when it does.
- const persist = (useProviderStore as any).persist
+ // `persist` steht am Store, weil er mit dem persist-Middleware gebaut ist
+ // (stores/providerStore.ts:175) — zustand haengt die API dort typisiert an.
+ // Das `as any` war ein Rest aus der Zeit davor.
+ const persist = useProviderStore.persist
if (!persist || persist.hasHydrated?.()) {
void pullAndArm()
} else {
@@ -727,7 +763,6 @@ function AppShellTree() {
if (storeUnsub) storeUnsub()
if (hydrationUnsub) hydrationUnsub()
}
- // eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
// ── Mirror remote mobile chat into the dispatched desktop conversation ──
@@ -736,10 +771,14 @@ function AppShellTree() {
let unlisten: (() => void) | undefined
;(async () => {
const { listen } = await import('@tauri-apps/api/event')
- unlisten = await listen<{ role: string; content: string; model?: string; mode?: string; chat_id?: string; chat_title?: string }>(
+ unlisten = await listen<RemoteChatMessage>(
'remote-chat-message',
(event) => {
- const { role, content, mode, chat_id, chat_title, model } = event.payload || ({} as any)
+ // `Partial<…>` statt einer Zusicherung: der `?? {}`-Zweig existiert,
+ // WEIL die Nutzlast fehlen kann, und genau das sagt der Typ jetzt.
+ // Die Wahrheitspruefung in der naechsten Zeile ist die Verengung.
+ const { role, content, mode, chat_id, chat_title, model }: Partial<RemoteChatMessage> =
+ event.payload ?? {}
if (!role || !content) return
const chat = useChatStore.getState()
@@ -751,8 +790,17 @@ function AppShellTree() {
if (mode === 'codex') {
const mobileChatId = chat_id || 'mobile-codex'
const tagged = `[mobile:${mobileChatId}]`
- let conv = chat.conversations.find((c) =>
- c.mode === 'codex' && (c.title.includes(tagged) || (c as any).remoteChatId === mobileChatId),
+ const conv = chat.conversations.find((c) =>
+ // `remoteChatId` steht auf KEINEM Typ dieses Baums, und es wird
+ // auch nirgends geschrieben: die Zeile kam mit 55ceb072 herein und
+ // ist seither die einzige Fundstelle im ganzen Verzeichnisbaum
+ // (`git log -S remoteChatId --all` = ein Treffer, dieser Lesezugriff).
+ // Der Vergleich ist damit seit seiner Entstehung immer `false`;
+ // getragen hat den Treffer immer der Titel-Zweig davor. Das `as any`
+ // hat das verdeckt — die benannte Form sagt es.
+ c.mode === 'codex' &&
+ (c.title.includes(tagged) ||
+ (c as { remoteChatId?: string }).remoteChatId === mobileChatId),
)
let convId = conv?.id
if (!convId) {
@@ -769,7 +817,7 @@ function AppShellTree() {
if (last && last.role === role && last.content === content) return
useChatStore.getState().addMessage(convId, {
id: `remote-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`,
- role: role as any,
+ role,
content,
timestamp: Date.now(),
})
@@ -784,7 +832,7 @@ function AppShellTree() {
if (last && last.role === role && last.content === content) return
chat.addMessage(dispatchedConversationId, {
id: `remote-${Date.now()}-${Math.random().toString(36).slice(2, 7)}`,
- role: role as any,
+ role,
content,
timestamp: Date.now(),
})
diff --git a/src/components/layout/Titlebar.tsx b/src/components/layout/Titlebar.tsx
index 2a116eb7..be27e724 100644
--- a/src/components/layout/Titlebar.tsx
+++ b/src/components/layout/Titlebar.tsx
@@ -29,7 +29,7 @@ import { ICON_SM } from '../ui/icon-size'
*/
const MONOGRAM = '/LU-monogram.svg'
-const isTauri = typeof window !== 'undefined' && !!(window as any).__TAURI_INTERNALS__
+const isTauri = typeof window !== 'undefined' && !!window.__TAURI_INTERNALS__
export function Titlebar() {
const [isMaximized, setIsMaximized] = useState(false)
diff --git a/src/components/models/ModelManager.tsx b/src/components/models/ModelManager.tsx
index fd3677c0..f7991a54 100644
--- a/src/components/models/ModelManager.tsx
+++ b/src/components/models/ModelManager.tsx
@@ -59,7 +59,14 @@ export function ModelManager() {
const ollamaEnabled = useProviderStore(s => s.providers.ollama.enabled)
const [pullOpen, setPullOpen] = useState(false)
const [infoOpen, setInfoOpen] = useState(false)
- const [modelInfo, setModelInfo] = useState<any>(null)
+ // Gesetzt wird das aus `{ name, ...await showModel(name) }` (unten in
+ // `handleInfo`), und `showModel` gibt `Record<string, unknown>` zurueck
+ // (api/ollama.ts:61) — es reicht die Antwort von Ollamas /api/show
+ // unveraendert durch, deren Felder je nach Modell wechseln. Genau dafuer ist
+ // der Typ hier gebaut: `name` kennen wir, weil wir es selbst danebenschreiben,
+ // der Rest ist `unknown`. Gelesen wird ohnehin nur `name` (Modal-Titel) und
+ // das Ganze als JSON.stringify.
+ const [modelInfo, setModelInfo] = useState<({ name: string } & Record<string, unknown>) | null>(null)
const [confirmDelete, setConfirmDelete] = useState<string | null>(null)
// Open on Discover by default — most opens are to find and install
// something new. Installed is one click away in the segment control.
diff --git a/src/components/models/ModelSelector.tsx b/src/components/models/ModelSelector.tsx
index d31bbb17..2b02790d 100644
--- a/src/components/models/ModelSelector.tsx
+++ b/src/components/models/ModelSelector.tsx
@@ -14,6 +14,7 @@ import { canUseTools, resolveToolSupport, type ToolSupport } from '../../lib/too
import { backendCall } from '../../api/backend'
import { listLoadedLmStudioModels, loadLmStudioModel, unloadLmStudioModel } from '../../api/lmstudio'
import { isLmStudioProvider } from '../../lib/hf-to-provider'
+import { detailOf } from '../../lib/error-text'
import { lmStudioSlotUpdate, adoptionReplacesBuiltinEngine } from '../../lib/lmstudio-backend-adopt'
import { nextProbeDelayMs } from '../../lib/probe-backoff'
import { noChatBackendEnabled } from '../../lib/provider-visibility'
@@ -135,7 +136,13 @@ function sameStringSet(prev: Set<string>, next: string[]): boolean {
// re-fetches the model list so the LM Studio models appear without a
// restart.
-interface LmStudioServerStatus {
+/**
+ * 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.
+ */
+export interface LmStudioServerStatus {
running: boolean
port: number
lms_present: boolean
@@ -204,8 +211,16 @@ function LmStudioServerHint({ onStarted }: { onStarted: () => void }) {
}
}
}
- } catch (e: any) {
- setStartError(e?.message ? String(e.message).slice(0, 80) : 'Start failed')
+ } 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
+ // 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
+ // beantwortet (lib/error-text.ts): String, Error oder sonst etwas.
+ const detail = detailOf(e)
+ setStartError(detail ? detail.slice(0, 80) : 'Start failed')
} finally {
setStarting(false)
}
@@ -380,9 +395,15 @@ function groupByFamily(models: AIModel[]): { family: string; models: AIModel[] }
* displayModelName. (Found via live E2E 2026-06-01.)
*/
export function lmsIdOf(model: AIModel): string {
- const raw = ('lmsKey' in model && typeof (model as any).lmsKey === 'string'
- ? (model as any).lmsKey
- : model.name) as 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`.
+ // 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.
+ const raw = 'lmsKey' in model && typeof model.lmsKey === 'string'
+ ? model.lmsKey
+ : model.name
return raw.replace(/^[^:]+::/, '')
}
@@ -582,8 +603,12 @@ export function ModelSelector({ openUpward = false, surface = 'chat' }: ModelSel
// 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
+ // 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) =>
- isLmStudioProvider(('providerName' in m && (m as any).providerName) as string | undefined),
+ isLmStudioProvider(m.providerName),
)
if (hasLmsRows) {
void listLoadedLmStudioModels().then((list) => { if (!cancelled) setLmsLoaded((prev) => sameStringSet(prev, list) ? prev : new Set(list)) }).catch(() => {})
@@ -1054,9 +1079,14 @@ export function ModelSelector({ openUpward = false, surface = 'chat' }: ModelSel
{/* Details on right */}
<div className="flex items-center gap-1 shrink-0">
- {model.type === 'text' && 'details' in model && (model as any).details && (
+ {/* `type === 'text'` verengt auf OllamaModel | CloudModel,
+ `'details' in model` von dort auf OllamaModel — und
+ nur das hat `details`. Der Zugriff braucht deshalb
+ keine Zusicherung; `parameter_size` ist dort als
+ `string` deklariert (types/models.ts:15). */}
+ {model.type === 'text' && 'details' in model && model.details && (
<span className="text-[0.5rem] text-gray-600">
- {(model as any).details.parameter_size}
+ {model.details.parameter_size}
</span>
)}
{/* On/Off VRAM load toggle for LOCAL models — LM Studio
diff --git a/src/components/models/__tests__/tool-badge-three-states.test.ts b/src/components/models/__tests__/tool-badge-three-states.test.ts
index 0bd7120c..8fc0fcb3 100644
--- a/src/components/models/__tests__/tool-badge-three-states.test.ts
+++ b/src/components/models/__tests__/tool-badge-three-states.test.ts
@@ -24,6 +24,7 @@ import { describe, it, expect, vi } from 'vitest'
import { readFileSync } from 'node:fs'
import { fileURLToPath } from 'node:url'
import { dirname, resolve } from 'node:path'
+import type { CloudModel } from '../../../types/models'
vi.mock('../../../api/tool-capability', () => ({ getToolCapability: () => 'unknown' }))
vi.mock('../../../stores/providerStore', () => ({
@@ -37,6 +38,31 @@ const src = readFileSync(
'utf8',
)
+/**
+ * Ein echtes `CloudModel`, kein `as any`.
+ *
+ * Hier stand dreimal `{ name: 'x', type: 'text' } as any`. Das erfuellt KEINES
+ * der vier Glieder von `AIModel` — es fehlen `model`, `size`, `provider`,
+ * `providerName` —, und die Zusicherung hat genau das verdeckt. `toolBadgeTitle`
+ * nimmt `AIModel`; wenn der Test ihm etwas anderes gibt, prueft er eine
+ * Signatur, die es nicht gibt.
+ *
+ * `CloudModel` ist das schmalste der vier Glieder und deshalb das ehrliche
+ * Stellvertreterobjekt. Gelesen wird von `toolBadgeTitle` ohnehin nur
+ * `contextLength` (ModelSelector.tsx:429) — dass der Rest jetzt trotzdem stimmt,
+ * ist der Punkt: faellt ein Pflichtfeld weg oder aendert sich sein Typ, sagt es
+ * `tsc`, statt dass ein `any` weiter zustimmt.
+ */
+const model = (over: Partial<CloudModel> = {}): CloudModel => ({
+ name: 'x',
+ model: 'x',
+ size: 0,
+ type: 'text',
+ provider: 'openai',
+ providerName: 'X',
+ ...over,
+})
+
describe('a local model that declares no native tools is still tool capable', () => {
it('resolves to hermes, not none', () => {
expect(resolveToolSupport({ name: 'hf.co/DevQuasar/huihui-ai.Qwen3-4B-abliterated-GGUF:Q4_K_M', supportsTools: false }))
@@ -83,21 +109,21 @@ describe('the badge asks resolveToolSupport instead of concluding on its own', (
describe('the tooltip says HOW, so the dimmer wrench is explainable', () => {
it('hermes is described as going through the prompt', async () => {
const { toolBadgeTitle } = await import('../ModelSelector')
- const m = { name: 'x', type: 'text' } as any
+ const m = model()
expect(toolBadgeTitle(m, 'hermes')).toMatch(/through the prompt/i)
expect(toolBadgeTitle(m, 'hermes')).toMatch(/Agent and Code work/i)
})
it('native keeps the plain wording', async () => {
const { toolBadgeTitle } = await import('../ModelSelector')
- const m = { name: 'x', type: 'text' } as any
+ const m = model()
expect(toolBadgeTitle(m, 'native')).toMatch(/Supports tool calling/i)
expect(toolBadgeTitle(m, 'native')).not.toMatch(/through the prompt/i)
})
it('the tight-context warning survives on both paths', async () => {
const { toolBadgeTitle } = await import('../ModelSelector')
- const tight = { name: 'x', type: 'text', contextLength: 4096 } as any
+ const tight = model({ contextLength: 4096 })
expect(toolBadgeTitle(tight, 'native')).toMatch(/too small/i)
expect(toolBadgeTitle(tight, 'hermes')).toMatch(/too small/i)
// The hermes wording must still be in there, not replaced by the warning.
diff --git a/src/components/onboarding/Onboarding.tsx b/src/components/onboarding/Onboarding.tsx
index 6eba9393..04a7e10c 100644
--- a/src/components/onboarding/Onboarding.tsx
+++ b/src/components/onboarding/Onboarding.tsx
@@ -24,7 +24,9 @@ import { useReleaseNotesStore } from '../../stores/releaseNotesStore'
import { wizardProgress, workStepsFor, type Step } from './wizard-steps'
import {
installerReducer, IDLE_INSTALLER, isRunning, isReady, elapsedSeconds, formatElapsed, lastLog,
+ type InstallerStatusResponse,
} from './installer-state'
+import type { LmStudioServerStatus } from '../models/ModelSelector'
// Bug (h): the dedicated 'theme' onboarding step was removed because users
// kept ending up on Light by accident, and the project standard is "dark
@@ -39,7 +41,7 @@ import {
// zusammen mit der Unterscheidung zwischen einem Bildschirm und einem
// Arbeitsschritt, die dieser Datei bisher fehlte. Der Typ wird hier
// re-exportiert, damit die 60 Fundstellen unten unveraendert bleiben.
-const isTauri = typeof window !== 'undefined' && !!(window as any).__TAURI_INTERNALS__
+const isTauri = typeof window !== 'undefined' && !!window.__TAURI_INTERNALS__
/* ── Local backend info for the "nothing found" state ──────── */
interface LocalBackendInfo {
@@ -409,7 +411,7 @@ export function Onboarding() {
// they obviously *have* LM Studio, regardless of whether our path
// scan turned up lms.exe (techx69's system-wide install reproed this).
try {
- const status: any = await backendCall('lmstudio_server_status')
+ const status = await backendCall<LmStudioServerStatus>('lmstudio_server_status')
const offline = status?.lms_present && !status?.running
const softDetect = status?.models_detected && !status?.running
if (offline || softDetect) {
@@ -728,7 +730,7 @@ export function Onboarding() {
return await new Promise<boolean>((resolve) => {
const poll = setInterval(async () => {
try {
- const status: any = await backendCall('install_python_status')
+ const status = await backendCall<InstallerStatusResponse>('install_python_status')
pythonDo({ type: 'progress', status: status.status, logs: status.logs || [] })
if (status.status === 'complete' || status.status === 'already_installed') {
clearInterval(poll)
@@ -998,7 +1000,7 @@ export function Onboarding() {
await backendCall('install_ollama')
const poll = setInterval(async () => {
try {
- const s: any = await backendCall('install_ollama_status')
+ const s = await backendCall<InstallerStatusResponse>('install_ollama_status')
ollamaDo({
type: 'progress',
status: s.status || '',
@@ -1101,7 +1103,7 @@ export function Onboarding() {
await backendCall('install_lmstudio')
const poll = setInterval(async () => {
try {
- const s: any = await backendCall('install_lmstudio_status')
+ const s = await backendCall<InstallerStatusResponse>('install_lmstudio_status')
lmstudioDo({
type: 'progress',
status: s.status || '',
@@ -1394,7 +1396,7 @@ export function Onboarding() {
// Poll installation status
const poll = setInterval(async () => {
try {
- const status: any = await backendCall('install_comfyui_status')
+ const status = await backendCall<InstallerStatusResponse>('install_comfyui_status')
comfyDo({
type: 'progress',
status: status.status,
diff --git a/src/components/onboarding/installer-state.ts b/src/components/onboarding/installer-state.ts
index 8bbb0c55..6c847502 100644
--- a/src/components/onboarding/installer-state.ts
+++ b/src/components/onboarding/installer-state.ts
@@ -46,6 +46,52 @@
* eine eigene Zeile, die genau einmal (im Python-Pfad) fehlte.
*/
+/**
+ * Was ein `*_status`-Poll zurueckgibt — die EINGABE dieser Zustandsmaschine.
+ *
+ * Vier Befehle liefern exakt dieselben fuenf Schluessel, weil sie auf der
+ * Rust-Seite denselben `InstallState` serialisieren (`src-tauri/src/state.rs:54`):
+ *
+ * install_comfyui_status src-tauri/src/commands/install.rs:1732
+ * install_python_status src-tauri/src/commands/install.rs:3870
+ * install_ollama_status src-tauri/src/commands/install.rs:2787
+ * install_lmstudio_status src-tauri/src/commands/install.rs:3324
+ *
+ * An acht Stellen in `Onboarding.tsx` und `SettingsPage.tsx` stand dafuer
+ * `const s: any = await backendCall(...)`.
+ *
+ * ── Warum drei Felder optional sind und zwei nicht ────────────────────────
+ *
+ * Nicht geraten, sondern an BEIDEN Backends nachgesehen. Die Rust-Seite baut
+ * alle fuenf immer (`serde_json::json!`, kein `skip_serializing_if`). Der
+ * Dev-Server, den der Browser-Modus statt Tauri anspricht, tut das NICHT: sein
+ * `/local-api/install-comfyui` (`dev-server/comfy.ts:333`) antwortet mit
+ * `{ status, error, logs }` — die drei Download-Zaehler fehlen dort.
+ *
+ * Deshalb: `status` und `logs` verpflichtend (beide Seiten senden sie immer),
+ * die drei Zaehler optional (eine Seite laesst sie weg). Wer sie liest, muss
+ * den Fall behandeln — und alle acht Aufrufer taten das laengst mit `|| 0`,
+ * nur konnte man es unter `any` nicht nachpruefen.
+ *
+ * `error` ist der umgekehrte Fall: nur der Dev-Server sendet es. Es steht hier,
+ * damit die Divergenz aufgeschrieben ist und nicht wieder gesucht werden muss.
+ */
+export interface InstallerStatusResponse {
+ /** 'idle' | 'downloading' | 'installing' | 'complete' | 'error' | … — die
+ * Rust-Seite setzt einen freien String, und die Aufrufer vergleichen ihn mit
+ * je eigenen Werten (`'cancelled'` in SettingsPage, `'already_installed'` im
+ * Python-Pfad, `'done'` im ComfyUI-Pfad). Eine engere Union waere hier eine
+ * Behauptung ueber Code, der in einer anderen Sprache steht. */
+ status: string
+ logs: string[]
+ /** Nur Tauri. Der Dev-Server laesst die drei weg — siehe oben. */
+ download_progress?: number
+ download_total?: number
+ download_speed?: number
+ /** Nur Dev-Server; die Rust-Seite meldet Fehler als abgelehntes Promise. */
+ error?: string
+}
+
/** Wo ein Installer steht. Vier Zustaende, nicht drei Boolesche. */
export type InstallerPhase = 'idle' | 'running' | 'ready' | 'failed'
diff --git a/src/components/settings/MCPServerSettings.tsx b/src/components/settings/MCPServerSettings.tsx
index c2360a67..cc310204 100644
--- a/src/components/settings/MCPServerSettings.tsx
+++ b/src/components/settings/MCPServerSettings.tsx
@@ -4,9 +4,15 @@ import { Plus, Trash2, Power, PowerOff } from 'lucide-react'
import { useMCPStore } from '../../stores/mcpStore'
import { toolRegistry } from '../../api/mcp'
import type { MCPServerConfig } from '../../api/mcp/types'
+// `import type` und nicht `import`: die Klasse wird unten bewusst dynamisch
+// geladen, damit der Tauri-Import im Dev-Modus nicht mitkommt. Ein Typ-Import
+// wird beim Uebersetzen geloescht und erzeugt keine Laufzeit-Abhaengigkeit —
+// er kostet also nichts und deckt dafuer `client.disconnect()` mit ab, das
+// unter `any` ungeprueft war.
+import type { MCPExternalClient } from '../../api/mcp/external-client'
// Active client instances (lazy-loaded to avoid Tauri import in dev mode)
-const clients = new Map<string, any>()
+const clients = new Map<string, MCPExternalClient>()
export function MCPServerSettings() {
const { servers, connectedServers, serverTools, addServer, removeServer, setConnected, setServerTools, clearServerTools } = useMCPStore()
diff --git a/src/components/settings/ProviderConfig.tsx b/src/components/settings/ProviderConfig.tsx
index 57a4dd45..54e0885a 100644
--- a/src/components/settings/ProviderConfig.tsx
+++ b/src/components/settings/ProviderConfig.tsx
@@ -21,7 +21,7 @@ import { diagnoseBuiltinEngine, readBuiltinSlotStatus } from '../../api/builtin-
import type { SlotStatus } from '../../lib/builtin-slot-status'
import type { ProviderId, ProviderConfig } from '../../api/providers/types'
-const isTauri = typeof window !== 'undefined' && !!(window as any).__TAURI_INTERNALS__
+const isTauri = typeof window !== 'undefined' && !!window.__TAURI_INTERNALS__
/** What a slot in the provider list may show and let the user change. */
export interface SlotView {
diff --git a/src/components/settings/SettingsPage.tsx b/src/components/settings/SettingsPage.tsx
index 19f518fb..c0c4fe57 100644
--- a/src/components/settings/SettingsPage.tsx
+++ b/src/components/settings/SettingsPage.tsx
@@ -1,5 +1,6 @@
import { useState, useEffect, useRef, type ReactNode, type ChangeEvent } from 'react'
import { withInstallerOutput, withDetail } from '../../lib/error-text'
+import type { InstallerStatusResponse } from '../onboarding/installer-state'
import { ArrowLeft, RotateCcw, Sun, Moon, Check, Loader2, Shield, ChevronRight, GraduationCap, Lock, Sliders, Plug, Bot, Phone, User, Download, AlertTriangle } from 'lucide-react'
import { motion, AnimatePresence } from 'framer-motion'
import { SETTINGS_TAB_RESET_KEYS, type SettingsTab } from '../../lib/settings-reset'
@@ -373,8 +374,54 @@ function ImportLocalModels() {
// ── ComfyUI Settings ────────────────────────────────────────────
+/**
+ * Antwort von `comfyui_status` (`src-tauri/src/commands/process.rs:1989`).
+ *
+ * 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
+ * `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.
+ */
+interface ComfyStatusResponse {
+ running: boolean
+ found: boolean
+ /** Tauri sendet immer; der Dev-Server nur `running`/`starting`/`found`/`path`. */
+ starting?: boolean
+ stalled?: boolean
+ complete?: boolean
+ /** `null`, solange kein Pfad gespeichert ist — auch bei `found: true`. */
+ path?: string | null
+ port?: number
+ host?: string
+ isLocal?: boolean
+}
+
+/** Antwort von `comfyui_last_output` (`process.rs:1968`). Alle drei Schluessel
+ * immer gesetzt; `lines` ist `[]` statt `null`, wenn nichts anliegt. Im
+ * Browser-Modus existiert die Route nicht, der Aufruf wirft dann. */
+interface ComfyLastOutput {
+ lines: string[]
+ exited: boolean
+ envBroken: boolean
+}
+
+/** Antwort von `python_check` (`install.rs:3886`). Der Fehlerzweig schreibt
+ * `path: null` ausdruecklich hin, laesst den Schluessel also nicht weg. */
+interface PythonCheckResponse {
+ available: boolean
+ path: string | null
+}
+
function ComfyUISettings() {
- const [status, setStatus] = useState<{ running: boolean; found: boolean; complete?: boolean; path?: string; port?: number; host?: string; isLocal?: boolean; starting?: boolean; stalled?: boolean } | null>(null)
+ const [status, setStatus] = useState<ComfyStatusResponse | null>(null)
// Why the last start attempt did not stick. The button used to swallow this
// whole (E16): on a box with no ComfyUI python environment, Start answered
// "started", the panel went back to `Stopped`, and six minutes later there
@@ -403,7 +450,7 @@ function ComfyUISettings() {
const check = async () => {
try {
const { backendCall, setComfyPort, setComfyHost } = await import('../../api/backend')
- const s: any = await backendCall('comfyui_status')
+ const s = await backendCall<ComfyStatusResponse>('comfyui_status')
if (!cancelled) {
setStatus(s)
// Mirror backend truth into the frontend URL builder so subsequent
@@ -436,7 +483,7 @@ function ComfyUISettings() {
// does nothing". Look once, a few seconds in, and say what happened.
setTimeout(async () => {
try {
- const out: any = await backendCall('comfyui_last_output')
+ const out = await backendCall<ComfyLastOutput>('comfyui_last_output')
if (out?.exited && Array.isArray(out?.lines) && out.lines.length > 1) {
const { comfyStartupError } = await import('../create/experimental/comfyError')
setStartError(
@@ -463,7 +510,7 @@ function ComfyUISettings() {
await backendCall('repair_comfyui_env')
const poll = setInterval(async () => {
try {
- const data: any = await backendCall('install_comfyui_status')
+ const data = await backendCall<InstallerStatusResponse>('install_comfyui_status')
setInstallLogs(data.logs || [])
setInstallDl({ progress: data.download_progress || 0, total: data.download_total || 0, speed: data.download_speed || 0 })
if (data.status === 'complete') {
@@ -694,7 +741,7 @@ function ComfyUISettings() {
// and the previous run died on the Microsoft Store stub.
let pythonOk = false
try {
- const probe: any = await backendCall('python_check')
+ const probe = await backendCall<PythonCheckResponse>('python_check')
pythonOk = !!probe?.available
} catch { pythonOk = false }
@@ -711,7 +758,7 @@ function ComfyUISettings() {
pythonOk = await new Promise<boolean>((resolve) => {
const poll = setInterval(async () => {
try {
- const data: any = await backendCall('install_python_status')
+ const data = await backendCall<InstallerStatusResponse>('install_python_status')
setInstallLogs(data.logs || [])
if (data.status === 'complete' || data.status === 'already_installed') {
clearInterval(poll); resolve(true)
@@ -739,7 +786,7 @@ function ComfyUISettings() {
await backendCall('install_comfyui', installTarget ? { installPath: installTarget } : {})
const poll = setInterval(async () => {
try {
- const data: any = await backendCall('install_comfyui_status')
+ const data = await backendCall<InstallerStatusResponse>('install_comfyui_status')
setInstallLogs(data.logs || [])
setInstallDl({ progress: data.download_progress || 0, total: data.download_total || 0, speed: data.download_speed || 0 })
if (data.status === 'complete') {
@@ -777,7 +824,7 @@ function ComfyUISettings() {
await backendCall('update_comfyui')
const poll = setInterval(async () => {
try {
- const data: any = await backendCall('install_comfyui_status')
+ const data = await backendCall<InstallerStatusResponse>('install_comfyui_status')
setInstallLogs(data.logs || [])
setInstallDl({ progress: data.download_progress || 0, total: data.download_total || 0, speed: data.download_speed || 0 })
if (data.status === 'complete') {
diff --git a/src/components/settings/SpeechSettings.tsx b/src/components/settings/SpeechSettings.tsx
index 80269981..1415dfe5 100644
--- a/src/components/settings/SpeechSettings.tsx
+++ b/src/components/settings/SpeechSettings.tsx
@@ -150,7 +150,10 @@ export function SpeechSettings() {
// Poll install status until it leaves "installing" (cap ~10 min — a
// model download on a slow link can be lengthy; pip itself is quick).
const start = Date.now()
- // eslint-disable-next-line no-constant-condition
+ // Endlosschleife mit Ausstiegen im Rumpf (complete / error / 10-min-Kappe).
+ // Hier stand eine Unterdrueckung von `no-constant-condition`. Die Regel
+ // laeuft in diesem Baum mit `checkLoops: 'allExceptWhileTrue'` und hat
+ // genau diese Form nie beanstandet — die Zeile unterdrueckte nichts.
while (true) {
await new Promise((r) => setTimeout(r, 2000))
let s: { status?: string; error?: string } = {}
@@ -183,7 +186,10 @@ export function SpeechSettings() {
try {
await backendCall('install_tts')
const start = Date.now()
- // eslint-disable-next-line no-constant-condition
+ // Endlosschleife mit Ausstiegen im Rumpf (complete / error / 10-min-Kappe).
+ // Hier stand eine Unterdrueckung von `no-constant-condition`. Die Regel
+ // laeuft in diesem Baum mit `checkLoops: 'allExceptWhileTrue'` und hat
+ // genau diese Form nie beanstandet — die Zeile unterdrueckte nichts.
while (true) {
await new Promise((r) => setTimeout(r, 2000))
let s: { status?: string; error?: string } = {}
diff --git a/src/components/ui/GlowButton.tsx b/src/components/ui/GlowButton.tsx
index f40b57ca..e0cce2ba 100644
--- a/src/components/ui/GlowButton.tsx
+++ b/src/components/ui/GlowButton.tsx
@@ -15,7 +15,7 @@ export function GlowButton({ children, variant = 'primary', className = '', ...p
return (
<button
className={`px-4 py-2 rounded-lg border font-medium transition-all duration-300 cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed ${variants[variant]} ${className}`}
- {...(props as any)}
+ {...props}
>
{children}
</button>