tinyhumansai/openhuman · error

invalid arguments for memory_tree_query_source: {e}

Error message

invalid arguments for memory_tree_query_source: {e}

What it means

Deserializing query_source args into QuerySourceRequest failed — required source identifiers missing or wrongly typed. Validation runs before any config/disk access so a bad SourceKind parse error surfaces here too.

Source

Thrown at src/openhuman/memory/query/query_source.rs:58

                    "description": "Only return summaries whose time range overlaps the last N days."
                },
                "query": {
                    "type": "string",
                    "description": "Optional natural-language query for cosine-similarity rerank."
                },
                "limit": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Max hits to return (default 10)."
                }
            }
        })
    }

    async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {
        log::debug!("[tool][memory_tree] query_source invoked");
        let req: QuerySourceRequest = serde_json::from_value(args)
            .map_err(|e| anyhow::anyhow!("invalid arguments for memory_tree_query_source: {e}"))?;
        // Validate arguments before touching config/disk — `SourceKind::parse`
        // is pure, so a bad `source_kind` must fail with the parse error
        // regardless of workspace state.
        let source_kind = match req.source_kind.as_deref() {
            Some(s) => Some(
                SourceKind::parse(s)
                    .map_err(|e| anyhow::anyhow!("memory_tree_query_source: {e}"))?,
            ),
            None => None,
        };
        let resp = match req.source_id.as_deref() {
            Some(source_id) => {
                backend::query_source_scope(
                    Some(source_id),
                    req.time_window_days,
                    req.query.as_deref(),
                    req.limit.unwrap_or(10),
                )

View on GitHub (pinned to 7491200858)

Solutions

  1. Check source_id/source_kind field types against the schema
  2. Use a valid source_kind string (chat, email, document)
  3. Fix malformed JSON in the arguments
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/memory/query/query_source.rs:58 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/049ea36a44a4e3ba. Report an issue: GitHub.