{"record":{"id":"ed6df6fe4cd13fec","repo":"can1357/oh-my-pi","slug":"no-documentation-files-found","errorCode":null,"errorMessage":"No documentation files found","messagePattern":"No documentation files found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/coding-agent/src/internal-urls/omp-protocol.ts","lineNumber":43,"sourceCode":"\t\tconst host = url.rawHost || url.hostname;\n\t\tconst pathname = url.rawPathname ?? url.pathname;\n\t\tconst filename = host ? (pathname && pathname !== \"/\" ? host + pathname : host) : \"\";\n\n\t\tif (!filename) {\n\t\t\treturn this.#listDocs(url);\n\t\t}\n\n\t\treturn this.#readDoc(filename, url);\n\t}\n\n\tasync complete(): Promise<UrlCompletion[]> {\n\t\treturn getDocFilenames().map(value => ({ value }));\n\t}\n\n\tasync #listDocs(url: InternalUrl): Promise<InternalResource> {\n\t\tconst filenames = getDocFilenames();\n\t\tif (filenames.length === 0) {\n\t\t\tthrow new Error(\"No documentation files found\");\n\t\t}\n\n\t\tconst listing = filenames.map(f => `- [${f}](omp://${f})`).join(\"\\n\");\n\t\tconst content = `# Documentation\\n\\n${filenames.length} files available:\\n\\n${listing}\\n`;\n\n\t\treturn {\n\t\t\turl: url.href,\n\t\t\tcontent,\n\t\t\tcontentType: \"text/markdown\",\n\t\t\tsize: Buffer.byteLength(content, \"utf-8\"),\n\t\t};\n\t}\n\n\tasync #readDoc(filename: string, url: InternalUrl): Promise<InternalResource> {\n\t\t// Validate: no traversal, no absolute paths\n\t\tif (path.isAbsolute(filename)) {\n\t\t\tthrow new Error(\"Absolute paths are not allowed in omp:// URLs\");\n\t\t}","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/internal-urls/omp-protocol.ts#L25-L61","documentation":"The omp:// protocol handler serves the bundled documentation of the running binary via getDocFilenames(). When that list is empty — no docs are bundled/available — #listDocs throws this error instead of returning an empty listing.","triggerScenarios":"Resolving omp:// or omp://docs when the installed build contains no bundled documentation files (getDocFilenames() returns []).","commonSituations":"Custom or minimal builds without bundled docs; development installs where doc assets were not generated; unusual install methods that skip doc bundling.","solutions":["Install an official release build that bundles documentation files.","Regenerate/build the package with docs included (run the doc generation/bundle step).","Rely on upstream docs (docs website/repo) instead of omp:// in this environment."],"exampleFix":"// before\nconst doc = await router.resolve('omp://docs');\n// after: handle docs-absent builds\nlet doc;\ntry { doc = await router.resolve('omp://docs'); }\ncatch (e) { doc = e.message === 'No documentation files found' ? null : undefined; if (doc === undefined) throw e; }","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"let docs;\ntry {\n  docs = await router.resolve('omp://docs');\n} catch (err) {\n  if (err instanceof Error && err.message === 'No documentation files found') docs = null;\n  else throw err;\n}","preventionTips":["Detect doc availability once at startup and cache the result.","Point users to online docs when the local build ships none.","Use official release builds in environments where omp:// docs are relied upon."],"tags":["documentation","internal-url","build-artifacts"],"backgroundTag":"resource-not-found","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}