Hmbown/CodeWhale · error

expected speech command

Error message

expected speech command

What it means

Test-only panic in speech_command_parses_cli_passthrough_smoke: Cli::try_parse_from succeeded but the parsed subcommand was not Commands::Speech, meaning the 'speech' CLI verb is not registered or maps to a different command enum variant.

Solutions

  1. Register the Speech variant on the Commands enum used by the TUI Cli
  2. Check clap derive attributes so 'speech' routes to Commands::Speech
  3. Verify the subcommand name string matches the enum variant's clap naming
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at crates/tui/src/lib.rs:7837 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Hmbown/CodeWhale@433685b202 (2026-09-15). Data as JSON: /api/errors/1aaf72588da33dec. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/lib.rs:7837

    #[test]
    fn speech_command_parses_cli_passthrough_smoke() {
        let cli = Cli::try_parse_from([
            "codewhale-tui",
            "speech",
            "hello",
            "--model",
            "tts",
            "--format",
            "pcm",
            "--output-dir",
            "audio",
            "--voice",
            "Mia",
        ])
        .expect("speech command parses");

        let Some(Commands::Speech(args)) = cli.command else {
            panic!("expected speech command");
        };
        assert_eq!(args.text, "hello");
        assert_eq!(
            infer_speech_model(args.model.as_deref(), false, false),
            "mimo-v2.5-tts"
        );
        assert_eq!(
            normalize_speech_format(&args.format).as_deref(),
            Some("pcm16")
        );
        assert_eq!(args.output_dir, Some(PathBuf::from("audio")));
        assert_eq!(args.voice.as_deref(), Some("Mia"));
    }
}

/// Test API connectivity by making a minimal request
async fn test_api_connectivity(config: &Config) -> Result<()> {
    use crate::client::DeepSeekClient;

View on GitHub (pinned to 433685b202)