{"record":{"id":"2813e83c0378f4a6","repo":"can1357/oh-my-pi","slug":"cannot-find-internal-url-without-a-backing-file","errorCode":null,"errorMessage":"Cannot find internal URL without a backing file: ${memoryGlob.baseUrl}","messagePattern":"Cannot find internal URL without a backing file: (.+?)","errorType":"validation","errorClass":"ToolError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/tools/glob.ts","lineNumber":233,"sourceCode":"\t\t\t\t\t\t`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.`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tif (hasGlobPathChars(rawPattern)) {\n\t\t\t\t\tif (!/^memory:\\/\\//i.test(rawPattern)) {\n\t\t\t\t\t\tthrow new ToolError(`Glob patterns are not supported for internal URLs: ${rawPattern}`);\n\t\t\t\t\t}\n\t\t\t\t\tconst memoryGlob = splitMemoryGlobPattern(rawPattern);\n\t\t\t\t\tconst resource = await internalRouter.resolve(memoryGlob.baseUrl, {\n\t\t\t\t\t\tcwd: this.session.cwd,\n\t\t\t\t\t\tsettings: this.session.settings,\n\t\t\t\t\t\tsignal,\n\t\t\t\t\t\tsessionFile: this.session.getSessionFile() ?? undefined,\n\t\t\t\t\t\tlocalProtocolOptions: this.session.localProtocolOptions,\n\t\t\t\t\t\tskills: this.session.skills,\n\t\t\t\t\t\tpathOnly: true,\n\t\t\t\t\t});\n\t\t\t\t\tif (!resource.sourcePath) {\n\t\t\t\t\t\tthrow new ToolError(`Cannot find internal URL without a backing file: ${memoryGlob.baseUrl}`);\n\t\t\t\t\t}\n\t\t\t\t\tnormalizedPatterns.push(\n\t\t\t\t\t\tpath.join(resource.sourcePath.replace(/[*?[{]/g, \"[$&]\"), memoryGlob.globPattern),\n\t\t\t\t\t);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst resource = await internalRouter.resolve(rawPattern, {\n\t\t\t\t\tcwd: this.session.cwd,\n\t\t\t\t\tsettings: this.session.settings,\n\t\t\t\t\tsignal,\n\t\t\t\t\tsessionFile: this.session.getSessionFile() ?? undefined,\n\t\t\t\t\tlocalProtocolOptions: this.session.localProtocolOptions,\n\t\t\t\t\tskills: this.session.skills,\n\t\t\t\t\tpathOnly: true,\n\t\t\t\t});\n\t\t\t\tif (!resource.sourcePath) {\n\t\t\t\t\tthrow new ToolError(`Cannot find internal URL without a backing file: ${rawPattern}`);\n\t\t\t\t}","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/tools/glob.ts#L215-L251","documentation":"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.","triggerScenarios":"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.","commonSituations":"Typo in the memory base path; session without memory storage initialized; referencing a memory resource that was never created.","solutions":["Verify the memory base URL exists and is file-backed before globbing it","Correct the base path spelling in the memory:// URL","Create/initialize the memory resource first, or glob the underlying directory directly"],"exampleFix":"// before\nawait findTool({ path: \"memory://notes/*.md\" }); // notes not file-backed\n// after\nawait findTool({ path: \"memory://project/notes/*.md\" }); // existing base","handlingStrategy":"validation","validationCode":"const resource = await internalRouter.resolve(base, { cwd, settings, signal, pathOnly: true });\nif (!resource.sourcePath) throw new Error(`memory base not file-backed: ${base}`);","typeGuard":"const isFileBacked = (r: { sourcePath?: string | null }): r is { sourcePath: string } =>\n  typeof r.sourcePath === \"string\" && r.sourcePath.length > 0;","tryCatchPattern":"try {\n  await globTool({ path: memoryUrl });\n} catch (err) {\n  if (err instanceof ToolError && /without a backing file/.test(err.message)) {\n    // create/initialize the memory resource or glob the local dir directly\n  } else throw err;\n}","preventionTips":["Resolve the memory base with pathOnly first and check sourcePath before globbing","Keep memory resource names consistent; validate base spelling","Ensure the session has memory storage initialized"],"tags":["memory","glob","missing-resource"],"backgroundTag":"internal-url-missing-backing-file","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}