tinyhumansai/openhuman · error · anyhow::Error

memory_chunk_context: chunk_id cannot be empty

Error message

memory_chunk_context: chunk_id cannot be empty

What it means

The parsed chunk_id trims to empty — a blank id cannot reference any chunk, so the tool refuses before touching the driver. Distinct from a well-formed id that matches nothing (that is chunk_id not found).

Source

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

                    "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()
            .await
            .map_err(|e| anyhow::anyhow!("memory_chunk_context: {e}"))?;
        let chunk_reader = guard.as_chunks().ok_or_else(|| {

View on GitHub (pinned to 7491200858)

Solutions

  1. Provide the non-empty chunk id from a prior search
  2. Avoid placeholder or whitespace ids
Defensive patterns

Strategy: validation

When it happens

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