{"record":{"id":"32c5da303a488aef","repo":"tinyhumansai/openhuman","slug":"missing-value-for-agent","errorCode":null,"errorMessage":"missing value for --agent","messagePattern":"missing value for --agent","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/core/agent_cli.rs","lineNumber":175,"sourceCode":"}\n\nfn parse_dump_flags(args: &[String]) -> Result<DumpFlags> {\n    let mut out = DumpFlags {\n        agent: None,\n        toolkit: None,\n        workspace: None,\n        model: None,\n        json: false,\n        with_tools: false,\n        verbose: false,\n    };\n    let mut i = 0usize;\n    while i < args.len() {\n        match args[i].as_str() {\n            \"--agent\" | \"-a\" => {\n                out.agent = Some(\n                    args.get(i + 1)\n                        .ok_or_else(|| anyhow!(\"missing value for --agent\"))?\n                        .clone(),\n                );\n                i += 2;\n            }\n            \"--toolkit\" | \"-t\" => {\n                out.toolkit = Some(\n                    args.get(i + 1)\n                        .ok_or_else(|| anyhow!(\"missing value for --toolkit\"))?\n                        .clone(),\n                );\n                i += 2;\n            }\n            \"--workspace\" | \"-w\" => {\n                out.workspace = Some(PathBuf::from(\n                    args.get(i + 1)\n                        .ok_or_else(|| anyhow!(\"missing value for --workspace\"))?,\n                ));\n                i += 2;","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/src/core/agent_cli.rs#L157-L193","documentation":"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.","triggerScenarios":"`openhuman agent dump-prompt --agent` or `... -a` at the end of the command line.","commonSituations":"Forgot the agent id, or a wrapper script passed an empty/unset agent variable so the flag dangles.","solutions":["Provide the id: `--agent orchestrator`, `--agent welcome`, etc.","In scripts, check the variable is non-empty before building the command."],"exampleFix":"# before\nopenhuman agent dump-prompt --agent\n\n# after\nopenhuman agent dump-prompt --agent orchestrator","handlingStrategy":"validation","validationCode":"# shell: require the agent id up front\n: \"${AGENT_ID:?AGENT_ID must be set (e.g. orchestrator)}\"\nopenhuman agent dump-prompt --agent \"$AGENT_ID\"","typeGuard":null,"tryCatchPattern":"match run_agent_command(&args) {\n    Err(e) if e.to_string().contains(\"missing value for --agent\") => {\n        eprintln!(\"--agent takes an id right after it, e.g. --agent orchestrator\");\n    }\n    other => other?,\n}","preventionTips":["Always follow --agent with the id token.","List valid ids first with `openhuman agent list`."],"tags":["rust","cli","argument-parsing","missing-value"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}