tinyhumansai/openhuman · error
--namespace is required for clear
Error message
--namespace is required for clear
What it means
Post-parse required-argument check in `openhuman memory clear`. The namespace is optional while parsing and unwrapped afterwards; without it the command refuses to run because clear is destructive and must be scoped to an explicit namespace — it will never clear everything by default.
Solutions
- Specify the target: `openhuman memory clear --namespace <ns>`.
- List namespaces with `openhuman memory namespaces` to pick the right one.
- Add -v to get confirmation output once the namespace is supplied.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/core/memory_cli.rs:418 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/f6009b36a0dc7e45.
Report an issue: GitHub.
Appendix: source
Thrown at src/core/memory_cli.rs:418
while i < args.len() {
match args[i].as_str() {
"--namespace" | "-n" => {
namespace = Some(next_arg(args, &mut i, "--namespace")?);
}
"-v" | "--verbose" => {
verbose = true;
i += 1;
}
"-h" | "--help" => {
println!("Usage: openhuman memory clear --namespace <ns> [-v]");
return Ok(());
}
other => return Err(anyhow::anyhow!("unknown clear arg: {other}")),
}
}
let namespace =
namespace.ok_or_else(|| anyhow::anyhow!("--namespace is required for clear"))?;
crate::core::logging::init_for_cli_run(verbose, crate::core::logging::CliLogDefault::Global);
let rt = tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()?;
rt.block_on(async {
let client = create_memory_client("clear").await?;
client
.clear_namespace(&namespace)
.await
.map_err(anyhow::Error::msg)?;
eprintln!("[memory:cli] namespace '{namespace}' cleared");
Ok::<_, anyhow::Error>(())
})?;
Ok(())View on GitHub (pinned to 7491200858)