can1357/oh-my-pi · warning

No documentation files found

Error message

No documentation files found

What it means

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.

Source

Thrown at packages/coding-agent/src/internal-urls/omp-protocol.ts:43

		const host = url.rawHost || url.hostname;
		const pathname = url.rawPathname ?? url.pathname;
		const filename = host ? (pathname && pathname !== "/" ? host + pathname : host) : "";

		if (!filename) {
			return this.#listDocs(url);
		}

		return this.#readDoc(filename, url);
	}

	async complete(): Promise<UrlCompletion[]> {
		return getDocFilenames().map(value => ({ value }));
	}

	async #listDocs(url: InternalUrl): Promise<InternalResource> {
		const filenames = getDocFilenames();
		if (filenames.length === 0) {
			throw new Error("No documentation files found");
		}

		const listing = filenames.map(f => `- [${f}](omp://${f})`).join("\n");
		const content = `# Documentation\n\n${filenames.length} files available:\n\n${listing}\n`;

		return {
			url: url.href,
			content,
			contentType: "text/markdown",
			size: Buffer.byteLength(content, "utf-8"),
		};
	}

	async #readDoc(filename: string, url: InternalUrl): Promise<InternalResource> {
		// Validate: no traversal, no absolute paths
		if (path.isAbsolute(filename)) {
			throw new Error("Absolute paths are not allowed in omp:// URLs");
		}

View on GitHub (pinned to 9690622007)

Solutions

  1. Install an official release build that bundles documentation files.
  2. Regenerate/build the package with docs included (run the doc generation/bundle step).
  3. Rely on upstream docs (docs website/repo) instead of omp:// in this environment.

Example fix

// before
const doc = await router.resolve('omp://docs');
// after: handle docs-absent builds
let doc;
try { doc = await router.resolve('omp://docs'); }
catch (e) { doc = e.message === 'No documentation files found' ? null : undefined; if (doc === undefined) throw e; }
Defensive patterns

Strategy: fallback

Try / catch

let docs;
try {
  docs = await router.resolve('omp://docs');
} catch (err) {
  if (err instanceof Error && err.message === 'No documentation files found') docs = null;
  else throw err;
}

Prevention

When it happens

Trigger: Resolving omp:// or omp://docs when the installed build contains no bundled documentation files (getDocFilenames() returns []).

Common situations: Custom or minimal builds without bundled docs; development installs where doc assets were not generated; unusual install methods that skip doc bundling.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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