{"record":{"id":"4d935775e20c5bf9","repo":"Yeachan-Heo/oh-my-codex","slug":"unable-to-resolve-omx-launcher-path-for-tmux-hud-b","errorCode":null,"errorMessage":"Unable to resolve OMX launcher path for tmux HUD bootstrap","messagePattern":"Unable to resolve OMX launcher path for tmux HUD bootstrap","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/index.ts","lineNumber":6304,"sourceCode":"  launchPolicy: CodexLaunchPolicy = \"direct\",\n  detachedPreflight?: DetachedPreflightAvailable,\n  projectLocalCodexHomeForCleanup?: string,\n  runtimeCodexHomeForCleanup?: string,\n  runtimeContext?: MadmaxWorktreeRuntimeContext,\n  verifiedMadmaxContext?: VerifiedMadmaxDetachedContext,\n  launchControlPlane?: DetachedLaunchControlPlane,\n): Promise<{ postLaunchHandledExternally: boolean }> {\n  void preLaunchOptions;\n  const launchArgs = injectModelInstructionsBypassArgs(\n    cwd,\n    args,\n    process.env,\n    sessionModelInstructionsPath(cwd, sessionId),\n  );\n  const nativeWindows = isNativeWindows();\n  const omxBin = resolveOmxCliEntryPath({ argv1: process.argv[1], cwd, env: process.env });\n  if (!omxBin) {\n    throw new Error(\"Unable to resolve OMX launcher path for tmux HUD bootstrap\");\n  }\n  const runtimeEnvOverlay = buildMadmaxWorktreeRuntimeEnvOverlay(runtimeContext);\n  let verifiedTeamContext: VerifiedDetachedTeamContext | undefined;\n  if (launchPolicy === \"detached-tmux\") {\n    try {\n      verifiedTeamContext = await resolveVerifiedDetachedTeamContext(cwd, process.env);\n    } catch {\n      verifiedTeamContext = undefined;\n    }\n  }\n  const verifiedMadmaxContextForLaunch = verifiedMadmaxContext ?? (\n    runtimeContext?.madmaxDetachedContext\n      ? {\n          root: runtimeContext.omxRoot,\n          sourceCwd: runtimeContext.sourceCwd,\n          context: runtimeContext.madmaxDetachedContext,\n          runsRoot: resolveMadmaxRunsRoot(process.env),\n        }","sourceCodeStart":6286,"sourceCodeEnd":6322,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/index.ts#L6286-L6322","documentation":"Identical family to the exec variant: before performing the tmux HUD bootstrap, the launcher must resolve its own CLI entry path to re-exec OMX inside the tmux pane. If resolveOmxCliEntryPath cannot find the entry from argv[1]/cwd/env, the bootstrap is aborted.","triggerScenarios":"Starting a HUD/detached-tmux session where argv[1] does not point to a resolvable OMX entry file — broken installs, odd package-manager shims (pnpm, npx cache), wrappers or loaders that rewrite argv, or running the bundled CLI through a custom runtime.","commonSituations":"Global installs whose bin symlink points to a moved file; running via npx with a cache miss mid-install; containerized or bundled deployments; invoking the CLI's internals from a test harness.","solutions":["Reinstall OMX via the supported installer so the bin shim and entry file match","Invoke through the omx binary rather than wrappers/loaders that obscure argv[1]","Verify the install: run `which omx` and confirm the target file exists; `npm rebuild`/reinstall if not","If embedding OMX, ensure the child launch env/cwd allow entry resolution (consult resolveOmxCliEntryPath's expected inputs)"],"exampleFix":"# before\n$ npx --cache /tmp omx hud\n\n# after\n$ npm i -g omx && omx hud","handlingStrategy":"validation","validationCode":"const bin = resolveOmxCliEntryPath({ argv1: process.argv[1], cwd, env: process.env });\nif (!bin) { console.error(\"OMX entry unresolvable; run `npm i -g omx` and use the omx bin\"); process.exit(1); }","typeGuard":null,"tryCatchPattern":"try { await startHud(); } catch (e) { if (e instanceof Error && /tmux HUD bootstrap/.test(e.message)) { /* reinstall omx and retry via bin */ } throw e; }","preventionTips":["Run `which omx` and confirm the resolved file exists before launching HUD mode","Reinstall after package manager shuffles shims (pnpm/npx)","Do not run the CLI through custom node loaders that hide argv[1]"],"tags":["path-resolution","tmux","hud-bootstrap","install"],"backgroundTag":"module-entry-unresolvable","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}