tinyhumansai/openhuman · error

invalid arguments for memory_tree_fetch_leaves: {e}

Error message

invalid arguments for memory_tree_fetch_leaves: {e}

What it means

Deserializing fetch_leaves args into FetchLeavesRequest failed — chunk_ids missing, not an array, or entries not strings. The schema caps the list at 20 ids; parsing errors surface before the cap is applied.

Source

Thrown at src/openhuman/memory/query/fetch_leaves.rs:43

    }

    fn parameters_schema(&self) -> serde_json::Value {
        json!({
            "type": "object",
            "properties": {
                "chunk_ids": {
                    "type": "array",
                    "items": {"type": "string"},
                    "description": "Chunk ids to hydrate. Capped at 20 per call."
                }
            },
            "required": ["chunk_ids"]
        })
    }

    async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {
        let req: FetchLeavesRequest = serde_json::from_value(args)
            .map_err(|e| anyhow::anyhow!("invalid arguments for memory_tree_fetch_leaves: {e}"))?;
        log::debug!(
            "[rpc][memory_tree] fetch_leaves invoked requested_ids={}",
            req.chunk_ids.len()
        );
        let take = req.chunk_ids.len().min(MAX_CHUNK_IDS_PER_CALL);
        if req.chunk_ids.len() > MAX_CHUNK_IDS_PER_CALL {
            log::debug!(
                "[rpc][memory_tree] fetch_leaves truncating requested_ids={} truncated_to={}",
                req.chunk_ids.len(),
                MAX_CHUNK_IDS_PER_CALL
            );
        }
        let hits = backend::fetch_leaves(&req.chunk_ids[..take]).await?;
        log::debug!(
            "[rpc][memory_tree] fetch_leaves completed hits={}",
            hits.len()
        );
        let json = serde_json::to_string(&hits)?;

View on GitHub (pinned to 7491200858)

Solutions

  1. Pass chunk_ids as an array of chunk-id strings from a prior search
  2. Check for malformed JSON or wrong field types
  3. Keep the list within the 20-id cap
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/memory/query/fetch_leaves.rs:43 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/53b8acf4cb657e1a. Report an issue: GitHub.