{"record":{"id":"8c0721eb74201ef0","repo":"can1357/oh-my-pi","slug":"memory-file-not-found-url-href","errorCode":null,"errorMessage":"Memory file not found: ${url.href}","messagePattern":"Memory file not found: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/internal-urls/memory-protocol.ts","lineNumber":364,"sourceCode":"\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;\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tconst result = await tryResolveInRoot(url, root);\n\t\t\tif (result) return result;\n\t\t}\n\n\t\tif (!anyExists) {\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\tthrow new Error(`Memory file not found: ${url.href}`);\n\t}\n\n\tasync complete(_query?: string, context?: ResolveContext): Promise<UrlCompletion[]> {\n\t\tconst completions: UrlCompletion[] = [];\n\t\tif (memoryRootsForContext(context).length > 0) {\n\t\t\tcompletions.push({ value: MEMORY_NAMESPACE, description: \"Project memory summary\" });\n\t\t}\n\t\tif (mnemopiSessionStatesFromRegistry().length > 0) {\n\t\t\tcompletions.push({\n\t\t\t\tvalue: \"<memory-id>\",\n\t\t\t\tdescription: \"Full mnemopi memory by id (from recall)\",\n\t\t\t});\n\t\t}\n\t\treturn completions;\n\t}\n}\n","sourceCodeStart":346,"sourceCodeEnd":381,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/internal-urls/memory-protocol.ts#L346-L381","documentation":"The memory:// handler threw this when at least one memory root exists (some artifact was found), but the specific requested memory file does not exist at any candidate location. The message includes the full href that failed to resolve.","triggerScenarios":"Resolving memory://<path> where memory artifacts exist for the project but the requested path does not match any existing file (typo, stale reference, renamed memory).","commonSituations":"Referencing a memory file captured in an earlier session that was later renamed or pruned; typos in the memory path; case-sensitivity differences on Linux filesystems.","solutions":["Check the href in the error message and correct the memory file path.","List available memory files under the project memory root and use an existing one.","Recreate the memory artifact by running a session with memories enabled if it was deleted."],"exampleFix":"// before\nresolve('memory://session-summary-2025-01.md')\n// after: verify the file exists first\nconst root = path.join(projectDir, '.omp', 'memories');\nif (!fs.existsSync(path.join(root, 'session-summary-2025-01.md'))) throw new Error('memory file missing');","handlingStrategy":"try-catch","validationCode":"const target = path.join(memoryRoot, memoryName);\nif (!fs.existsSync(target)) throw new Error(`unknown memory: ${memoryName}`);","typeGuard":null,"tryCatchPattern":"try {\n  return await protocol.resolve(url);\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith('Memory file not found')) {\n    logger.warn('memory file missing', { href: url });\n    return null;\n  }\n  throw err;\n}","preventionTips":["List available memory files before referencing them by name.","Copy memory paths exactly as listed (mind case sensitivity on Linux).","Refresh stored references after memory pruning/renaming."],"tags":["memory","internal-url","file-not-found"],"backgroundTag":"file-not-found","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}