tinyhumansai/openhuman · error · anyhow::Error

invalid arguments for memory_chunk_context: {e}

Error message

invalid arguments for memory_chunk_context: {e}

What it means

Argument-deserialization wrapper in the memory_chunk_context tool's execute: args failed to deserialize into the tool's Args struct (e.g. `chunk_id` missing/non-string, or `window` not an integer within the declared 1–5). Generic sentinel; the serde message in `{e}` names the field at fault.

Source

Thrown at src/openhuman/memory/tools/search/chunk_context.rs:63

            "required": ["chunk_id"],
            "properties": {
                "chunk_id": {
                    "type": "string",
                    "description": "ID of the chunk to retrieve context for (from a prior search result)."
                },
                "window": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5,
                    "description": "Number of neighboring chunks to include before and after (default 2)."
                }
            }
        })
    }

    async fn execute(&self, args: serde_json::Value) -> anyhow::Result<ToolResult> {
        let parsed: Args = serde_json::from_value(args)
            .map_err(|e| anyhow::anyhow!("invalid arguments for memory_chunk_context: {e}"))?;

        if parsed.chunk_id.trim().is_empty() {
            return Err(anyhow::anyhow!(
                "memory_chunk_context: chunk_id cannot be empty"
            ));
        }

        let window = parsed.window.clamp(1, 5);

        log::debug!(
            "[tool][memory_chunk_context] chunk_id={} window={}",
            parsed.chunk_id,
            window,
        );

        // Chunks are read through the bound driver rather than by opening the
        // store in this process — see the note in `vector_search.rs`.
        let guard = active_memory_guard()

View on GitHub (pinned to 7491200858)

Solutions

  1. Pass chunk_id as a string from a prior search result
  2. Keep window between 1 and 5
  3. Fix malformed JSON in the arguments
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/memory/tools/search/chunk_context.rs:63 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/818a23f1f0064138. Report an issue: GitHub.