tinyhumansai/openhuman · error

messages must be a non-empty array

Error message

messages must be a non-empty array

What it means

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.

Source

Thrown at src/openhuman/search/tools/parallel.rs:538

                        },
                        "required": ["role", "content"]
                    }
                }
            },
            "required": ["model", "messages"]
        })
    }

    async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {
        let model = args
            .get("model")
            .and_then(|v| v.as_str())
            .ok_or_else(|| anyhow::anyhow!("Missing required parameter: model"))?;
        let messages = args
            .get("messages")
            .and_then(|v| v.as_array())
            .filter(|a| !a.is_empty())
            .ok_or_else(|| anyhow::anyhow!("messages must be a non-empty array"))?;

        tracing::info!(
            "[parallel_chat] model={} messages={}",
            model,
            messages.len()
        );

        let body = json!({ "model": model, "messages": messages });
        match self
            .client
            .post::<ChatResponse>("/agent-integrations/parallel/chat", &body)
            .await
        {
            Ok(resp) => {
                let mut out = String::new();
                if let Some(c) = resp.choices.first() {
                    out.push_str(&c.message.content);
                    if let Some(reason) = &c.finish_reason {

View on GitHub (pinned to 7491200858)

Solutions

  1. Retry with 'messages' as a non-empty array, e.g. one {"role":"user","content":"..."} object.
  2. Ensure every entry has string 'role' (system|user|assistant) and string 'content'.
  3. If there is genuinely nothing to send, do not call the tool.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/search/tools/parallel.rs:538 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/4a73d1b9439525e0. Report an issue: GitHub.