tinyhumansai/openhuman · warning

missing value for --agent

Error message

missing value for --agent

What it means

Thrown by parse_dump_flags when `--agent`/`-a` is the last token of `openhuman agent dump-prompt`, so args.get(i + 1) is None and there is no agent id to consume.

Source

Thrown at src/core/agent_cli.rs:175

}

fn parse_dump_flags(args: &[String]) -> Result<DumpFlags> {
    let mut out = DumpFlags {
        agent: None,
        toolkit: None,
        workspace: None,
        model: None,
        json: false,
        with_tools: false,
        verbose: false,
    };
    let mut i = 0usize;
    while i < args.len() {
        match args[i].as_str() {
            "--agent" | "-a" => {
                out.agent = Some(
                    args.get(i + 1)
                        .ok_or_else(|| anyhow!("missing value for --agent"))?
                        .clone(),
                );
                i += 2;
            }
            "--toolkit" | "-t" => {
                out.toolkit = Some(
                    args.get(i + 1)
                        .ok_or_else(|| anyhow!("missing value for --toolkit"))?
                        .clone(),
                );
                i += 2;
            }
            "--workspace" | "-w" => {
                out.workspace = Some(PathBuf::from(
                    args.get(i + 1)
                        .ok_or_else(|| anyhow!("missing value for --workspace"))?,
                ));
                i += 2;

View on GitHub (pinned to a221052e0d)

Solutions

  1. Provide the id: `--agent orchestrator`, `--agent welcome`, etc.
  2. In scripts, check the variable is non-empty before building the command.

Example fix

# before
openhuman agent dump-prompt --agent

# after
openhuman agent dump-prompt --agent orchestrator
Defensive patterns

Strategy: validation

Validate before calling

# shell: require the agent id up front
: "${AGENT_ID:?AGENT_ID must be set (e.g. orchestrator)}"
openhuman agent dump-prompt --agent "$AGENT_ID"

Try / catch

match run_agent_command(&args) {
    Err(e) if e.to_string().contains("missing value for --agent") => {
        eprintln!("--agent takes an id right after it, e.g. --agent orchestrator");
    }
    other => other?,
}

Prevention

When it happens

Trigger: `openhuman agent dump-prompt --agent` or `... -a` at the end of the command line.

Common situations: Forgot the agent id, or a wrapper script passed an empty/unset agent variable so the flag dangles.

Related errors


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