{"record":{"id":"fa867341fad19274","repo":"can1357/oh-my-pi","slug":"failed-to-download-speech-model-spec-repo-de","errorCode":null,"errorMessage":"Failed to download speech model (${spec.repo})${detail}","messagePattern":"Failed to download speech model \\((.+?)\\)(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/stt/downloader.ts","lineNumber":121,"sourceCode":"\t\t\t\tloaded += file.loaded;\n\t\t\t\ttotal += file.total;\n\t\t\t}\n\t\t\tconst settled = event.status === \"ready\" || event.status === \"done\";\n\t\t\tconst percent = total > 0 ? Math.min(100, Math.round((loaded / total) * 100)) : settled ? 100 : 0;\n\t\t\tonProgress?.({\n\t\t\t\tstatus: event.status,\n\t\t\t\tpercent,\n\t\t\t\tloaded,\n\t\t\t\ttotal,\n\t\t\t\tfile: event.file,\n\t\t\t\trepo: spec.repo,\n\t\t\t\tlabel: spec.label,\n\t\t\t});\n\t\t},\n\t});\n\tif (!result.ok) {\n\t\tconst detail = result.error ? `: ${result.error}` : \". Check your network connection.\";\n\t\tthrow new Error(`Failed to download speech model (${spec.repo})${detail}`);\n\t}\n\tif (!(await isSttModelCached(spec.key))) {\n\t\tthrow new Error(`Speech model download finished without required files (${spec.repo}).`);\n\t}\n}\n\n// ── Public API ─────────────────────────────────────────────────────\n\nexport async function ensureSTTDependencies(options?: EnsureOptions): Promise<void> {\n\tawait downloadSttModel(\n\t\tresolveSttModelSpec(options?.modelName).key,\n\t\tprogress => {\n\t\t\tconst stage =\n\t\t\t\tprogress.status === \"ready\" || progress.status === \"done\"\n\t\t\t\t\t? `Speech model ${progress.label} ready`\n\t\t\t\t\t: `Downloading speech model ${progress.label}`;\n\t\t\toptions?.onProgress?.({ stage, percent: progress.percent });\n\t\t},","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/stt/downloader.ts#L103-L139","documentation":"downloadSttModel drives the speech worker to download/warm the selected model and resolves only when the worker reports success. If the worker reports result.ok === false, the error is wrapped as 'Failed to download speech model (<repo>)' with either the worker's error text or a generic network hint appended.","triggerScenarios":"Any worker-side failure during model download/load: HTTP failures fetching model files, native runtime resolution failure, interrupted downloads, or process crashes — surfaced through sttClient.downloadModel with ok=false.","commonSituations":"No internet or behind a blocking corporate proxy, Hugging Face outages/rate limits, disk full in the model cache, antivirus removing native modules, or an unsupported platform for the GPU path.","solutions":["Read the appended detail: a specific error text points at the root cause; the 'Check your network connection' hint means the worker failed without a message (usually connectivity).","Verify connectivity to huggingface.co and retry.","Free disk space / check permissions on the tiny-models cache directory.","Clear the partial model cache directory for that repo and retry.","Run with logging to see the underlying worker error for native-module or device failures."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import { isSttModelCached } from \"./downloader\";\nif (await isSttModelCached(key)) return; // already present, skip download","typeGuard":null,"tryCatchPattern":"try { await downloadSttModel(key, onProgress, { signal }); } catch (err) { log.error(\"STT model download failed\", { key, err }); /* check connectivity/disk before retrying */ }","preventionTips":["Check network access to huggingface.co before initiating large downloads.","Ensure enough free disk space in the tiny-models cache directory.","Surface the error's appended detail — it usually names the root cause.","Abort cleanly with the provided signal so partial downloads don't linger."],"tags":["network","download","stt","model"],"backgroundTag":"model-download-failed","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}