tinyhumansai/openhuman · warning

missing value for --workspace

Error message

missing value for --workspace

What it means

Thrown by parse_dump_all_flags when `--workspace`/`-w` is the final token of `openhuman agent dump-all`, so there is no next token to read as the workspace path.

Source

Thrown at src/core/agent_cli.rs:77

fn parse_dump_all_flags(args: &[String]) -> Result<DumpAllFlags> {
    let mut out: Option<PathBuf> = None;
    let mut workspace: Option<PathBuf> = None;
    let mut model: Option<String> = None;
    let mut verbose = false;
    let mut i = 0usize;
    while i < args.len() {
        match args[i].as_str() {
            "--out" | "-o" => {
                out = Some(PathBuf::from(
                    args.get(i + 1)
                        .ok_or_else(|| anyhow!("missing value for --out"))?,
                ));
                i += 2;
            }
            "--workspace" | "-w" => {
                workspace = Some(PathBuf::from(
                    args.get(i + 1)
                        .ok_or_else(|| anyhow!("missing value for --workspace"))?,
                ));
                i += 2;
            }
            "--model" | "-m" => {
                model = Some(
                    args.get(i + 1)
                        .ok_or_else(|| anyhow!("missing value for --model"))?
                        .clone(),
                );
                i += 2;
            }
            "-v" | "--verbose" => {
                verbose = true;
                i += 1;
            }
            "-h" | "--help" => {
                println!("Usage: openhuman agent dump-all --out <dir> [--workspace <path>] [--model <name>] [-v]");
                println!();

View on GitHub (pinned to a221052e0d)

Solutions

  1. Either remove the trailing `--workspace` (it is optional) or give it a path.
  2. Guard in scripts: only append the flag when the variable is non-empty (`[ -n "$WS" ] && args+=(--workspace "$WS")`).

Example fix

# before
openhuman agent dump-all --out ./p --workspace

# after
openhuman agent dump-all --out ./p --workspace ~/.openhuman/users/me
Defensive patterns

Strategy: validation

Validate before calling

# append optional flags only when set
CMD=(openhuman agent dump-all --out "$OUT_DIR")
[ -n "${WS:-}" ] && CMD+=(--workspace "$WS")
"${CMD[@]}"

Try / catch

match run_agent_command(&args) {
    Err(e) if e.to_string().contains("missing value for --workspace") => {
        eprintln!("--workspace needs a path after it (or omit the flag)");
    }
    other => other?,
}

Prevention

When it happens

Trigger: `openhuman agent dump-all --out d -w` or `... --workspace` as the last argument.

Common situations: Optional trailing flag appended by a script whose workspace variable is empty or unset, leaving the flag without a value.

Related errors


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