{"record":{"id":"3d8800226c81a7c5","repo":"tinyhumansai/openhuman","slug":"missing-value-for-params","errorCode":null,"errorMessage":"missing value for --params","messagePattern":"missing value for --params","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/cli.rs","lineNumber":474,"sourceCode":"fn run_call_command(args: &[String]) -> Result<()> {\n    let mut method: Option<String> = None;\n    let mut params = \"{}\".to_string();\n\n    let mut i = 0usize;\n    while i < args.len() {\n        match args[i].as_str() {\n            \"--method\" => {\n                method = Some(\n                    args.get(i + 1)\n                        .ok_or_else(|| anyhow::anyhow!(\"missing value for --method\"))?\n                        .clone(),\n                );\n                i += 2;\n            }\n            \"--params\" => {\n                params = args\n                    .get(i + 1)\n                    .ok_or_else(|| anyhow::anyhow!(\"missing value for --params\"))?\n                    .clone();\n                i += 2;\n            }\n            \"-h\" | \"--help\" => {\n                println!(\"Usage: openhuman call --method <name> [--params '<json>']\");\n                return Ok(());\n            }\n            other => return Err(anyhow::anyhow!(\"unknown call arg: {other}\")),\n        }\n    }\n\n    let method = method.ok_or_else(|| anyhow::anyhow!(\"--method is required\"))?;\n    let params = parse_json_params(&params).map_err(anyhow::Error::msg)?;\n\n    // Raw calls bypass namespace parsing, but not the configured memory-driver\n    // binding. Without this gate an absent capability could still reach a\n    // destructive embedded handler because plain CLI invocations have no\n    // ambient CoreContext to filter the registry.","sourceCodeStart":456,"sourceCodeEnd":492,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/src/core/cli.rs#L456-L492","documentation":"`openhuman call --params` expects the JSON parameter string as the next token and the flag was the last argument. Params default to \"{}\" when the flag is omitted entirely, so this only fires when the flag is present but dangling.","triggerScenarios":"`openhuman call --method openhuman.x --params` as the final token; quoting mistakes that leave the JSON argument off the command line.","commonSituations":"Shell quoting of JSON strings gone wrong (unbalanced quotes swallowing the value); templated invocations where the params variable is appended as a flag but its expansion is lost.","solutions":["Pass the JSON as one quoted token: `--params '{\"key\":\"value\"}'`","Or omit `--params` to send the default empty object {}"],"exampleFix":"# before\nopenhuman call --method openhuman.config_get --params\n# after\nopenhuman call --method openhuman.config_get --params '{\"key\":\"value\"}'","handlingStrategy":"validation","validationCode":"# bash: validate JSON and omit empty params\nif [ -n \"${PARAMS:-}\" ]; then\n  printf '%s' \"$PARAMS\" | jq -e . >/dev/null 2>&1 \\\n    || { echo \"params must be valid JSON\" >&2; exit 2; }\n  exec openhuman call --method \"$METHOD\" --params \"$PARAMS\"\nfi\nexec openhuman call --method \"$METHOD\"   # default params {}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Omit --params entirely to send {} rather than passing it with no value","Single-quote JSON payloads so the shell cannot split or swallow them","Validate the JSON with jq -e . before handing it to the CLI"],"tags":["cli","argument-parsing","json-rpc"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}