From 01a75f9edca82c631d2edac83c2f0151a84ce136 Mon Sep 17 00:00:00 2001 From: Phil Larson Date: Wed, 29 Jul 2026 09:15:28 -0700 Subject: [PATCH] fix(desktop): typecheck streamed model downloads (#2493) ## Summary - make the fetch response-body cast explicit across DOM and desktop TypeScript library definitions - preserve the existing async byte-stream runtime behavior ## Test plan - `pnpm --filter @fusion/dashboard exec vitest run src/stt/__tests__/model-manager.test.ts --reporter=dot` - `pnpm --filter @fusion/desktop typecheck` - `pnpm --filter @fusion/dashboard typecheck` - `node scripts/check-changeset-format.mjs` ## Summary by CodeRabbit * **Bug Fixes** * Improved desktop build typechecking for streamed speech-model downloads by refining how streamed response bodies are interpreted for TypeScript. * Preserved runtime behavior, including streaming, integrity/hash checking, file writing, and cancellation handling. * **Maintenance** * Updated the release metadata so this fix is published with the correct patch classification. --- .changeset/desktop-stream-typecheck.md | 6 ++++++ packages/dashboard/src/stt/model-manager.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/desktop-stream-typecheck.md diff --git a/.changeset/desktop-stream-typecheck.md b/.changeset/desktop-stream-typecheck.md new file mode 100644 index 0000000000..071987baa2 --- /dev/null +++ b/.changeset/desktop-stream-typecheck.md @@ -0,0 +1,6 @@ +--- +"@runfusion/fusion": patch +--- +summary: Desktop builds now typecheck streamed speech-model downloads across differing ReadableStream library definitions. +category: fix +dev: Casts the fetch response body through unknown before treating it as an async byte iterable, preserving runtime behavior while satisfying the desktop TypeScript library surface. diff --git a/packages/dashboard/src/stt/model-manager.ts b/packages/dashboard/src/stt/model-manager.ts index a38b5180ea..19b308ef68 100644 --- a/packages/dashboard/src/stt/model-manager.ts +++ b/packages/dashboard/src/stt/model-manager.ts @@ -120,7 +120,7 @@ export function createVoiceModelManager(options: VoiceModelManagerOptions = {}): if (!current(g, signal)) return state; const total = Number(response.headers.get("content-length")) || undefined; const hash = createHash("sha256"); let bytes = 0; - for await (const chunk of response.body as AsyncIterable) { + for await (const chunk of response.body as unknown as AsyncIterable) { if (!current(g, signal)) return state; const buffer = Buffer.from(chunk); hash.update(buffer); await file.write(buffer); if (!current(g, signal)) return state;