tinyhumansai/openhuman · error

--method is required

Error message

--method is required

What it means

The `call` argument loop finished without ever seeing `--method`. Unlike `--params` (which defaults to '{}'), the method name has no default, so `openhuman call` with no arguments, with only `--params`, or with only `-h`-less flags leaves `method: None` and this error fires. It is the last gate before capability checks and dispatch.

Source

Thrown at src/core/cli.rs:486

                );
                i += 2;
            }
            "--params" => {
                params = args
                    .get(i + 1)
                    .ok_or_else(|| anyhow::anyhow!("missing value for --params"))?
                    .clone();
                i += 2;
            }
            "-h" | "--help" => {
                println!("Usage: openhuman call --method <name> [--params '<json>']");
                return Ok(());
            }
            other => return Err(anyhow::anyhow!("unknown call arg: {other}")),
        }
    }

    let method = method.ok_or_else(|| anyhow::anyhow!("--method is required"))?;
    let params = parse_json_params(&params).map_err(anyhow::Error::msg)?;

    // Raw calls bypass namespace parsing, but not the configured memory-driver
    // binding. Without this gate an absent capability could still reach a
    // destructive embedded handler because plain CLI invocations have no
    // ambient CoreContext to filter the registry.
    crate::core::cli_capability::ensure_capability_blocking(
        all::capability_for_rpc_method(&method).flatten(),
        &format!("openhuman call --method {method}"),
    )?;

    // `call` invokes a JSON-RPC method that may run an orchestrator turn
    // (e.g. `agent.chat`), so it needs the same roomy stack as the server.
    let rt = tokio::runtime::Builder::new_multi_thread()
        .enable_all()
        .thread_stack_size(crate::core::runtime::AGENT_WORKER_STACK_BYTES)
        .max_blocking_threads(crate::core::runtime::MAX_BLOCKING_THREADS)
        .build()?;

View on GitHub (pinned to a221052e0d)

Solutions

  1. Add the method flag: `openhuman call --method <rpc-method>`
  2. Verify the exact method name against the registry: `openhuman --help` / schema docs
  3. Check for earlier typos — a misspelled `--method` token would have failed as 'unknown call arg' instead

Example fix

# before
openhuman call --params '{"key":1}'
# after
openhuman call --method openhuman.config_get --params '{"key":1}'
Defensive patterns

Strategy: validation

Validate before calling

# bash: hard-require the method before building the command
[ -n "${METHOD:-}" ] || { echo "usage: openhuman call --method <name> [--params '<json>']" >&2; exit 2; }
openhuman call --method "$METHOD" ${PARAMS:+--params "$PARAMS"}

Prevention

When it happens

Trigger: `openhuman call` with no args; `openhuman call --params '{...}'` (params but no method); flags typo'd so --method was consumed as an unknown arg earlier.

Common situations: Assuming an interactive prompt or a default method; scripts where the method variable is empty; flag typos that silently skipped the method assignment.

Related errors


AI-assisted analysis of tinyhumansai/openhuman@a221052e0d (2026-08-16). Data as JSON: /api/errors/ff00f007189dc7f7. Report an issue: GitHub.