can1357/oh-my-pi · error

issue:// listing failed: ${message}

Error message

issue:// listing failed: ${message}

What it means

Wrapper error thrown by IssueProtocolHandler.resolve (packages/coding-agent/src/internal-urls/issue-pr-protocol.ts:526) when fetchAndRenderList — the listing path for issue://owner/repo (optionally ?comments=) — fails. The original error's message is preserved via `issue:// listing failed: ${message}`. The scheme prefix distinguishes it from the equivalent pr:// listing wrapper.

Source

Thrown at packages/coding-agent/src/internal-urls/issue-pr-protocol.ts:526

/**
 * Handler for `issue://` URLs.
 */
export class IssueProtocolHandler implements ProtocolHandler {
	readonly scheme = "issue";
	readonly immutable = true;

	async resolve(url: InternalUrl, context?: ResolveContext): Promise<InternalResource> {
		if (context?.signal?.aborted) {
			throw new Error("aborted");
		}
		const parsed = parseUrl(url, "issue");
		if (parsed.kind === "list") {
			try {
				return await fetchAndRenderList("issue", parsed, url, context);
			} catch (err) {
				const message = err instanceof Error ? err.message : String(err);
				throw new Error(`issue:// listing failed: ${message}`);
			}
		}
		// parseUrl already rejects `issue://.../diff`; this guard is a belt-and-
		// suspenders catch in case the union grows.
		if (parsed.kind !== "single") {
			throw new Error(`Invalid issue:// URL: unexpected variant '${parsed.kind}'`);
		}
		try {
			const lookup = await getOrFetchIssue({
				cwd: resolveCwd(context),
				repo: parsed.repo,
				issue: String(parsed.number),
				includeComments: parsed.comments,
				signal: context?.signal,
				settings: settingsFromContext(context),
			});
			return buildSingleResource({
				url,

View on GitHub (pinned to 9690622007)

Solutions

  1. Read the inner message after the prefix — it carries the actual cause (auth, network, repo-not-found) — and fix that.
  2. Run `gh auth status` and `gh auth login` if the inner message indicates authentication failure.
  3. Verify the repo slug: use the explicit issue://owner/repo form instead of the bare issue://<n> form.
  4. Check network connectivity / GitHub API rate limits (gh api rate_limit) and retry after the limit resets.
  5. Ensure the session cwd is inside the intended git repository when relying on default-repo resolution.

Example fix

// before
const res = await handler.resolve(parse("issue://acme/widgets"));
// after
try {
  const res = await handler.resolve(parse("issue://acme/widgets"));
} catch (err) {
  if (!String(err.message).startsWith("issue:// listing failed:")) throw err;
  const cause = String(err.message).replace("issue:// listing failed: ", "");
  console.error(`Cannot list issues: ${cause}`);
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Verify prerequisites before resolving:
const gh = $which("gh");
if (!gh) throw new Error("gh CLI not installed");
const auth = await $`gh auth status`.quiet().nothrow();
if (auth.exitCode !== 0) throw new Error("gh not authenticated");
if (!/^issue:\/\/[^/]+\/[^/]+/.test(url.href)) throw new Error("use issue://owner/repo form");

Type guard

function isIssueListFailure(err: unknown): err is Error {
  return err instanceof Error && err.message.startsWith("issue:// listing failed: ");
}

Try / catch

try {
  return await issueHandler.resolve(url, ctx);
} catch (err) {
  if (err instanceof Error && err.message.startsWith("issue:// listing failed: ")) {
    const cause = err.message.slice("issue:// listing failed: ".length);
    logger.warn("issue listing failed", { cause });
    return null; // degrade gracefully
  }
  throw err;
}

Prevention

When it happens

Trigger: Resolving an issue:// listing URL when the underlying list fetch fails: gh CLI missing or unauthenticated, network failure reaching GitHub, invalid repo slug (owner/repo typo or private repo without access), or git remote unresolvable for a repo-less issue://<n> URL.

Common situations: No `gh` installed or not logged in; rate-limited by GitHub API; mistyped owner/repo in the URL; offline; repo-less short form used outside a git repository with no GitHub remote.

Related errors


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