tinyhumansai/openhuman · error

invalid --mode '{other}', expected tap|push

Error message

invalid --mode '{other}', expected tap|push

What it means

After CLI parsing, the --mode value is matched against the two activation modes; anything other than tap/push (e.g. "hold" or a typo) reaches this error before the dictation listener starts.

Source

Thrown at src/openhuman/voice/cli.rs:91

    let rt = tokio::runtime::Builder::new_multi_thread()
        .enable_all()
        .build()?;

    rt.block_on(async {
        let mut config = match crate::openhuman::config::Config::load_or_init().await {
            Ok(cfg) => cfg,
            Err(e) => {
                log::warn!("[voice-cli] config load failed, using defaults: {e}");
                crate::openhuman::config::Config::default()
            }
        };
        config.apply_env_overrides();

        let activation_mode = match mode.as_deref() {
            Some("tap") => ActivationMode::Tap,
            Some("push") | None => ActivationMode::Push,
            Some(other) => return Err(anyhow!("invalid --mode '{other}', expected tap|push")),
        };

        let server_config = VoiceServerConfig {
            hotkey: hotkey.unwrap_or_else(|| config.voice_server.hotkey.clone()),
            activation_mode,
            skip_cleanup,
            context: None,
            min_duration_secs: config.voice_server.min_duration_secs,
            silence_threshold: config.voice_server.silence_threshold,
            custom_dictionary: config.voice_server.custom_dictionary.clone(),
        };

        run_standalone(config, server_config)
            .await
            .map_err(anyhow::Error::msg)
    })?;

    Ok(())

View on GitHub (pinned to 7491200858)

Solutions

  1. Use `--mode tap` or `--mode push`, or omit --mode for the push default
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/voice/cli.rs:91 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/3f4a65cfc97a386a. Report an issue: GitHub.