tinyhumansai/openhuman · error

unknown mode ' ', expected simple|aggressive

Error message

unknown mode '{other}', expected simple|aggressive

What it means

Enum validation of the --mode value in `subconscious tick`. After parsing, the mode string is matched against the config's subconscious_mode variants; only `simple` and `aggressive` exist. Any other value (case-sensitive, so `Simple` also fails) is rejected before the heartbeat config is mutated.

Solutions

  1. Pass exactly `--mode simple` or `--mode aggressive` (lowercase).
  2. Omit --mode to keep the currently configured mode.
  3. Check for stray whitespace or capitalisation in the value.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/core/subconscious_cli.rs:87 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/9b015bb382b1b159. Report an issue: GitHub.

Appendix: source

Thrown at src/core/subconscious_cli.rs:87

fn run_tick(args: &[String]) -> Result<()> {
    let flags = parse_tick_flags(args)?;

    let rt = tokio::runtime::Runtime::new()?;
    rt.block_on(async {
        let mut config = crate::openhuman::config::Config::load_or_init()
            .await
            .map_err(|e| anyhow!("config load failed: {e}"))?;

        if let Some(ws) = &flags.workspace {
            config.workspace_dir = ws.clone();
        }

        if let Some(mode_str) = &flags.mode {
            config.heartbeat.subconscious_mode = match mode_str.as_str() {
                "simple" => crate::openhuman::config::schema::SubconsciousMode::Simple,
                "aggressive" => crate::openhuman::config::schema::SubconsciousMode::Aggressive,
                other => {
                    return Err(anyhow!(
                        "unknown mode '{other}', expected simple|aggressive"
                    ))
                }
            };
            config.heartbeat.enabled = true;
            config.heartbeat.inference_enabled = true;
        }

        // Ensure subconscious is enabled
        if !config.heartbeat.enabled || !config.heartbeat.inference_enabled {
            config.heartbeat.enabled = true;
            config.heartbeat.inference_enabled = true;
            if !config.heartbeat.subconscious_mode.is_enabled() {
                config.heartbeat.subconscious_mode =
                    crate::openhuman::config::schema::SubconsciousMode::Simple;
            }
        }

View on GitHub (pinned to 7491200858)