tinyhumansai/openhuman · error

failed to build tokio runtime: {e}

Error message

failed to build tokio runtime: {e}

What it means

The `build_runtime` helper in the tree-summarizer CLI failed to construct a multi-thread tokio runtime via `Builder::new_multi_thread().enable_all().build()`. This is an infrastructure-level failure that fires when the OS refuses to spawn worker threads (thread/resource limits hit, e.g. `ulimit` or a container with a low pids cap) or the runtime's internal machinery cannot initialize. It is not caused by user input.

Source

Thrown at src/openhuman/memory/tree/tree_runtime/cli.rs:340

        println!(
            "{}",
            serde_json::to_string_pretty(&outcome.value)
                .unwrap_or_else(|_| format!("{:?}", outcome.value))
        );
        Ok(())
    })
}

// ---------------------------------------------------------------------------
// Helpers
// ---------------------------------------------------------------------------

fn build_runtime() -> Result<tokio::runtime::Runtime> {
    tokio::runtime::Builder::new_multi_thread()
        .enable_all()
        .build()
        .map_err(|e| anyhow::anyhow!("failed to build tokio runtime: {e}"))
}

async fn load_config() -> Result<crate::openhuman::config::Config> {
    let mut config = crate::openhuman::config::Config::load_or_init()
        .await
        .unwrap_or_default();
    config.apply_env_overrides();
    Ok(config)
}

fn init_logging(verbose: bool) {
    if !verbose && std::env::var_os("RUST_LOG").is_none() {
        unsafe { std::env::set_var("RUST_LOG", "warn") };
    }
    crate::core::logging::init_for_cli_run(verbose, crate::core::logging::CliLogDefault::Global);
}

fn is_help(value: &str) -> bool {

View on GitHub (pinned to 7491200858)

Solutions

  1. Check thread/resource limits: `ulimit -u` and, in containers, the pids cgroup limit
  2. Free system resources or reduce concurrent workloads, then retry the command
  3. As a diagnostic, try the same command on a less constrained host to isolate the environment
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/openhuman/memory/tree/tree_runtime/cli.rs:340 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/f0d41e8adfe18467. Report an issue: GitHub.