tinyhumansai/openhuman · error

invalid --limit

Error message

invalid --limit: {e}

What it means

Argument-validation failure in the `openhuman memory query` CLI loop. The value following --limit/-l is parsed as u32; this fires when the user supplies a non-numeric value (e.g. `--limit ten`) or a number outside u32 range. It is a stdin-facing usage error, not an internal fault; the underlying std parse error text is appended to the message.

Solutions

  1. Pass an integer between 0 and 4294967295 after --limit (e.g. `--limit 25`).
  2. Run `openhuman memory query --help` to see the accepted flag forms.
  3. Check that the next token after --limit is the value, not another flag.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/core/memory_cli.rs:325 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/4e4ab307ae5ffd79. Report an issue: GitHub.

Appendix: source

Thrown at src/core/memory_cli.rs:325

    let mut namespace: Option<String> = None;
    let mut query: Option<String> = None;
    let mut limit: u32 = 10;
    let mut verbose = false;
    let mut i = 0;

    while i < args.len() {
        match args[i].as_str() {
            "--namespace" | "-n" => {
                namespace = Some(next_arg(args, &mut i, "--namespace")?);
            }
            "--query" | "-q" => {
                query = Some(next_arg(args, &mut i, "--query")?);
            }
            "--limit" | "-l" => {
                let raw = next_arg(args, &mut i, "--limit")?;
                limit = raw
                    .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"))?;

View on GitHub (pinned to 7491200858)