can1357/oh-my-pi · error · ToolError

Cannot resolve ${scheme}:// URL in bash command: ${url} Inte

Error message

Cannot resolve ${scheme}:// URL in bash command: ${url}
Internal URL router is unavailable for this protocol in the current session.

What it means

For any scheme other than skill/attachment/local, resolution is delegated to the session's internal URL router. If no router is wired into the session, or the router's canHandle(url) returns false for this scheme, the tool throws this ToolError saying the router is unavailable for that protocol.

Source

Thrown at packages/coding-agent/src/tools/bash-skill-urls.ts:296

		}
		return path.resolve(attachment.sourcePath);
	}

	if (scheme === "local") {
		if (!localOptions) {
			throw new ToolError(
				"Cannot resolve local:// URL in bash command: local protocol options are unavailable for this session.",
			);
		}
		const resolvedLocalPath = resolveLocalUrlToPath(url, localOptions);
		if (ensureLocalParentDirs) {
			await fs.mkdir(path.dirname(resolvedLocalPath), { recursive: true });
		}
		return resolvedLocalPath;
	}

	if (!internalRouter?.canHandle(url)) {
		throw new ToolError(
			`Cannot resolve ${scheme}:// URL in bash command: ${url}\n` +
				"Internal URL router is unavailable for this protocol in the current session.",
		);
	}

	let resource: InternalResource;
	try {
		resource = await internalRouter.resolve(url, { cwd, pathOnly: true, sessionFile });
	} catch (error) {
		const message = error instanceof Error ? error.message : String(error);
		throw new ToolError(`Failed to resolve ${scheme}:// URL in bash command: ${url}\n${message}`);
	}

	if (!resource.sourcePath) {
		throw new ToolError(`${scheme}:// URL resolved without a filesystem path and cannot be used in bash: ${url}`);
	}

	return path.resolve(resource.sourcePath);

View on GitHub (pinned to 9690622007)

Solutions

  1. Load/enable the plugin or extension that registers a handler for this scheme in the session.
  2. Verify the scheme spelling matches a handler the router registers (canHandle).
  3. Use a built-in scheme (skill://, attachment://, local://) or a direct filesystem path instead.
  4. Check session configuration so the internal URL router is constructed and passed to the bash tool.
Defensive patterns

Strategy: fallback

Validate before calling

if (internalRouter && !internalRouter.canHandle(url)) throw new Error(`No handler for ${url}`);

Try / catch

try { await expandInternalUrls(cmd, ctx); } catch (e) { if (e instanceof ToolError && /Internal URL router is unavailable/.test(e.message)) useBuiltinSchemeOrPath(e); else throw e; }

Prevention

When it happens

Trigger: A bash command references a custom/router scheme (e.g. some-plugin://resource) but internalRouter is undefined, or the router does not register a handler for that URL/scheme in the current session.

Common situations: Using an extension scheme provided by a plugin that isn't loaded in this session; running in a stripped-down/embedded session without the internal URL router; typo in the scheme so it doesn't match any registered handler.

Related errors


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