{"record":{"id":"f1a1076262800dc1","repo":"tinyhumansai/openhuman","slug":"memory-chunk-context-chunk-id-not-found","errorCode":null,"errorMessage":"memory_chunk_context: chunk_id not found","messagePattern":"memory_chunk_context: chunk_id not found","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/openhuman/memory/tools/search/chunk_context.rs","lineNumber":93,"sourceCode":"            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 {\n            source_kind: Some(source_kind),","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/749120085864ce16e0f273c7b86fac7740b39c5b/src/openhuman/memory/tools/search/chunk_context.rs#L75-L111","documentation":"Not-found result in the memory_chunk_context tool's execute: the direct get_chunk lookup by the supplied chunk_id returned nothing, so the chunk does not exist (or is invisible to this driver). Fired after guard and chunk-family checks passed; the caller should pass a chunk_id taken from a prior search result.","triggerScenarios":"Thrown at src/openhuman/memory/tools/search/chunk_context.rs:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the originating search to get a fresh chunk id with source metadata","Retry — partially-written chunks can lack source linkage temporarily","Report if consistent: the store has an orphaned chunk row"],"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"}