{"record":{"id":"a2950c49418a3ade","repo":"Yeachan-Heo/oh-my-codex","slug":"api-native-binary-not-found-checked-cached-nati","errorCode":null,"errorMessage":"[api] native binary not found. Checked cached/native candidates under ${packageRoot}, ${repoLocal}, and ${nestedRepoLocal}. ${rejectedCache ? `Rejected managed cache entry ${rejectedCache.path} (${rejectedCache.state}). ` : ''}Reconnect to the network so OMX can fetch the release asset, or set ${OMX_API_BIN_ENV} to override the path.","messagePattern":"\\[api\\] native binary not found\\. Checked cached/native candidates under (.+?), (.+?), and (.+?)\\. (.+?) \\((.+?)\\)\\. ` : ''\\}Reconnect to the network so OMX can fetch the release asset, or set (.+?) to override the path\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"src/cli/api.ts","lineNumber":177,"sourceCode":"    const inspected = await inspectManagedNativeBinary(cached, env);\n    if (inspected.state === 'verified') return inspected.path!;\n    if (inspected.state !== 'missing') rejectedCache ??= { path: cached, state: inspected.state };\n  }\n\n  for (const packaged of packagedApiBinaryCandidatePaths(packageRoot, platform, arch, env, linuxLibcPreference)) {\n    if (exists(packaged)) return packaged;\n  }\n\n  const repoLocal = repoLocalApiBinaryPath(packageRoot, platform);\n  if (exists(repoLocal)) return repoLocal;\n\n  const nestedRepoLocal = nestedRepoLocalApiBinaryPath(packageRoot, platform);\n  if (exists(nestedRepoLocal)) return nestedRepoLocal;\n\n  const hydrated = await hydrateNativeBinary('omx-api', { packageRoot, env, platform, arch });\n  if (hydrated) return hydrated;\n\n  throw new Error(\n    `[api] native binary not found. Checked cached/native candidates under ${packageRoot}, ${repoLocal}, and ${nestedRepoLocal}. `\n      + `${rejectedCache ? `Rejected managed cache entry ${rejectedCache.path} (${rejectedCache.state}). ` : ''}`\n      + `Reconnect to the network so OMX can fetch the release asset, or set ${OMX_API_BIN_ENV} to override the path.`,\n  );\n}\n\nexport function runApiBinary(\n  binaryPath: string,\n  args: readonly string[],\n  options: RunApiBinaryOptions = {},\n): SpawnSyncReturns<string> {\n  const { cwd = process.cwd(), env = process.env, spawnImpl = spawnSync } = options;\n  const spawnOptions: SpawnSyncOptionsWithStringEncoding = {\n    cwd,\n    env,\n    stdio: ['ignore', 'pipe', 'pipe'],\n    encoding: 'utf-8',\n  };","sourceCodeStart":159,"sourceCodeEnd":195,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/api.ts#L159-L195","documentation":"Like error 81 but thrown after hydration: `resolveApiBinaryPathWithHydration` first tries to download/fetch the native binary into a managed cache via `hydrateNativeBinary`, and only throws when that also fails (e.g. offline). The message distinguishes a rejected cache entry (stale/corrupt state) from simply having no candidates, and suggests reconnecting or setting the override env var.","triggerScenarios":"Running `omx api` (or calling `binaryPath()`/`resolveApiBinaryPathWithHydration`) while offline with no local binary and no usable cached copy, or when the managed cache entry exists but is in a rejected state (failed verification/partial download).","commonSituations":"Air-gapped or proxied CI environments blocking the release asset download; expired or corrupt download cache; firewall blocking the GitHub/release host; laptops on restricted networks.","solutions":["Reconnect to the network (or fix proxy/firewall rules) so the release asset can be fetched, then retry","Set OMX_API_BIN_ENV to point at a manually provisioned omx-api binary","Clear the rejected managed cache entry and retry so it is re-downloaded cleanly","Pre-provision the binary in the image/cache so no network fetch is needed at runtime"],"exampleFix":"# before\nomx api status   # offline, no binary\n# after\nexport OMX_API_BIN=/opt/omx/bin/omx-api\nomx api status","handlingStrategy":"fallback","validationCode":"import { existsSync } from 'node:fs';\nif (!process.env.OMX_API_BIN) {\n  console.warn('No local omx-api binary; ensure network access for first-run hydration');\n}","typeGuard":null,"tryCatchPattern":"catch (e) { if (/Reconnect to the network/.test(String(e))) { switchToPinnedLocalBinary(); } else throw e; }","preventionTips":["Warm the binary cache during provisioning while online","Vendor the binary and point OMX_API_BIN at it for offline CI","Treat first-run hydration as a setup step, not a runtime step"],"tags":["native-binary","network","offline","cache","api","environment-variable"],"backgroundTag":"native-binary-download-failed","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}