{"record":{"id":"d64e06a484d03a48","repo":"can1357/oh-my-pi","slug":"failed-to-download-the-local-text-to-speech-model","errorCode":null,"errorMessage":"Failed to download the local text-to-speech model.","messagePattern":"Failed to download the local text-to-speech model\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/setup-cli.ts","lineNumber":213,"sourceCode":"\t\t\t},\n\t\t\tpick: async () => {\n\t\t\t\tconst chosen = await selectSetupModel(\n\t\t\t\t\t\"Text-to-Speech model\",\n\t\t\t\t\t[...TTS_LOCAL_MODEL_OPTIONS],\n\t\t\t\t\tsettings.get(\"tts.localModel\"),\n\t\t\t\t);\n\t\t\t\tif (chosen === null) return false;\n\t\t\t\tif (isTtsLocalModelKey(chosen)) {\n\t\t\t\t\tsettings.set(\"tts.localModel\", chosen);\n\t\t\t\t\tawait settings.flush();\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t},\n\t\t\tensure: async onProgress => {\n\t\t\t\tconst ok = await downloadTtsModel(settings.get(\"tts.localModel\"), progress =>\n\t\t\t\t\tonProgress({ stage: progress.stage, percent: progress.percent }),\n\t\t\t\t);\n\t\t\t\tif (!ok) throw new Error(\"Failed to download the local text-to-speech model.\");\n\t\t\t},\n\t\t},\n\t];\n}\n\n/**\n * Unified `omp setup speech` flow. Drives every {@link SpeechComponent} through\n * one path: report (`--json`/`--check`) or install (interactive pick + ensure\n * with single-line progress; non-TTY skips pickers and installs configured\n * values).\n */\nasync function handleSpeechSetup(flags: { json?: boolean; check?: boolean }): Promise<void> {\n\tawait Settings.init({ cwd: getProjectDir() });\n\tconst components = buildSpeechComponents();\n\n\tif (flags.json) {\n\t\tconst report: Record<string, { ready: boolean; status: string }> = {};\n\t\tlet allReady = true;","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/setup-cli.ts#L195-L231","documentation":"The speech setup step downloads a local text-to-speech model via `downloadTtsModel`; that helper returns a boolean rather than throwing. A `false` result means the download did not complete, so `buildSpeechComponents`'s `ensure` callback converts it into this user-facing error. Setup aborts without working TTS.","triggerScenarios":"Running `omp` speech/setup flow where `downloadTtsModel(settings.get(\"tts.localModel\"), ...)` returns false: network failure mid-download, invalid or unknown model name in the `tts.localModel` setting, disk full, or the model host unreachable.","commonSituations":"Corporate proxy/firewall blocking the model download URL; misspelled model id in settings; interrupted first-run download leaving an unusable cache; no disk space in the models cache directory.","solutions":["Check network connectivity/proxy settings and retry the setup","Verify the `tts.localModel` setting names a valid downloadable model","Free disk space in the model cache directory and retry","Fall back to a different TTS provider in settings if local download can't work in your environment"],"exampleFix":"// before\nsettings.set(\"tts.localModel\", \"whisper-tiny-en\");   // invalid id\n// after\nsettings.set(\"tts.localModel\", \"<valid-model-key-from-catalog>\");  // then re-run setup","handlingStrategy":"retry","validationCode":"const modelId = settings.get(\"tts.localModel\");\nif (!modelId || typeof modelId !== \"string\") {\n  console.error(\"tts.localModel is not configured — set a valid local TTS model first.\");\n}","typeGuard":null,"tryCatchPattern":"let ok = false;\nfor (let attempt = 0; attempt < 3 && !ok; attempt++) {\n  ok = await downloadTtsModel(settings.get(\"tts.localModel\"), onProgress);\n  if (!ok) await Bun.sleep(2000 * (attempt + 1));\n}\nif (!ok) throw new Error(\"Failed to download the local text-to-speech model.\");","preventionTips":["Check network/proxy reachability of the model host before setup","Validate the tts.localModel setting against the supported model list","Ensure sufficient free disk space in the model cache directory"],"tags":["download","network","tts","setup"],"backgroundTag":"model-download-failed","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}