{"record":{"id":"d30405194b41b03b","repo":"can1357/oh-my-pi","slug":"unknown-memory-namespace-namespace-supported","errorCode":null,"errorMessage":"Unknown memory namespace: ${namespace}. Supported: ${MEMORY_NAMESPACE}","messagePattern":"Unknown memory namespace: (.+?)\\. Supported: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/internal-urls/memory-protocol.ts","lineNumber":123,"sourceCode":"\t}\n\n\tconst rawBasePath = rawSegments.slice(0, firstGlobIndex).join(\"/\") || \".\";\n\treturn {\n\t\tbaseUrl: `memory://${namespace}/${rawBasePath}`,\n\t\tglobPattern: rawSegments.slice(firstGlobIndex).map(decodeGlobSuffixSegment).join(\"/\"),\n\t};\n}\n\n/**\n * Resolve a memory:// URL to an absolute filesystem path under memory root.\n */\nexport function resolveMemoryUrlToPath(url: InternalUrl, memoryRoot: string): string {\n\tconst namespace = url.rawHost || url.hostname;\n\tif (!namespace) {\n\t\tthrow new Error(\"memory:// URL requires a namespace: memory://root\");\n\t}\n\tif (namespace !== MEMORY_NAMESPACE) {\n\t\tthrow new Error(`Unknown memory namespace: ${namespace}. Supported: ${MEMORY_NAMESPACE}`);\n\t}\n\n\tconst rawPathname = url.rawPathname ?? url.pathname;\n\tconst hasPath = rawPathname && rawPathname !== \"/\" && rawPathname !== \"\";\n\tif (!hasPath) {\n\t\treturn path.resolve(memoryRoot, DEFAULT_MEMORY_FILE);\n\t}\n\tlet relativePath: string;\n\ttry {\n\t\trelativePath = decodeURIComponent(rawPathname.slice(1));\n\t} catch {\n\t\tthrow new Error(`Invalid URL encoding in memory:// path: ${url.href}`);\n\t}\n\n\ttry {\n\t\tvalidateRelativePath(relativePath);\n\t} catch (error) {\n\t\tthrow toMemoryValidationError(error);","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/internal-urls/memory-protocol.ts#L105-L141","documentation":"The sync path resolver only understands the file-backed 'root' namespace (MEMORY_NAMESPACE). Any other host in a memory:// URL — a memory id, a typo, or a different backend's namespace — is rejected because resolveMemoryUrlToPath maps URLs to files under the memory root and cannot interpret other namespaces.","triggerScenarios":"resolveMemoryUrlToPath called with a URL whose host is not exactly 'root' — e.g. memory://my-memory-id, memory://Root (case-sensitive), or memory://hindsight — typically via targetPath or tryResolveInternalUrlSync.","commonSituations":"An agent following recall output tries `read memory://<memory-id>` while the async protocol handler (which supports mnemopi ids) is not the code path being taken; typos like memory://roots; passing a hindsight or mnemopi id into the sync resolver.","solutions":["Use memory://root[/path] for file-backed memory reads; this resolver supports only the root namespace.","For mnemopi memory ids, resolve through MemoryProtocolHandler.resolve (async) with memory.backend=mnemopi active, not the sync path resolver.","Check the host spelling/case — the comparison is exact ('root')."],"exampleFix":"// before\nresolveMemoryUrlToPath(parseInternalUrl(\"memory://abc123\"), root)\n// after\nresolveMemoryUrlToPath(parseInternalUrl(\"memory://root\"), root)","handlingStrategy":"validation","validationCode":"const ns = url.rawHost || url.hostname;\nif (ns !== \"root\") throw new Error(`sync resolver supports only memory://root, got: ${ns}`);","typeGuard":"function isRootNamespace(url: InternalUrl): boolean {\n  return (url.rawHost || url.hostname) === \"root\";\n}","tryCatchPattern":"try {\n  return resolveMemoryUrlToPath(url, root);\n} catch (err) {\n  if (err instanceof Error && err.message.startsWith(\"Unknown memory namespace\")) {\n    return null; // caller falls back to MemoryProtocolHandler.resolve for id namespaces\n  }\n  throw err;\n}","preventionTips":["Reserve the sync resolver for memory://root URLs only.","Route memory://<id> reads through the async protocol handler with the right backend.","Remember the namespace check is case-sensitive: 'root', not 'Root'."],"tags":["url","memory-protocol","namespace"],"backgroundTag":"unknown-url-namespace","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}