tinyhumansai/openhuman · error · anyhow::Error

namespace cannot be empty

Error message

namespace cannot be empty

What it means

Empty-value guard in the memory recall tool's execute: the `namespace` argument was present and a string but trimmed to empty. The schema requires namespace and query; a blank namespace would produce a meaningless search scope, so it is refused before the query runs. Distinct from `Missing 'namespace' parameter`, which handles absence.

Source

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

                    "description": "Namespace to search (e.g. 'global', 'background', 'autocomplete', or 'skill-{id}')"
                },
                "limit": {
                    "type": "integer",
                    "description": "Max results to return (default: 5)"
                }
            },
            "required": ["namespace", "query"]
        })
    }

    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,

View on GitHub (pinned to 7491200858)

Solutions

  1. Provide a real namespace like global or background
  2. Remove stray whitespace-only values
Defensive patterns

Strategy: validation

When it happens

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