earendil-works/pi · error · Error

Unsupported platform

Error message

Unsupported platform: ${plat}/${architecture}

What it means

downloadTool could not map the current platform/architecture to a release asset name for fd or rg, i.e. no prebuilt binary is published for this platform.

Solutions

  1. Install the tool (fd or rg) manually via the system package manager
  2. Check whether a release asset exists for this platform and open an issue if missing
  3. Run on a platform with published assets
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/coding-agent/src/utils/tools-manager.ts:258 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24). Data as JSON: /api/errors/6ff0e4637b37a989. Report an issue: GitHub.

Appendix: source

Thrown at packages/coding-agent/src/utils/tools-manager.ts:258

// Download and install a tool
async function downloadTool(tool: "fd" | "rg"): Promise<string> {
	const config = TOOLS[tool];
	if (!config) throw new Error(`Unknown tool: ${tool}`);

	const plat = platform();
	const architecture = arch();

	// Get latest version
	let version = await getLatestVersion(config.repo);
	if (tool === "fd" && plat === "darwin" && architecture === "x64") {
		version = "10.3.0";
	}

	// Get asset name for this platform
	const assetName = config.getAssetName(version, plat, architecture);
	if (!assetName) {
		throw new Error(`Unsupported platform: ${plat}/${architecture}`);
	}

	// Create tools directory
	mkdirSync(TOOLS_DIR, { recursive: true });

	const downloadUrl = `https://github.com/${config.repo}/releases/download/${config.tagPrefix}${version}/${assetName}`;
	const archivePath = join(TOOLS_DIR, assetName);
	const binaryExt = plat === "win32" ? ".exe" : "";
	const binaryPath = join(TOOLS_DIR, config.binaryName + binaryExt);

	// Download
	await downloadFile(downloadUrl, archivePath);

	// Extract into a unique temp directory. fd and rg downloads can run concurrently
	// during startup, so sharing a fixed directory causes races.
	const extractDir = join(
		TOOLS_DIR,
		`extract_tmp_${config.binaryName}_${process.pid}_${Date.now()}_${Math.random().toString(36).slice(2, 10)}`,

View on GitHub (pinned to 4af9d21d3b)