can1357/oh-my-pi · error

Unknown memory namespace: ${namespace}. Supported: ${MEMORY_

Error message

Unknown memory namespace: ${namespace}. Supported: ${MEMORY_NAMESPACE}

What it means

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.

Source

Thrown at packages/coding-agent/src/internal-urls/memory-protocol.ts:123

	}

	const rawBasePath = rawSegments.slice(0, firstGlobIndex).join("/") || ".";
	return {
		baseUrl: `memory://${namespace}/${rawBasePath}`,
		globPattern: rawSegments.slice(firstGlobIndex).map(decodeGlobSuffixSegment).join("/"),
	};
}

/**
 * Resolve a memory:// URL to an absolute filesystem path under memory root.
 */
export function resolveMemoryUrlToPath(url: InternalUrl, memoryRoot: string): string {
	const namespace = url.rawHost || url.hostname;
	if (!namespace) {
		throw new Error("memory:// URL requires a namespace: memory://root");
	}
	if (namespace !== MEMORY_NAMESPACE) {
		throw new Error(`Unknown memory namespace: ${namespace}. Supported: ${MEMORY_NAMESPACE}`);
	}

	const rawPathname = url.rawPathname ?? url.pathname;
	const hasPath = rawPathname && rawPathname !== "/" && rawPathname !== "";
	if (!hasPath) {
		return path.resolve(memoryRoot, DEFAULT_MEMORY_FILE);
	}
	let relativePath: string;
	try {
		relativePath = decodeURIComponent(rawPathname.slice(1));
	} catch {
		throw new Error(`Invalid URL encoding in memory:// path: ${url.href}`);
	}

	try {
		validateRelativePath(relativePath);
	} catch (error) {
		throw toMemoryValidationError(error);

View on GitHub (pinned to 9690622007)

Solutions

  1. Use memory://root[/path] for file-backed memory reads; this resolver supports only the root namespace.
  2. For mnemopi memory ids, resolve through MemoryProtocolHandler.resolve (async) with memory.backend=mnemopi active, not the sync path resolver.
  3. Check the host spelling/case — the comparison is exact ('root').

Example fix

// before
resolveMemoryUrlToPath(parseInternalUrl("memory://abc123"), root)
// after
resolveMemoryUrlToPath(parseInternalUrl("memory://root"), root)
Defensive patterns

Strategy: validation

Validate before calling

const ns = url.rawHost || url.hostname;
if (ns !== "root") throw new Error(`sync resolver supports only memory://root, got: ${ns}`);

Type guard

function isRootNamespace(url: InternalUrl): boolean {
  return (url.rawHost || url.hostname) === "root";
}

Try / catch

try {
  return resolveMemoryUrlToPath(url, root);
} catch (err) {
  if (err instanceof Error && err.message.startsWith("Unknown memory namespace")) {
    return null; // caller falls back to MemoryProtocolHandler.resolve for id namespaces
  }
  throw err;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31). Data as JSON: /api/errors/d30405194b41b03b. Report an issue: GitHub.