can1357/oh-my-pi · error · Error
Unsupported platform: ${plat}/${architecture}
Error message
Unsupported platform: ${plat}/${architecture} What it means
Each tool config exposes getAssetName(version, platform, arch) that maps the runtime OS/CPU to the upstream release asset filename, returning null when no asset exists for that combination. downloadTool() turns that null into this error naming the platform/arch pair, preventing a doomed 404 download.
Source
Thrown at packages/coding-agent/src/utils/tools-manager.ts:231
throw err;
}
}
// Download and install a tool
async function downloadTool(tool: ToolName, signal?: AbortSignal): Promise<string> {
const config = TOOLS[tool];
if (!config) throw new Error(`Unknown tool: ${tool}`);
const plat = os.platform();
const architecture = os.arch();
// Get latest version
const version = await getLatestVersion(config.repo, signal);
// 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
await fs.promises.mkdir(TOOLS_DIR, { recursive: true });
const downloadUrl = `https://github.com/${config.repo}/releases/download/${config.tagPrefix}${version}/${assetName}`;
const binaryExt = plat === "win32" ? ".exe" : "";
const binaryPath = path.join(TOOLS_DIR, config.binaryName + binaryExt);
// 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;
}
View on GitHub (pinned to 9690622007)
Solutions
- Check the message's plat/arch against the tool's GitHub releases page to confirm no asset exists for your combination.
- Build the tool from source and install it on PATH so the manager uses the system binary.
- Run under a supported platform (x64/arm64 macOS, Linux, Windows) or a supported container image.
- Contribute/extend getAssetName if upstream actually publishes an asset the mapping misses.
- Use a qemu/rosetta emulation layer on a supported-arch host as a workaround.
Example fix
// before: on linux/armv7 getAssetName returns null so the throw fires | // after: install via system package manager instead of auto-download, e.g. apt-get install -y ripgrep
Defensive patterns
Strategy: fallback
Validate before calling
// check platform support before triggering download | const supported = new Set(["darwin-arm64", "darwin-x64", "linux-x64", "linux-arm64", "win32-x64"]); if (!supported.has(`${process.platform}-${process.arch}`)) console.warn("No prebuilt tool for this platform; use system binary"); Type guard
function hasPrebuiltAsset(plat: string, arch: string): boolean { return ["darwin", "linux", "win32"].includes(plat) && ["x64", "arm64"].includes(arch); } Try / catch
try { const p = await toolsManager.path("rg"); } catch (err) { if (err.message.startsWith("Unsupported platform:")) { /* use system-installed fallback, e.g. $which("rg") */ } else throw err; } Prevention
- Ship a system-package-manager install path (apt/brew/winget) for unsupported platforms.
- Gate auto-download on a supported-platform allowlist.
- Test CI matrices on arm64 and x64 to catch mapping gaps.
- Check the upstream releases page for the exact platform/arch before deploying to exotic hosts.
When it happens
Trigger: Running on an OS/architecture for which the tool's upstream releases publish no binary — e.g. freebsd, android, win32-arm64, linux-riscv64, or an arch (armv7) upstream doesn't ship.
Common situations: Running the agent on niche hardware (Raspberry Pi 32-bit, ARM Windows), inside Alpine/musl containers where upstream only publishes glibc assets that the mapping excludes, or emulated architectures in CI.
Related errors
- Unsupported platform: ${platform}
- Unsupported architecture: ${arch}
- ssh://: ${target.name} is a Windows host; ssh:// supports PO
- Failed to download: ${response.status}
- Binary not found in archive: ${extractedBinary}
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/e1c7ef48e8ededba.
Report an issue: GitHub.