{"record":{"id":"f20f62cb3335606a","repo":"tinyhumansai/openhuman","slug":"memory-chunk-context-get-chunk-failed-e","errorCode":null,"errorMessage":"memory_chunk_context: get_chunk failed: {e}","messagePattern":"memory_chunk_context: get_chunk failed: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/memory/tools/search/chunk_context.rs","lineNumber":92,"sourceCode":"            \"[tool][memory_chunk_context] chunk_id={} window={}\",\n            parsed.chunk_id,\n            window,\n        );\n\n        // Chunks are read through the bound driver rather than by opening the\n        // store in this process — see the note in `vector_search.rs`.\n        let guard = active_memory_guard()\n            .await\n            .map_err(|e| anyhow::anyhow!(\"memory_chunk_context: {e}\"))?;\n        let chunk_reader = guard.as_chunks().ok_or_else(|| {\n            anyhow::anyhow!(\"memory_chunk_context: memory driver does not support the chunk family\")\n        })?;\n\n        // Look up the target chunk directly by ID\n        let target = chunk_reader\n            .get_chunk(&parsed.chunk_id)\n            .await\n            .map_err(|e| anyhow::anyhow!(\"memory_chunk_context: get_chunk failed: {e}\"))?\n            .ok_or_else(|| anyhow::anyhow!(\"memory_chunk_context: chunk_id not found\"))?;\n\n        let source_id = target.metadata.source_id.clone();\n        let source_kind = target.metadata.source_kind;\n\n        // Per-profile memory-source gate: if the target chunk belongs to a\n        // source the active profile didn't allow, surface nothing (its window\n        // shares the same source). Non-source chunks always pass.\n        if !tinymemory_core::source_scope::chunk_source_allowed(&target.metadata.tags, &source_id) {\n            return Ok(ToolResult::success(\n                \"Chunk is from a memory source not available to the active agent profile.\",\n            ));\n        }\n\n        // Get all chunks from the same source, ordered by timestamp. The\n        // source-scope gate also applies here (the target was already checked\n        // above; this keeps the window consistent). None = unrestricted.\n        let source_query = ChunkQuery {","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/memory/tools/search/chunk_context.rs#L74-L110","documentation":"Capability guard in the memory_chunk_context tool's execute: guard.as_chunks() returned None, meaning the active memory driver does not implement the chunk family, so chunk context cannot be read. Driver-capability boundary, not bad input — the get_chunk call is never attempted.","triggerScenarios":"Thrown at src/openhuman/memory/tools/search/chunk_context.rs:92 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry transient driver failures","Verify the chunk id came from a fresh search (it may have been dropped)","Inspect the chained error for the underlying fault"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"749120085864ce16e0f273c7b86fac7740b39c5b","analyzedAt":"2026-08-17T21:21:45.363Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}