can1357/oh-my-pi · error · Error

No omp binary available for guest architecture ${vm.arch}

Error message

No omp binary available for guest architecture ${vm.arch}

What it means

installAgent installs the omp binary into a running trial microVM and throws this error when the AgentBinaries map has no prebuilt binary for the VM's guest architecture. Binaries are only prepared for the arches requested at prepare time, so a VM on an unprepared arch cannot be provisioned.

Source

Thrown at packages/metaharness/src/tb/agent.ts:91

		await run(["bun", "scripts/ci-release-build-binaries.ts", "--targets", targets], REPO_ROOT);
		for (const arch of missing) {
			const source = path.join(CODING_AGENT_DIR, "binaries", `omp-linux-${arch}`);
			const destination = cached[arch]!;
			if (!(await Bun.file(source).exists())) throw new Error(`Binary build did not produce ${source}`);
			await Bun.write(destination, Bun.file(source));
			await fs.chmod(destination, 0o755);
		}
	}

	const binaries: AgentBinaries = { version: manifest.version };
	for (const arch of arches) binaries[arch] = cached[arch];
	return binaries;
}

/** Install omp and gateway-only configuration into one running trial microVM. */
export async function installAgent(vm: TrialVm, binaries: AgentBinaries, gateway: GatewayConfig): Promise<string> {
	const binary = binaries[vm.arch];
	if (!binary) throw new Error(`No omp binary available for guest architecture ${vm.arch}`);

	const entrypoint = "/opt/omp/omp";
	const mkdir = await vm.exec("mkdir -p /opt/omp");
	if (mkdir.exitCode !== 0) throw new Error(`Could not create /opt/omp: ${mkdir.stderr.trim()}`);
	await vm.copyTo(binary, entrypoint);
	const chmod = await vm.exec(`chmod 755 ${shellQuote(entrypoint)}`);
	if (chmod.exitCode !== 0) throw new Error(`Could not make omp executable: ${chmod.stderr.trim()}`);
	const warmup = await vm.exec(`${shellQuote(entrypoint)} --version`);
	if (warmup.exitCode !== 0) throw new Error(`omp --version failed: ${warmup.stderr.trim()}`);

	const providers = [...new Set(gateway.providers)];
	const modelLines = ["# Generated by metaharness — auth via host pm2 gateway.", "providers:"];
	for (const provider of providers) {
		modelLines.push(`  ${provider}:`);
		modelLines.push(`    baseUrl: ${gateway.url}`);
		modelLines.push("    auth: oauth");
		modelLines.push("    transport: pi-native");
		modelLines.push(`    apiKey: ${gateway.token}`);

View on GitHub (pinned to 9690622007)

Solutions

  1. Include the VM's arch in the `arches` option when calling prepareAgentBinaries
  2. Prepare binaries for all arches your VM fleet uses: `arches: ["x64", "arm64"]`
  3. Constrain VM creation to arches that have binaries, checking `binaries[arch]` before launching the VM
  4. If caching is used, make sure the cache was populated for that arch/version

Example fix

// before
const binaries = await prepareAgentBinaries({ arches: ["x64"], cacheDir, rebuild: false });
await installAgent(arm64Vm, binaries, gateway); // throws
// after
const arches = [...new Set(vms.map(vm => vm.arch))];
const binaries = await prepareAgentBinaries({ arches, cacheDir, rebuild: false });
Defensive patterns

Strategy: fallback

Validate before calling

function binaryAvailable(binaries: AgentBinaries, arch: GuestArch): boolean {
  return typeof binaries[arch] === "string" && binaries[arch].length > 0;
}

Type guard

function hasBinary(b: AgentBinaries, arch: GuestArch): boolean {
  return b[arch] !== undefined;
}

Try / catch

try {
  await installAgent(vm, binaries, gateway);
} catch (err) {
  if (err instanceof Error && err.message.startsWith("No omp binary available")) {
    const prepared = await prepareAgentBinaries({ arches: [vm.arch], cacheDir, rebuild: false });
    await installAgent(vm, prepared, gateway);
  } else throw err;
}

Prevention

When it happens

Trigger: Calling `installAgent(vm, binaries, gateway)` with a TrialVm whose `vm.arch` was not included in the `arches` passed to prepareAgentBinaries (so `binaries[vm.arch]` is undefined).

Common situations: Spawning arm64 microVMs while only x64 binaries were prepared (or vice versa); a config change added new guest arches without updating prepareAgentBinaries call; arch mismatch between host defaults and VM template.

Related errors


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