Yeachan-Heo/oh-my-codex · error
Unable to resolve OMX CLI entry path for question UI launch.
Error message
Unable to resolve OMX CLI entry path for question UI launch.
What it means
resolveQuestionUiProcessArgs needs a path to the OMX CLI executable to spawn the question UI. It first tries resolveOmxCliEntryPath (using process.argv[1], cwd, env) and falls back to process.argv[1]; if both are empty (no fallback available), it throws. This happens when the process was launched in a way that argv[1] is unset and the resolver cannot locate the entry file.
Source
Thrown at src/question/renderer.ts:344
target: paneId,
launched_at: launchedAt,
...(returnTarget ? { return_target: returnTarget, return_transport: 'tmux-send-keys' as const } : {}),
};
}
function resolveQuestionUiProcessArgs(
recordPath: string,
options: {
cwd: string;
env?: NodeJS.ProcessEnv;
},
): string[] {
const omxBin = resolveOmxCliEntryPath({
argv1: process.argv[1],
cwd: options.cwd,
env: options.env,
}) || process.argv[1];
if (!omxBin) throw new Error('Unable to resolve OMX CLI entry path for question UI launch.');
return [omxBin, 'question', '--ui', '--state-path', recordPath];
}
export function buildQuestionUiTmuxArgs(
recordPath: string,
options: {
cwd: string;
env?: NodeJS.ProcessEnv;
sessionId?: string;
returnTarget?: string;
underCmux?: boolean;
},
): string[] {
const envEntries: Array<[string, string]> = [];
if (options.sessionId) envEntries.push(['OMX_SESSION_ID', options.sessionId]);
if (options.returnTarget) {
envEntries.push(['OMX_QUESTION_RETURN_TARGET', options.returnTarget]);
envEntries.push(['OMX_QUESTION_RETURN_TRANSPORT', 'tmux-send-keys']);View on GitHub (pinned to 3ad79a8a6f)
Solutions
- Run the question UI via the installed omx CLI itself so process.argv[1] points at the entry file.
- If embedding, pass options.cwd/options.env that let resolveOmxCliEntryPath find the CLI package (e.g. cwd inside the package or an env var pointing to it).
- Check process.argv[1] is non-empty in your host before calling launchQuestionRenderer.
Defensive patterns
Strategy: validation
Validate before calling
if (!process.argv[1]) throw new Error('cannot launch question UI: host has no argv[1] CLI entry'); Try / catch
try { resolveQuestionUiProcessArgs(recordPath, opts); } catch (e) { if (e instanceof Error && /OMX CLI entry path/.test(e.message)) { /* pass explicit cwd/env pointing at the installed CLI package */ } else throw e; } Prevention
- Launch the question UI from the real installed omx CLI, not an embedded host.
- Keep cwd inside the CLI package or export env hints the resolver uses.
- Add a startup assertion that argv[1] exists in custom hosts.
When it happens
Trigger: process.argv[1] empty (e.g. embedded node, `node -e`, a REPL, or a bundled runtime) AND resolveOmxCliEntryPath returning null because cwd/env do not contain the expected CLI layout. Typical in Electron-style hosts, Codex App integration, or tests that stub argv.
Common situations: Running omx as a library from a custom host rather than the installed CLI; cwd changed to a directory without the CLI package; packaging (pkg/bun single-file) that removes the real entry path.
Related errors
- omx question cannot open a visible renderer because this pro
- stderr || `git ${args.join(' ')} failed`
- editor exited with status ${result.status ?? 'unknown'}
- [explore] ${reason}
- [sparkshell] raw fallback failed: executable not found (${in
AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27).
Data as JSON: /api/errors/992a58d1e03a62d2.
Report an issue: GitHub.