can1357/oh-my-pi · error · Error

Unsupported archive format: ${assetName}

Error message

Unsupported archive format: ${assetName}

What it means

After downloading the asset, downloadTool() dispatches extraction based on the archive extension, supporting only .tar.gz and .zip. If the downloaded assetName has any other extension (bare binary, .tar.xz, .7z), it throws this error before attempting extraction, since no extractor path exists for it.

Source

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

	// Handle direct binary downloads (no archive extraction needed)
	if (config.isDirectBinary) {
		await downloadFile(downloadUrl, binaryPath, signal);
		if (plat !== "win32") {
			await fs.promises.chmod(binaryPath, 0o755);
		}
		return binaryPath;
	}

	// Download archive
	const archivePath = path.join(TOOLS_DIR, assetName);
	await downloadFile(downloadUrl, archivePath, signal);

	// Extract
	const tmp = await TempDir.create("@omp-tools-extract-");

	try {
		if (!assetName.endsWith(".tar.gz") && !assetName.endsWith(".zip")) {
			throw new Error(`Unsupported archive format: ${assetName}`);
		}

		try {
			await extractArchive(archivePath, tmp.path());
		} catch (err) {
			throw new Error(`Failed to extract ${assetName}: ${err instanceof Error ? err.message : String(err)}`);
		}

		// Find the binary in extracted files
		// ast-grep releases the binary directly in the zip, not in a subdirectory
		let extractedBinary: string;
		if (tool === "sg") {
			extractedBinary = path.join(tmp.path(), config.binaryName + binaryExt);
		} else {
			const extractedDir = path.join(tmp.path(), assetName.replace(/\.(tar\.gz|zip)$/, ""));
			extractedBinary = path.join(extractedDir, config.binaryName + binaryExt);
		}

View on GitHub (pinned to 9690622007)

Solutions

  1. Pin to an earlier tool version that still shipped .tar.gz/.zip assets.
  2. Update the tool's TOOLS config / getAssetName to select an asset in a supported format.
  3. Extend the extraction path to support the new archive format (e.g. add .tar.xz handling).
  4. Wait for the manager to add support for the upstream's new packaging.
  5. Download and install the tool manually.
Defensive patterns

Strategy: fallback

Validate before calling

// inspect the release asset's extension before invoking download | const assets = await releaseAssets(repo, version); const asset = pickAsset(assets); if (!asset.endsWith(".tar.gz") && !asset.endsWith(".zip")) throw new Error(`Upstream packaging changed: ${asset}`);

Type guard

function isSupportedArchive(name: string): boolean { return name.endsWith(".tar.gz") || name.endsWith(".zip"); }

Try / catch

try { const p = await toolsManager.download("fd"); } catch (err) { if (err.message.startsWith("Unsupported archive format:")) { /* pin older version or install manually */ } else throw err; }

Prevention

When it happens

Trigger: config.getAssetName() returned an asset whose filename ends in neither .tar.gz nor .zip — e.g. upstream changed packaging to .tar.xz/.7z or a bare executable, and the format check rejects it.

Common situations: An upstream tool changed its release packaging format in a new version, a tool config mismatch causing the wrong asset to be selected, or a getAssetName mapping returning a legacy format no longer produced.

Related errors


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