can1357/oh-my-pi · error · Error

omp --version failed: ${warmup.stderr.trim()}

Error message

omp --version failed: ${warmup.stderr.trim()}

What it means

As a post-install warmup, installAgent executes `/opt/omp/omp --version` inside the VM. Non-zero exit means the freshly installed binary does not run, so this error is thrown with the binary's stderr.

Source

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

	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}`);
	}
	const modelsYaml = `${modelLines.join("\n")}\n`;
	const configYaml = `providers:
  openrouterVariant: ${gateway.openrouterVariant}
modelRoles:
  vision: openrouter/qwen/qwen3.7-flash
edit:
  mode: replace
web_search:

View on GitHub (pinned to 9690622007)

Solutions

  1. Read stderr: 'Exec format error' = arch mismatch; 'not found' for a shared library = link mismatch
  2. Confirm binaries[vm.arch] matches the guest architecture
  3. Re-copy the binary and re-run `omp --version` manually in the VM to reproduce
  4. Rebuild omp statically or for the guest's libc (musl vs glibc)
  5. Check the guest kernel version meets the binary's minimum

Example fix

// before: x86_64 binary copied into arm64 guest -> 'Exec format error'
const binary = binaries[vm.arch];
if (!binary) throw new Error(`No omp binary available for guest architecture ${vm.arch}`);
// after: fail fast with an explicit arch check before warmup
const arch = await vm.exec("uname -m");
if (!binary || !binary.path.includes(arch.stdout.trim())) {
	throw new Error(`omp binary does not match guest arch ${arch.stdout.trim()}`);
}
Defensive patterns

Strategy: try-catch

Validate before calling

const arch = (await vm.exec("uname -m")).stdout.trim();
if (!binaries[arch]) throw new Error(`no omp binary for guest arch ${arch}`);

Try / catch

try {
  await installAgent(vm, binaries, gateway);
} catch (err) {
  if (String(err.message).includes("omp --version failed")) {
    const dbg = await vm.exec("file /opt/omp/omp; ldd /opt/omp/omp || true");
    console.error(dbg.stdout, err);
  }
  throw err;
}

Prevention

When it happens

Trigger: `omp --version` exits non-zero — the binary was built for the wrong guest architecture (vm.arch mismatch), missing dynamic libraries, corrupt/truncated copy, or the binary crashes at startup.

Common situations: Cross-arch VM (arm64 guest, x86_64 binary) with no binfmt/qemu emulation; glibc/musl mismatch between build host and guest; interrupted copyTo leaving a truncated file; binary requires a newer kernel than the guest runs.

Related errors


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