{"record":{"id":"058bfc688ff67469","repo":"tinyhumansai/openhuman","slug":"content-is-empty","errorCode":null,"errorMessage":"content is empty","messagePattern":"content is empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/memory/tree/tree_runtime/cli.rs","lineNumber":149,"sourceCode":"            let mut buf = String::new();\n            std::io::stdin()\n                .read_to_string(&mut buf)\n                .map_err(|e| anyhow::anyhow!(\"failed to read stdin: {e}\"))?;\n            buf\n        } else {\n            std::fs::read_to_string(path)\n                .map_err(|e| anyhow::anyhow!(\"failed to read '{}': {e}\", path))?\n        }\n    } else if let Some(ref text) = opts.content {\n        text.clone()\n    } else {\n        return Err(anyhow::anyhow!(\n            \"either --content or --file is required. Run `openhuman tree-summarizer ingest --help`.\"\n        ));\n    };\n\n    if content.trim().is_empty() {\n        return Err(anyhow::anyhow!(\"content is empty\"));\n    }\n\n    init_logging(opts.verbose);\n\n    let rt = build_runtime()?;\n    rt.block_on(async {\n        let config = load_config().await?;\n        let outcome = crate::openhuman::memory::tree::tree_runtime::rpc::tree_summarizer_ingest(\n            &config, namespace, &content, None, None,\n        )\n        .await\n        .map_err(anyhow::Error::msg)?;\n\n        println!(\n            \"{}\",\n            serde_json::to_string_pretty(&outcome.value)\n                .unwrap_or_else(|_| format!(\"{:?}\", outcome.value))\n        );","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/memory/tree/tree_runtime/cli.rs#L131-L167","documentation":"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.","triggerScenarios":"Thrown at src/openhuman/memory/tree/tree_runtime/cli.rs:149 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the input actually contains text: `wc -c <file>` to confirm it is not zero bytes","If reading from stdin, confirm the upstream command produced output","Trim only whitespace-padded input — a string of just whitespace still counts as empty here"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}