{"record":{"id":"3071249bca7be251","repo":"Hmbown/CodeWhale","slug":"model-model-requires-a-voice-design-prompt-pa","errorCode":null,"errorMessage":"Model '{model}' requires a voice design prompt. Pass --voice-prompt or --instruction.","messagePattern":"Model '(.+?)' requires a voice design prompt\\. Pass --voice-prompt or --instruction\\.","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/client.rs","lineNumber":3355,"sourceCode":"        }\n\n        let audio_format = normalize_audio_format(&request.audio_format);\n        let model = self.wire_model_for_route(&model);\n        let model_lower = model.to_ascii_lowercase();\n        let instruction = request\n            .instruction\n            .as_deref()\n            .map(str::trim)\n            .filter(|value| !value.is_empty());\n        let voice = request\n            .voice\n            .as_deref()\n            .map(str::trim)\n            .filter(|value| !value.is_empty())\n            .map(str::to_string);\n\n        if model_lower.contains(\"voicedesign\") && instruction.is_none() {\n            anyhow::bail!(\n                \"Model '{model}' requires a voice design prompt. Pass --voice-prompt or --instruction.\"\n            );\n        }\n        if model_lower.contains(\"voiceclone\") && voice.is_none() {\n            anyhow::bail!(\n                \"Model '{model}' requires cloned voice data. Pass --clone-voice <mp3|wav> or --voice <data-uri>.\"\n            );\n        }\n\n        let mut audio = json!({\n            \"format\": audio_format.clone(),\n        });\n        if let Some(voice) = voice.as_deref() {\n            audio[\"voice\"] = json!(voice);\n        }\n\n        let body = build_speech_synthesis_body(&model, &text, instruction, audio);\n","sourceCodeStart":3337,"sourceCodeEnd":3373,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/client.rs#L3337-L3373","documentation":"Xiaomi MiMo 'voicedesign' speech models require a voice design instruction (natural-language prompt describing the voice). If the resolved model name contains 'voicedesign' and no instruction was provided, the client bails pointing at the --voice-prompt / --instruction flags.","triggerScenarios":"Requesting speech synthesis with a model whose lowercased name contains 'voicedesign' while `request.instruction` is None or whitespace after trim/filter.","commonSituations":"Selecting a voicedesign model but omitting the prompt flags in the CLI; a script templating the model but not the instruction; whitespace-only instruction filtered out by the trim check.","solutions":["Pass --voice-prompt (or --instruction) with a non-empty voice description when using a voicedesign model.","Ensure the instruction is not whitespace-only — it is trimmed and empty strings are treated as absent.","Use a non-voicedesign model if you don't need voice design."],"exampleFix":"# before\ncodewhale tts --model milivo-voicedesign \"hello\"\n\n# after\ncodewhale tts --model milivo-voicedesign --voice-prompt \"warm, calm male narrator\" \"hello\"","handlingStrategy":"validation","validationCode":"fn requires_instruction(model: &str) -> bool { model.to_ascii_lowercase().contains(\"voicedesign\") }\nif requires_instruction(&req.model) && req.instruction.as_deref().unwrap_or(\"\").trim().is_empty() {\n    return Err(anyhow::anyhow!(\"voicedesign model requires --voice-prompt\"));\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"requires a voice design prompt\") => {\n        eprintln!(\"Add --voice-prompt \\\"<voice description>\\\" when using a voicedesign model\");\n    }\n    r => r?,\n}","preventionTips":["Require --voice-prompt in the CLI parser whenever the model name contains voicedesign.","Trim instruction inputs before sending; whitespace-only counts as missing.","Document voicedesign model requirements in help text."],"tags":["speech","validation","cli","missing-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}