can1357/oh-my-pi · error

Memory glob patterns require the ${MEMORY_NAMESPACE} namespa

Error message

Memory glob patterns require the ${MEMORY_NAMESPACE} namespace: ${input}

What it means

Glob patterns are only supported against the file-backed 'root' namespace (memory://root/...). After parsing the authority, splitMemoryGlobPattern rejects any URL whose scheme isn't memory: or whose host/namespace isn't 'root'. Other namespaces (e.g. mnemopi memory ids) are single memories and cannot be globbed.

Source

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

}

/**
 * Split a memory:// glob at its first wildcard after validating the complete
 * decoded path. The suffix is validated before filesystem globbing so `..`
 * cannot escape a safely resolved base directory.
 */
export function splitMemoryGlobPattern(input: string): MemoryGlobPattern {
	const urlMatch = input.match(/^([a-z][a-z0-9+.-]*:\/\/[^/?#]*)(\/.*)?$/i);
	if (!urlMatch) {
		throw new Error(`Invalid memory glob URL: ${input}`);
	}

	// Parse only the scheme and authority. A literal `?` in the path is glob
	// syntax, not a query delimiter, and must survive unchanged.
	const url = parseInternalUrl(urlMatch[1]);
	const namespace = url.rawHost || url.hostname;
	if (url.protocol !== "memory:" || namespace !== MEMORY_NAMESPACE) {
		throw new Error(`Memory glob patterns require the ${MEMORY_NAMESPACE} namespace: ${input}`);
	}

	const rawPathname = urlMatch[2] ?? "";
	if (/%(?:2f|5c)/i.test(rawPathname)) {
		throw new Error(`Encoded path separators are not allowed in memory:// glob patterns: ${input}`);
	}

	let relativePath: string;
	try {
		relativePath = decodeURIComponent(rawPathname.replace(/^\//, ""));
	} catch {
		throw new Error(`Invalid URL encoding in memory:// path: ${input}`);
	}

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

View on GitHub (pinned to 9690622007)

Solutions

  1. Use the memory:// scheme with the root namespace: memory://root/<glob-path>.
  2. For non-root namespaces, address a single memory id directly (memory://<id>) instead of globbing.
  3. Fix templating/config that substitutes the wrong scheme (skill:// vs memory://).

Example fix

// before
splitMemoryGlobPattern("skill://root/notes/*.md");
// after
splitMemoryGlobPattern("memory://root/notes/*.md");
Defensive patterns

Strategy: validation

Validate before calling

function isRootNamespaceMemoryGlob(input: string): boolean {
  return /^memory:\/\/root(\/|$)/i.test(input);
}
// only call splitMemoryGlobPattern when isRootNamespaceMemoryGlob(input)

Type guard

function isMemoryUrl(input: string): boolean {
  try {
    return new URL(input).protocol === "memory:";
  } catch {
    return false;
  }
}

Try / catch

try {
  return splitMemoryGlobPattern(input);
} catch (e) {
  if (e instanceof Error && e.message.includes("require the root namespace")) {
    throw new Error(`${input} is not globbable; address a single memory://root/... path or a single memory://<id>`);
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling splitMemoryGlobPattern with skill://root/..., memory://<memory-id>/..., or any non-memory scheme carrying a wildcard path.

Common situations: Copy-pasting a skill:// URL into a memory glob; trying to wildcard over mnemopi memory ids; a script templating the wrong scheme prefix.

Related errors


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