{"record":{"id":"77dac5055f3acb75","repo":"tinyhumansai/openhuman","slug":"unknown-list-arg-other","errorCode":null,"errorMessage":"unknown list arg: {other}","messagePattern":"unknown list arg: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/core/agent_cli.rs","lineNumber":397,"sourceCode":"            }\n            \"--workspace\" | \"-w\" => {\n                workspace = Some(PathBuf::from(\n                    args.get(i + 1)\n                        .ok_or_else(|| anyhow!(\"missing value for --workspace\"))?,\n                ));\n                i += 2;\n            }\n            \"-v\" | \"--verbose\" => {\n                verbose = true;\n                i += 1;\n            }\n            \"-h\" | \"--help\" => {\n                println!(\"Usage: openhuman agent list [--workspace <path>] [--json] [-v]\");\n                println!();\n                println!(\"  List every built-in agent plus any custom `<workspace>/agents/*.toml` overrides.\");\n                return Ok(());\n            }\n            other => return Err(anyhow!(\"unknown list arg: {other}\")),\n        }\n    }\n\n    // Silence the logger so Config::load_or_init and AgentDefinitionRegistry::load\n    // don't write warnings/info to stdout, which would corrupt --json output.\n    // (The project's CLI logger writes to stdout, not stderr.)\n    init_quiet_logging(verbose);\n\n    // Resolve workspace-custom overrides the same way the runtime does\n    // at spawn time. When --workspace is explicit we load against it\n    // directly; otherwise the registry helper does the Config dance.\n    let registry = if let Some(ws) = workspace {\n        AgentDefinitionRegistry::load(&ws)?\n    } else {\n        let rt = tokio::runtime::Builder::new_current_thread()\n            .enable_all()\n            .build()?;\n        rt.block_on(AgentDefinitionRegistry::load_for_default_workspace())?","sourceCodeStart":379,"sourceCodeEnd":415,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/src/core/agent_cli.rs#L379-L415","documentation":"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.","triggerScenarios":"Passing `--agent`, `--model`, `--out`, or any positional to `openhuman agent list`; confusing list's tiny flag set with dump-prompt/dump-all's.","commonSituations":"Reusing a dump-all command line against list, or a script templating one flag list across all agent subcommands.","solutions":["Use only --json, --workspace <path>, -v for list.","Run `openhuman agent list --help` to re-confirm the accepted flags.","Move agent/model selection flags to dump-prompt, where they belong."],"exampleFix":"# before\nopenhuman agent list --model gpt-5\n\n# after\nopenhuman agent list --json","handlingStrategy":"validation","validationCode":"const LIST_FLAGS: &[&str] = &[\"--json\", \"--workspace\", \"-w\", \"-v\", \"--verbose\", \"-h\", \"--help\"];\nfn list_args_valid(args: &[String]) -> bool {\n    let mut i = 0;\n    while i < args.len() {\n        if !LIST_FLAGS.contains(&args[i].as_str()) { return false; }\n        i += if args[i].starts_with(\"--workspace\") || args[i] == \"-w\" { 2 } else { 1 };\n    }\n    true\n}","typeGuard":null,"tryCatchPattern":"match run_agent_command(&args) {\n    Err(e) if e.to_string().contains(\"unknown list arg\") => {\n        eprintln!(\"valid flags: --json, --workspace <path>, -v\");\n    }\n    other => other?,\n}","preventionTips":["Do not reuse dump-prompt/dump-all flag lists for list; it accepts only four flags.","Run `openhuman agent list --help` after version bumps to re-confirm the surface."],"tags":["rust","cli","argument-parsing","unknown-flag"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}