{"record":{"id":"943b12aedc52f0f4","repo":"tinyhumansai/openhuman","slug":"key-must-be-an-array-of-strings","errorCode":null,"errorMessage":"`{key}` must be an array of strings","messagePattern":"`(.+?)` must be an array of strings","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/agent/tools/todo.rs","lineNumber":295,"sourceCode":"        approval_mode,\n        acceptance_criteria: optional_string_array(args, \"acceptanceCriteria\")?,\n        evidence: optional_string_array(args, \"evidence\")?,\n        notes: optional_string(args, \"notes\"),\n        blocker: optional_string(args, \"blocker\"),\n        source_metadata: None,\n    })\n}\n\nfn optional_string_array(\n    args: &serde_json::Value,\n    key: &str,\n) -> anyhow::Result<Option<Vec<String>>> {\n    let Some(value) = args.get(key) else {\n        return Ok(None);\n    };\n    let values = value\n        .as_array()\n        .ok_or_else(|| anyhow::anyhow!(\"`{key}` must be an array of strings\"))?;\n    values\n        .iter()\n        .map(|item| {\n            item.as_str()\n                .map(|s| s.to_string())\n                .ok_or_else(|| anyhow::anyhow!(\"`{key}` must be an array of strings\"))\n        })\n        .collect::<anyhow::Result<Vec<_>>>()\n        .map(Some)\n}\n\n#[cfg(test)]\nmod tests {\n    use super::*;\n    use serde_json::Value;\n\n    /// Serialize tests that share the process-global scratch store with\n    /// `todos::ops` tests. Same lock — otherwise the two test modules race","sourceCodeStart":277,"sourceCodeEnd":313,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/src/openhuman/agent/tools/todo.rs#L277-L313","documentation":"Error \"`{key}` must be an array of strings\" thrown in tinyhumansai/openhuman.","triggerScenarios":"Thrown at src/openhuman/agent/tools/todo.rs:295 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}