{"record":{"id":"4a73d1b9439525e0","repo":"tinyhumansai/openhuman","slug":"messages-must-be-a-non-empty-array","errorCode":null,"errorMessage":"messages must be a non-empty array","messagePattern":"messages must be a non-empty array","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/openhuman/search/tools/parallel.rs","lineNumber":538,"sourceCode":"                        },\n                        \"required\": [\"role\", \"content\"]\n                    }\n                }\n            },\n            \"required\": [\"model\", \"messages\"]\n        })\n    }\n\n    async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {\n        let model = args\n            .get(\"model\")\n            .and_then(|v| v.as_str())\n            .ok_or_else(|| anyhow::anyhow!(\"Missing required parameter: model\"))?;\n        let messages = args\n            .get(\"messages\")\n            .and_then(|v| v.as_array())\n            .filter(|a| !a.is_empty())\n            .ok_or_else(|| anyhow::anyhow!(\"messages must be a non-empty array\"))?;\n\n        tracing::info!(\n            \"[parallel_chat] model={} messages={}\",\n            model,\n            messages.len()\n        );\n\n        let body = json!({ \"model\": model, \"messages\": messages });\n        match self\n            .client\n            .post::<ChatResponse>(\"/agent-integrations/parallel/chat\", &body)\n            .await\n        {\n            Ok(resp) => {\n                let mut out = String::new();\n                if let Some(c) = resp.choices.first() {\n                    out.push_str(&c.message.content);\n                    if let Some(reason) = &c.finish_reason {","sourceCodeStart":520,"sourceCodeEnd":556,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/search/tools/parallel.rs#L520-L556","documentation":"Argument-validation guard in the Parallel LLM/chat tool: 'messages' is either absent/not an array, or an explicitly empty array (the .filter(|a| !a.is_empty()) after as_array makes emptiness part of the same guard). The schema requires messages with objects of {role, content}. Fires on malformed model calls before any request is sent.","triggerScenarios":"Thrown at src/openhuman/search/tools/parallel.rs:538 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry with 'messages' as a non-empty array, e.g. one {\"role\":\"user\",\"content\":\"...\"} object.","Ensure every entry has string 'role' (system|user|assistant) and string 'content'.","If there is genuinely nothing to send, do not call the tool."],"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-14T05:17:10.506Z"}