{"record":{"id":"1741511856be117a","repo":"tinyhumansai/openhuman","slug":"missing-required-string-argument-key","errorCode":null,"errorMessage":"missing required string argument `{key}`","messagePattern":"missing required string argument `(.+?)`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/artifacts/tools.rs","lineNumber":40,"sourceCode":"use crate::openhuman::tools::traits::{PermissionLevel, Tool, ToolResult};\n\n/// Read `offset` / `limit` as optional `usize` from tool args.\nfn read_opt_usize(args: &serde_json::Value, key: &str) -> Option<usize> {\n    args.get(key)\n        .and_then(serde_json::Value::as_u64)\n        .map(|v| v as usize)\n}\n\n/// Read a required, non-empty string arg.\nfn read_required_str(args: &serde_json::Value, key: &str) -> anyhow::Result<String> {\n    let raw = args\n        .get(key)\n        .and_then(serde_json::Value::as_str)\n        .map(str::trim)\n        .filter(|s| !s.is_empty());\n    match raw {\n        Some(s) => Ok(s.to_string()),\n        None => Err(anyhow::anyhow!(\"missing required string argument `{key}`\")),\n    }\n}\n\n/// List artifacts the agent has produced, newest first.\npub struct ArtifactListTool {\n    config: Arc<Config>,\n}\n\nimpl ArtifactListTool {\n    pub fn new(config: Arc<Config>) -> Self {\n        Self { config }\n    }\n}\n\n#[async_trait]\nimpl Tool for ArtifactListTool {\n    fn name(&self) -> &str {\n        \"artifact_list\"","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/agent/artifacts/tools.rs#L22-L58","documentation":"Shared required-argument validator (`read_required_str`) for the artifact agent tools. A tool arg is fetched from the JSON args object, must be a string, and after trimming must be non-empty; if the key is missing, not a string, or blank (whitespace-only), this fires with the key name substituted. Generic input guard protecting all artifact tools from empty ids.","triggerScenarios":"Thrown at src/openhuman/agent/artifacts/tools.rs:40 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the required key as a non-empty string, e.g. {\"artifact_id\": \"<uuid>\"}.","Trim whitespace — a whitespace-only value is rejected.","Use artifact_list first to obtain a valid artifact id."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}