{"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":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/client.rs","lineNumber":2368,"sourceCode":"        }\n\n        let audio_format = normalize_audio_format(&request.audio_format);\n        let model = wire_model_for_provider_route(self.api_provider, &self.base_url, &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":2350,"sourceCodeEnd":2386,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/8880682c63083a91624de936797efa3ce9e498fd/crates/tui/src/client.rs#L2350-L2386","documentation":"Model-specific validation in `synthesize_speech`: when the (lowercased) model id contains `voicedesign`, the request must include an `instruction` — a user-message that describes the voice to design and is not spoken verbatim. Without it the MiMo voice-design flow has nothing to synthesize a voice from, so the client rejects the call locally.","triggerScenarios":"Calling speech synthesis with a model like `mimo-voicedesign-*` while omitting both `--voice-prompt` and `--instruction`; passing an instruction that is only whitespace (it is trimmed and filtered, so it counts as absent).","commonSituations":"Selecting the voice-design model by mistake when intending plain TTS; assuming the instruction is optional for all voice models; copy-pasting a command template that only worked for non-voicedesign models.","solutions":["Add a voice design prompt: `--voice-prompt \"warm middle-aged male, calm documentary tone\"` (or the equivalent `--instruction`).","If you did not want voice design at all, switch to a plain TTS model id (one without `voicedesign`).","Ensure the instruction is non-blank — a whitespace-only value is filtered out and triggers this same error."],"exampleFix":"# before\n/speech --model mimo-voicedesign-v1 \"hello world\"\n# after\n/speech --model mimo-voicedesign-v1 --voice-prompt \"warm narrator, calm tone\" \"hello world\"","handlingStrategy":"validation","validationCode":"// Mirror the client's rule before sending.\nfn voicedesign_needs_instruction(model: &str, instruction: Option<&str>) -> bool {\n    model.to_ascii_lowercase().contains(\"voicedesign\")\n        && instruction.map(str::trim).filter(|s| !s.is_empty()).is_none()\n}","typeGuard":"enum SpeechModelKind { Plain, VoiceDesign, VoiceClone }\nfn speech_model_kind(model: &str) -> SpeechModelKind {\n    let m = model.to_ascii_lowercase();\n    if m.contains(\"voicedesign\") { SpeechModelKind::VoiceDesign }\n    else if m.contains(\"voiceclone\") { SpeechModelKind::VoiceClone }\n    else { SpeechModelKind::Plain }\n}","tryCatchPattern":null,"preventionTips":["Prompt for a voice description interactively whenever a voicedesign model is selected.","Ship command templates per model family (plain / voicedesign / voiceclone) so required flags are obvious.","Trim and validate instructions client-side — whitespace-only values count as absent."],"tags":["speech","tts","validation","voice-design","xiaomi-mimo"],"backgroundTag":null,"analyzedSha":"8880682c63083a91624de936797efa3ce9e498fd","analyzedAt":"2026-08-16T11:31:27.956Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}