tinyhumansai/openhuman · error · anyhow::Error

query cannot be empty

Error message

query cannot be empty

What it means

Empty-value guard in the memory recall tool's execute: `query` was present and a string but trimmed to empty (namespace checks already passed). A blank query would match nothing useful, so it is refused before the search; supply non-empty namespace and query.

Source

Thrown at src/openhuman/memory/tools/recall.rs:74

        })
    }

    async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {
        let namespace = args
            .get("namespace")
            .and_then(|v| v.as_str())
            .ok_or_else(|| anyhow::anyhow!("Missing 'namespace' parameter"))?
            .trim();
        if namespace.is_empty() {
            return Err(anyhow::anyhow!("namespace cannot be empty"));
        }
        let query = args
            .get("query")
            .and_then(|v| v.as_str())
            .ok_or_else(|| anyhow::anyhow!("Missing 'query' parameter"))?
            .trim();
        if query.is_empty() {
            return Err(anyhow::anyhow!("query cannot be empty"));
        }

        #[allow(clippy::cast_possible_truncation)]
        let limit = args
            .get("limit")
            .and_then(serde_json::Value::as_u64)
            .map_or(5, |v| v as usize);

        // Search with the user query only. Prefixing `namespace` into the query
        // string would add a redundant token matching almost every row. Instead,
        // namespace scoping belongs in RecallOpts so the backend restricts the
        // search to the correct namespace column.
        let recall_opts = crate::openhuman::memory::api::recall::OwnedRecallOpts {
            namespace: Some(namespace.to_string()),
            ..Default::default()
        };
        let guard = active_memory_guard()
            .await

View on GitHub (pinned to 7491200858)

Solutions

  1. Provide a non-blank search query
  2. Avoid whitespace-only queries from templated prompts
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/memory/tools/recall.rs:74 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/be462c195c74fcd7. Report an issue: GitHub.