tinyhumansai/openhuman · error

content is empty

Error message

content is empty

What it means

A post-read content guard in the tree-summarizer ingest subcommand: content was resolved (from `--content`, `--file`, or stdin) but the resulting string is empty. This fires when the user passes `--content ""`, points `--file` at a zero-byte file, or pipes an empty stream — there is nothing to summarize, so the tool refuses rather than producing a degenerate summary tree.

Source

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

            let mut buf = String::new();
            std::io::stdin()
                .read_to_string(&mut buf)
                .map_err(|e| anyhow::anyhow!("failed to read stdin: {e}"))?;
            buf
        } else {
            std::fs::read_to_string(path)
                .map_err(|e| anyhow::anyhow!("failed to read '{}': {e}", path))?
        }
    } else if let Some(ref text) = opts.content {
        text.clone()
    } else {
        return Err(anyhow::anyhow!(
            "either --content or --file is required. Run `openhuman tree-summarizer ingest --help`."
        ));
    };

    if content.trim().is_empty() {
        return Err(anyhow::anyhow!("content is empty"));
    }

    init_logging(opts.verbose);

    let rt = build_runtime()?;
    rt.block_on(async {
        let config = load_config().await?;
        let outcome = crate::openhuman::memory::tree::tree_runtime::rpc::tree_summarizer_ingest(
            &config, namespace, &content, None, None,
        )
        .await
        .map_err(anyhow::Error::msg)?;

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

View on GitHub (pinned to 7491200858)

Solutions

  1. Check the input actually contains text: `wc -c <file>` to confirm it is not zero bytes
  2. If reading from stdin, confirm the upstream command produced output
  3. Trim only whitespace-padded input — a string of just whitespace still counts as empty here
Defensive patterns

Strategy: validation

When it happens

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