tinyhumansai/openhuman · error · anyhow::Error

unknown list arg

Error message

unknown list arg: {other}

What it means

Generic argument-parse guard in `run_agent_list`: the token does not match any recognized flag of the `openhuman agent list` subcommand. It names the offending token; accepted flags are --workspace/-w, --json, -v/--verbose, -h/--help.

Solutions

  1. Check the spelling of the flag against `openhuman agent list --help`
  2. Remove the unrecognized argument
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/core/agent_cli.rs:397 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/77dac5055f3acb75. Report an issue: GitHub.

Appendix: 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 7491200858)