{"record":{"id":"908cad617522333c","repo":"can1357/oh-my-pi","slug":"mnemopi-memory-namespace-not-found-in-any-scope","errorCode":null,"errorMessage":"Mnemopi memory ${namespace} not found in any scoped bank. Use `recall` to list available ids.","messagePattern":"Mnemopi memory (.+?) not found in any scoped bank\\. Use `recall` to list available ids\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/internal-urls/memory-protocol.ts","lineNumber":333,"sourceCode":"\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(\n\t\t\t\t\"Memory artifacts are not available for this project yet. Run a session with memories enabled first.\",\n\t\t\t);\n\t\t}\n\n\t\tlet anyExists = false;\n\t\tfor (const root of roots) {\n\t\t\ttry {\n\t\t\t\tawait fs.stat(root);\n\t\t\t\tanyExists = true;\n\t\t\t} catch (error) {\n\t\t\t\tif (isEnoent(error)) continue;","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/internal-urls/memory-protocol.ts#L315-L351","documentation":"When a mnemopi backend is live, any non-'root' host is looked up as a memory id across all scoped session banks via tryResolveMnemopiMemory. If no bank contains that id, resolve throws pointing the caller at `recall` to discover valid ids — the id may be stale, from another project, or mistyped.","triggerScenarios":"Resolving memory://<id> with mnemopi active but getScopedMemory(id) returns null in every registered session's scoped banks — expired/evicted row, id from a different session or project, or a typo.","commonSituations":"Agent recalls an id earlier in the session but the row was later updated/evicted via memory_edit; resuming work referencing ids from a previous session's banks; cross-project id reuse.","solutions":["Run `recall` to list the memory ids currently available in scoped banks.","Re-run the recall query that produced the id and use the fresh id from its output.","Check the id for truncation or transcription errors before retrying."],"exampleFix":"// before\nread(\"memory://mem_old_session_id\")\n// after\nconst { id } = await recall({ query: \"<topic>\" });\nread(`memory://${id}`);","handlingStrategy":"try-catch","validationCode":"// obtain ids only from a current recall() call; never reuse ids across sessions","typeGuard":null,"tryCatchPattern":"try {\n  return await handler.resolve(parseInternalUrl(`memory://${id}`), ctx);\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"not found in any scoped bank\")) {\n    const fresh = await recall({ query: topic });\n    return await handler.resolve(parseInternalUrl(`memory://${fresh.id}`), ctx);\n  }\n  throw err;\n}","preventionTips":["Re-recall instead of caching memory ids across turns or sessions.","Run recall to enumerate valid ids before reading.","Copy ids exactly — no truncation or manual transcription."],"tags":["memory-protocol","mnemopi","not-found"],"backgroundTag":"resource-id-not-found","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}