{"record":{"id":"5e661d57b47df76d","repo":"tinyhumansai/openhuman","slug":"categories-must-contain-only-strings","errorCode":null,"errorMessage":"categories must contain only strings","messagePattern":"categories must contain only strings","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/search/tools/searxng.rs","lineNumber":403,"sourceCode":"        .as_object()\n        .ok_or_else(|| anyhow::anyhow!(\"SearXNG arguments must be an object\"))?;\n    let query = object\n        .get(\"query\")\n        .and_then(|value| value.as_str())\n        .map(str::trim)\n        .filter(|value| !value.is_empty())\n        .ok_or_else(|| anyhow::anyhow!(\"Missing required parameter: query\"))?\n        .to_string();\n    let categories = match object.get(\"categories\") {\n        Some(value) if value.is_null() => Vec::new(),\n        Some(value) => value\n            .as_array()\n            .ok_or_else(|| anyhow::anyhow!(\"categories must be an array of strings\"))?\n            .iter()\n            .map(|item| {\n                item.as_str()\n                    .map(str::to_string)\n                    .ok_or_else(|| anyhow::anyhow!(\"categories must contain only strings\"))\n            })\n            .collect::<anyhow::Result<Vec<_>>>()?,\n        None => Vec::new(),\n    };\n    let language = match object.get(\"language\") {\n        Some(value) => {\n            let language = value\n                .as_str()\n                .map(str::trim)\n                .filter(|value| !value.is_empty())\n                .ok_or_else(|| anyhow::anyhow!(\"language must be a non-empty string\"))?;\n            Some(language.to_string())\n        }\n        None => None,\n    };\n    let max_results = match object.get(\"max_results\") {\n        Some(value) => {\n            let max_results = value","sourceCodeStart":385,"sourceCodeEnd":421,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/search/tools/searxng.rs#L385-L421","documentation":"Element-type guard in parse_search_args: \"categories\" is an array but at least one element is not a JSON string (e.g. a number or nested object), so it cannot be mapped to a SearXNG category name. The faulting input is an array containing non-string items.","triggerScenarios":"Thrown at src/openhuman/search/tools/searxng.rs:403 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure every element of the categories array is a string, e.g. [\"general\"] not [1].","Use valid SearXNG category names (general, images, news, it, science, files, music, videos, social media).","Sanitize model-generated arrays before passing them through."],"exampleFix":null,"handlingStrategy":"type-guard","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-14T05:17:10.506Z"}