tinyhumansai/openhuman · error

--namespace is required for query

Error message

--namespace is required for query

What it means

Post-parse required-argument check in `openhuman memory query`. After the arg loop finishes, the optional namespace is unwrapped via ok_or_else; if the user never passed --namespace/-n, the command cannot scope the memory query and fails before any RPC call is made.

Solutions

  1. Supply a namespace: `openhuman memory query --namespace <ns> --query <text>`.
  2. List valid namespaces first with `openhuman memory namespaces`.
  3. Use -n as the short form of --namespace.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/core/memory_cli.rs:342 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/7016742d26c4c2c8. Report an issue: GitHub.

Appendix: source

Thrown at src/core/memory_cli.rs:342

                    .parse::<u32>()
                    .map_err(|e| anyhow::anyhow!("invalid --limit: {e}"))?;
            }
            "-v" | "--verbose" => {
                verbose = true;
                i += 1;
            }
            "-h" | "--help" => {
                println!(
                    "Usage: openhuman memory query --namespace <ns> --query <text> [--limit <n>] [-v]"
                );
                return Ok(());
            }
            other => return Err(anyhow::anyhow!("unknown query arg: {other}")),
        }
    }

    let namespace =
        namespace.ok_or_else(|| anyhow::anyhow!("--namespace is required for query"))?;
    let query = query.ok_or_else(|| anyhow::anyhow!("--query is required"))?;

    crate::core::logging::init_for_cli_run(verbose, crate::core::logging::CliLogDefault::Global);

    let rt = tokio::runtime::Builder::new_multi_thread()
        .enable_all()
        .build()?;

    let result = rt.block_on(async {
        let client = create_memory_client("query").await?;
        client
            .query_namespace(&namespace, &query, limit)
            .await
            .map_err(anyhow::Error::msg)
    })?;

    println!("{result}");
    Ok(())

View on GitHub (pinned to 7491200858)