can1357/oh-my-pi · error · ToolError

Cannot find internal URL without a backing file: ${memoryGlo

Error message

Cannot find internal URL without a backing file: ${memoryGlob.baseUrl}

What it means

A memory:// glob needs a real backing directory on disk to translate the glob into a filesystem pattern. When InternalUrlRouter.resolve returns a resource with no sourcePath (the URL has no backing file/directory), the tool cannot proceed and throws.

Source

Thrown at packages/coding-agent/src/tools/glob.ts:233

						`find cannot operate on a remote ssh:// path: ${rawPattern}. ssh:// has no local file to glob; use \`read ${rawPattern}\` to list or inspect the remote path.`,
					);
				}
				if (hasGlobPathChars(rawPattern)) {
					if (!/^memory:\/\//i.test(rawPattern)) {
						throw new ToolError(`Glob patterns are not supported for internal URLs: ${rawPattern}`);
					}
					const memoryGlob = splitMemoryGlobPattern(rawPattern);
					const resource = await internalRouter.resolve(memoryGlob.baseUrl, {
						cwd: this.session.cwd,
						settings: this.session.settings,
						signal,
						sessionFile: this.session.getSessionFile() ?? undefined,
						localProtocolOptions: this.session.localProtocolOptions,
						skills: this.session.skills,
						pathOnly: true,
					});
					if (!resource.sourcePath) {
						throw new ToolError(`Cannot find internal URL without a backing file: ${memoryGlob.baseUrl}`);
					}
					normalizedPatterns.push(
						path.join(resource.sourcePath.replace(/[*?[{]/g, "[$&]"), memoryGlob.globPattern),
					);
					continue;
				}
				const resource = await internalRouter.resolve(rawPattern, {
					cwd: this.session.cwd,
					settings: this.session.settings,
					signal,
					sessionFile: this.session.getSessionFile() ?? undefined,
					localProtocolOptions: this.session.localProtocolOptions,
					skills: this.session.skills,
					pathOnly: true,
				});
				if (!resource.sourcePath) {
					throw new ToolError(`Cannot find internal URL without a backing file: ${rawPattern}`);
				}

View on GitHub (pinned to 9690622007)

Solutions

  1. Verify the memory base URL exists and is file-backed before globbing it
  2. Correct the base path spelling in the memory:// URL
  3. Create/initialize the memory resource first, or glob the underlying directory directly

Example fix

// before
await findTool({ path: "memory://notes/*.md" }); // notes not file-backed
// after
await findTool({ path: "memory://project/notes/*.md" }); // existing base
Defensive patterns

Strategy: validation

Validate before calling

const resource = await internalRouter.resolve(base, { cwd, settings, signal, pathOnly: true });
if (!resource.sourcePath) throw new Error(`memory base not file-backed: ${base}`);

Type guard

const isFileBacked = (r: { sourcePath?: string | null }): r is { sourcePath: string } =>
  typeof r.sourcePath === "string" && r.sourcePath.length > 0;

Try / catch

try {
  await globTool({ path: memoryUrl });
} catch (err) {
  if (err instanceof ToolError && /without a backing file/.test(err.message)) {
    // create/initialize the memory resource or glob the local dir directly
  } else throw err;
}

Prevention

When it happens

Trigger: Calling find with 'memory://something/*.md' where resolve('memory://something', { pathOnly: true }) yields a resource lacking sourcePath — e.g. the memory base doesn't exist or isn't file-backed in this session.

Common situations: Typo in the memory base path; session without memory storage initialized; referencing a memory resource that was never created.

Related errors


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