tinyhumansai/openhuman · warning

unknown list arg: {other}

Error message

unknown list arg: {other}

What it means

Thrown by the `openhuman agent list` parser when a token matches none of --json, --workspace/-w, -v/--verbose, -h/--help. list accepts only those four; anything else aborts the parse with the offending token named.

Source

Thrown at src/core/agent_cli.rs:397

            }
            "--workspace" | "-w" => {
                workspace = Some(PathBuf::from(
                    args.get(i + 1)
                        .ok_or_else(|| anyhow!("missing value for --workspace"))?,
                ));
                i += 2;
            }
            "-v" | "--verbose" => {
                verbose = true;
                i += 1;
            }
            "-h" | "--help" => {
                println!("Usage: openhuman agent list [--workspace <path>] [--json] [-v]");
                println!();
                println!("  List every built-in agent plus any custom `<workspace>/agents/*.toml` overrides.");
                return Ok(());
            }
            other => return Err(anyhow!("unknown list arg: {other}")),
        }
    }

    // Silence the logger so Config::load_or_init and AgentDefinitionRegistry::load
    // don't write warnings/info to stdout, which would corrupt --json output.
    // (The project's CLI logger writes to stdout, not stderr.)
    init_quiet_logging(verbose);

    // Resolve workspace-custom overrides the same way the runtime does
    // at spawn time. When --workspace is explicit we load against it
    // directly; otherwise the registry helper does the Config dance.
    let registry = if let Some(ws) = workspace {
        AgentDefinitionRegistry::load(&ws)?
    } else {
        let rt = tokio::runtime::Builder::new_current_thread()
            .enable_all()
            .build()?;
        rt.block_on(AgentDefinitionRegistry::load_for_default_workspace())?

View on GitHub (pinned to a221052e0d)

Solutions

  1. Use only --json, --workspace <path>, -v for list.
  2. Run `openhuman agent list --help` to re-confirm the accepted flags.
  3. Move agent/model selection flags to dump-prompt, where they belong.

Example fix

# before
openhuman agent list --model gpt-5

# after
openhuman agent list --json
Defensive patterns

Strategy: validation

Validate before calling

const LIST_FLAGS: &[&str] = &["--json", "--workspace", "-w", "-v", "--verbose", "-h", "--help"];
fn list_args_valid(args: &[String]) -> bool {
    let mut i = 0;
    while i < args.len() {
        if !LIST_FLAGS.contains(&args[i].as_str()) { return false; }
        i += if args[i].starts_with("--workspace") || args[i] == "-w" { 2 } else { 1 };
    }
    true
}

Try / catch

match run_agent_command(&args) {
    Err(e) if e.to_string().contains("unknown list arg") => {
        eprintln!("valid flags: --json, --workspace <path>, -v");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Passing `--agent`, `--model`, `--out`, or any positional to `openhuman agent list`; confusing list's tiny flag set with dump-prompt/dump-all's.

Common situations: Reusing a dump-all command line against list, or a script templating one flag list across all agent subcommands.

Related errors


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