{"record":{"id":"1a4f050f6ffdb09a","repo":"Yeachan-Heo/oh-my-codex","slug":"question-ui-session-target-disappeared-immediat","errorCode":null,"errorMessage":"Question UI session ${target} disappeared immediately after launch.","messagePattern":"Question UI session (.+?) disappeared immediately after launch\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/question/renderer.ts","lineNumber":1004,"sourceCode":"    });\n    const baseName = basename(options.recordPath, '.json').replace(/[^A-Za-z0-9_-]+/g, '-').slice(0, 32) || 'question';\n    const sessionName = `omx-question-${baseName}`;\n    const output = execTmux([\n      'new-session',\n      '-d',\n      '-P',\n      '-F',\n      '#{session_name}',\n      '-s',\n      sessionName,\n      '-c',\n      options.cwd,\n      ...commandArgs,\n    ]).trim();\n    const target = output || sessionName;\n    sleepImpl(QUESTION_RENDERER_SESSION_SETTLE_MS);\n    if (!isLaunchedQuestionSessionAlive(target, execTmux)) {\n      throw new Error(`Question UI session ${target} disappeared immediately after launch.`);\n    }\n    return {\n      renderer: 'tmux-session',\n      target,\n      launched_at: launchedAt,\n    };\n  }\n\n  if (strategy === 'test-noop') {\n    return {\n      renderer: 'tmux-session',\n      target: 'test-noop-renderer',\n      launched_at: launchedAt,\n    };\n  }\n\n  const exhaustiveStrategy: never = strategy;\n  throw new Error(`Unsupported omx question renderer strategy: ${exhaustiveStrategy}`);","sourceCodeStart":986,"sourceCodeEnd":1022,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/question/renderer.ts#L986-L1022","documentation":"The tmux-based question renderer launched a tmux session for the question UI, waited a settle period, then verified via isLaunchedQuestionSessionAlive that the session still exists. The session vanished immediately, so the renderer treats the launch as failed. This usually means the command inside the tmux session exited instantly (bad command, missing binary, or immediate error output).","triggerScenarios":"Calling the question renderer launch API with renderer strategy 'tmux-session' where execTmux spawns a session whose command exits immediately; e.g. the UI binary path is wrong, tmux kill-session ran concurrently, or the session name collided with an existing dead session.","commonSituations":"Missing or misconfigured UI binary in options.cwd; tmux server killing the session due to a duplicate name; CI environments without a usable tmux server or TTY; the command printing an error and exiting before the settle delay elapses.","solutions":["Verify the command and args passed to the tmux session run successfully standalone (run them in a shell first)","Check `tmux list-sessions` right after launch to see whether the session exists under the expected name and inspect `tmux capture-pane` output for an early error","Ensure the session name is unique per launch to avoid collisions with dead sessions","If the environment has no usable tmux (CI, containers), switch to a different renderer strategy or a test/noop renderer"],"exampleFix":"// before\nconst r = await launchQuestionRenderer({ renderer: 'tmux-session', command: 'omx-ui', options });\n// after\n// verify the command works first\nconst ok = await probeCommand('omx-ui', options.cwd);\nif (!ok) throw new Error('omx-ui not runnable; check PATH/cwd');\nconst r = await launchQuestionRenderer({ renderer: 'tmux-session', command: 'omx-ui', options });","handlingStrategy":"validation","validationCode":"const out = execSync('tmux has-session -t ' + shellQuote(target)); // or probe the UI command exists\nif (!commandExists(uiCommand, options.cwd)) throw new Error('UI command not runnable');","typeGuard":"function isRunnableRendererOpts(o: LaunchOpts): boolean {\n  return typeof o.command === 'string' && o.command.length > 0 && !!o.options?.cwd;\n}","tryCatchPattern":"try { return await launch(opts); } catch (e) { if (/disappeared immediately/.test((e as Error).message)) { await diagnoseTmuxSession(target); throw new Error(`tmux renderer failed: inspect session ${target}`); } throw e; }","preventionTips":["Smoke-test the UI command in the target cwd before wiring it to tmux","Use unique session names per launch","In CI/containers, prefer a noop/test renderer strategy"],"tags":["tmux","question-renderer","process-lifecycle"],"backgroundTag":"subprocess-exited-immediately","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}