{"record":{"id":"c793aa3c0764c615","repo":"can1357/oh-my-pi","slug":"hindsight-memories-are-not-addressable-via-memory","errorCode":null,"errorMessage":"Hindsight memories are not addressable via memory://. Recall results are final — use `recall` to search or `reflect` to synthesize. `read memory://<id>` is only available with memory.backend=mnemopi.","messagePattern":"Hindsight memories are not addressable via memory://\\. Recall results are final — use `recall` to search or `reflect` to synthesize\\. `read memory://<id>` is only available with memory\\.backend=mnemopi\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/internal-urls/memory-protocol.ts","lineNumber":322,"sourceCode":"\t\t// mnemopi memory id lookup. This is the read counterpart to\n\t\t// `memory_edit update` and lets agents inspect the full content of a\n\t\t// clipped recall preview before overwriting it (issue #4443).\n\t\tif (namespace !== MEMORY_NAMESPACE) {\n\t\t\tconst mnemopiStates = mnemopiSessionStatesFromRegistry();\n\t\t\tconst hindsightActive =\n\t\t\t\tbackend === \"hindsight\" ||\n\t\t\t\t(mnemopiStates.length === 0 &&\n\t\t\t\t\tAgentRegistry.global()\n\t\t\t\t\t\t.list()\n\t\t\t\t\t\t.some(ref => ref.session?.getHindsightSessionState?.()));\n\t\t\tif (hindsightActive) {\n\t\t\t\t// Hindsight keeps memories server-side and exposes no\n\t\t\t\t// `memory://<id>` addressing, yet the shared `recall` tool\n\t\t\t\t// description still steers a follow-up `read memory://<id>`.\n\t\t\t\t// Return a corrective pointer so that stray read self-corrects in\n\t\t\t\t// one turn instead of derailing on the generic namespace error\n\t\t\t\t// (issue #7587).\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Hindsight memories are not addressable via memory://. Recall results are final — use `recall` to search or `reflect` to synthesize. `read memory://<id>` is only available with memory.backend=mnemopi.\",\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (mnemopiStates.length === 0) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Unknown memory namespace: ${namespace}. Supported: ${MEMORY_NAMESPACE} (file-backed memory summary), or a mnemopi memory id when memory.backend=mnemopi is active.`,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst hit = tryResolveMnemopiMemory(namespace);\n\t\t\tif (hit) return renderMnemopiMemory(url, hit);\n\t\t\tthrow new Error(\n\t\t\t\t`Mnemopi memory ${namespace} not found in any scoped bank. Use \\`recall\\` to list available ids.`,\n\t\t\t);\n\t\t}\n\n\t\tconst roots = memoryRootsForContext(context);\n\t\tif (roots.length === 0) {\n\t\t\tthrow new Error(","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/internal-urls/memory-protocol.ts#L304-L340","documentation":"When the memory backend is Hindsight (or a Hindsight session state exists with no mnemopi state), memory ids found by recall are stored server-side and are deliberately not addressable via memory://. This corrective error exists (issue #7587) so an agent that reflexively issues `read memory://<id>` gets a one-turn self-correcting pointer to `recall`/`reflect` instead of a generic namespace error.","triggerScenarios":"Resolving memory://<something-not-root> while memory.backend=hindsight or a Hindsight session state is present and no mnemopi session state is registered — the host is treated as a memory id, which Hindsight does not support.","commonSituations":"Switching memory.backend from mnemopi to hindsight but agents still follow recall previews that suggest reading memory://<id>; shared tool descriptions that assume mnemopi semantics.","solutions":["Use the `recall` tool to search memories and `reflect` to synthesize — recall results are final under Hindsight.","Do not issue `read memory://<id>` when the backend is hindsight; update agent prompts/tool guidance accordingly.","If per-id reads are required, switch memory.backend to mnemopi."],"exampleFix":"// before\nread(`memory://${recallResult.id}`) // hindsight backend\n// after\nrecall({ query: \"<topic>\" }) // use recall output directly","handlingStrategy":"try-catch","validationCode":"if (settings.get(\"memory.backend\") === \"hindsight\") {\n  // never construct memory://<id> reads; use recall/reflect instead\n}","typeGuard":null,"tryCatchPattern":"try {\n  return await handler.resolve(url, ctx);\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith(\"Hindsight memories are not addressable\")) {\n    return recall({ query: topic }); // self-correct to recall\n  }\n  throw err;\n}","preventionTips":["Under hindsight, treat recall results as final — no per-id reads.","Update shared tool descriptions/prompts when switching backends to hindsight.","Use reflect for synthesis instead of reading raw memory rows."],"tags":["memory-protocol","hindsight","backend-mismatch"],"backgroundTag":"unsupported-backend-operation","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}