tinyhumansai/openhuman · error

openhuman.threads_create_new failed: {e}

Error message

openhuman.threads_create_new failed: {e}

What it means

The TUI boots the core in-process and calls openhuman.threads_create_new over RPC to get a fresh thread; this fires when that RPC itself errors (core not ready, dispatch failure) after the threads_list fallback also failed to yield an id. The TUI cannot start a session.

Source

Thrown at src/tui/runner.rs:178

            Ok(listed) => {
                if let Some(id) = super::cockpit::array_at(&listed, &["threads", "items"])
                    .first()
                    .and_then(|thread| thread.get("id").or_else(|| thread.get("thread_id")))
                    .and_then(Value::as_str)
                {
                    return Ok(id.to_string());
                }
            }
            Err(error) => {
                log::warn!("[tui] openhuman.threads_list failed: {error} — starting a new thread")
            }
        }
    }

    let created = runtime
        .invoke("openhuman.threads_create_new", json!({}))
        .await
        .map_err(|e| anyhow::anyhow!("openhuman.threads_create_new failed: {e}"))?;
    extract_thread_id(&created).ok_or_else(|| {
        anyhow::anyhow!("openhuman.threads_create_new returned no thread id: {created}")
    })
}

/// Pull a thread id out of a `threads.create_new` / `threads.list` response,
/// tolerant of the `RpcOutcome` log-envelope wrapping (`{result, logs}`) and the
/// `ApiEnvelope` data wrapping (`{data, meta}`).
pub(super) fn extract_thread_id(value: &Value) -> Option<String> {
    // Unwrap the optional `{result, logs}` log envelope first.
    let inner = value.get("result").unwrap_or(value);
    // Then the optional `{data, meta}` ApiEnvelope.
    let payload = inner.get("data").unwrap_or(inner);
    payload
        .get("id")
        .and_then(Value::as_str)
        .map(str::to_string)
}

View on GitHub (pinned to 7491200858)

Solutions

  1. Check core startup logs for why thread creation failed
  2. Retry launching the TUI; verify the threads domain is registered in this build
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at src/tui/runner.rs:178 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/c1000843587201cd. Report an issue: GitHub.