{"record":{"id":"a3a15ab549a01b43","repo":"can1357/oh-my-pi","slug":"omp-bench-install-local-requires-omp-bench-tarball","errorCode":null,"errorMessage":"OMP_BENCH_INSTALL=local requires OMP_BENCH_TARBALL (host tarball path)","messagePattern":"OMP_BENCH_INSTALL=local requires OMP_BENCH_TARBALL \\(host tarball path\\)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"packages/metaharness/agent/omp_local.py","lineNumber":370,"sourceCode":"        self._bun = self._source_bun\n        cli = f\"{self._source_dir}/packages/coding-agent/src/cli.ts\"\n        q = shlex.quote\n        await self.exec_as_agent(\n            environment,\n            command=(\n                \"set -e; \"\n                f\"test -x {q(self._source_bun)} || {{ echo 'omp source mode: bun mount missing' >&2; exit 5; }}; \"\n                f\"test -f {q(cli)} || {{ echo 'omp source mode: repo mount missing' >&2; exit 5; }}; \"\n                f\"test -d {q(self._source_dir + '/node_modules/@oh-my-pi')} || \"\n                \"{ echo 'omp source mode: linux deps mount missing' >&2; exit 5; }; \"\n                f\"{q(self._source_bun)} --version\"\n            ),\n        )\n        return cli\n\n    async def _install_local(self, environment: BaseEnvironment) -> str:\n        if not self._tarball:\n            raise RuntimeError(\n                \"OMP_BENCH_INSTALL=local requires OMP_BENCH_TARBALL (host tarball path)\"\n            )\n        await environment.upload_file(self._tarball, _TARBALL_DST)\n        app = f\"{self._home}/.omp-bench/app\"\n        await self.exec_as_agent(\n            environment,\n            command=self._wrap(\n                \"set -e; \"\n                f\"mkdir -p {shlex.quote(app)}; \"\n                f\"tar xzf {_TARBALL_DST} -C {shlex.quote(app)} --strip-components=1; \"\n                f\"cd {shlex.quote(app)}; \"\n                # Bundle inlines workspace TS; only externalized deps are needed.\n                # Skip heavy optionals (transformers/sherpa) but add the native addon.\n                \"bun install --production --omit=optional; \"\n                \"arch=$(uname -m); \"\n                'case \"$arch\" in aarch64|arm64) na=arm64 ;; x86_64|amd64) na=x64 ;; '\n                '*) echo \"unsupported arch $arch\" >&2; exit 4 ;; esac; '\n                # Native leaf MUST match the bundle version exactly (loader/API skew","sourceCodeStart":352,"sourceCodeEnd":388,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/metaharness/agent/omp_local.py#L352-L388","documentation":"omp_local's install() supports an install mode 'local' (_install_local) that uploads a prebuilt omp tarball from the host into the environment. If OMP_BENCH_INSTALL=local is set but no tarball path was configured (OMP_BENCH_TARBALL unset), it raises this RuntimeError before doing any work, since there is nothing to upload.","triggerScenarios":"Setting install mode to local (via OMP_BENCH_INSTALL=local env var or equivalent option) while self._tarball (parsed from OMP_BENCH_TARBALL) is None/empty, then calling install().","commonSituations":"Environment variable typo or not exported to the harness process; running the harness from a shell where OMP_BENCH_TARBALL was never set; switching install mode to local without updating the tarball config.","solutions":["Set OMP_BENCH_TARBALL to a valid host path to the omp tarball before running.","Alternatively pick a different install mode (source or binary) that doesn't need a tarball.","Verify the env var is actually exported (export OMP_BENCH_TARBALL=...) so it propagates to the harness process.","Check the tarball path exists on the host; otherwise the subsequent upload will fail too."],"exampleFix":"# before\nOMP_BENCH_INSTALL=local bun run bench\n# after\nOMP_BENCH_INSTALL=local OMP_BENCH_TARBALL=/tmp/omp.tgz bun run bench","handlingStrategy":"validation","validationCode":"import os, pathlib\nif os.environ.get(\"OMP_BENCH_INSTALL\") == \"local\":\n    tb = os.environ.get(\"OMP_BENCH_TARBALL\")\n    assert tb, \"OMP_BENCH_INSTALL=local requires OMP_BENCH_TARBALL\"\n    assert pathlib.Path(tb).is_file(), f\"tarball missing: {tb}\"","typeGuard":null,"tryCatchPattern":"try:\n    await harness.install(env)\nexcept RuntimeError as e:\n    if \"requires OMP_BENCH_TARBALL\" in str(e):\n        print(\"Set OMP_BENCH_TARBALL to a host tarball path, or choose install=source|binary\")\n        sys.exit(2)\n    raise","preventionTips":["Export OMP_BENCH_TARBALL alongside OMP_BENCH_INSTALL=local in launch scripts.","Validate required env vars at harness startup, before spawning containers.","Keep install mode and its required vars together in one config block."],"tags":["configuration","missing-env-var","environment"],"backgroundTag":"missing-env-var","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}