{"record":{"id":"95414b670ce93799","repo":"Yeachan-Heo/oh-my-codex","slug":"job-not-input-accepting-no-active-exec-session","errorCode":"job_not_input_accepting:no_active_exec_session","errorMessage":"job_not_input_accepting:no_active_exec_session","messagePattern":"job_not_input_accepting:no_active_exec_session","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/exec/followup.ts","lineNumber":227,"sourceCode":"        throw new Error(\"exec_followup_queue_lock_timeout\");\n      }\n      await sleep(QUEUE_LOCK_RETRY_MS);\n    }\n  }\n}\n\nexport async function injectExecFollowup(\n  options: InjectExecFollowupOptions,\n): Promise<InjectExecFollowupResult> {\n  const sessionId = normalizeSessionId(options.sessionId);\n  const prompt = normalizePrompt(options.prompt);\n  const actor = normalizeActor(options.actor);\n  const nowIso = options.nowIso ?? new Date().toISOString();\n\n  const active = await readUsableSessionState(options.cwd);\n  const activeUsable = active && isSessionStateUsable(active, options.cwd);\n  if (!activeUsable && !options.allowInactiveSession) {\n    throw new Error(\"job_not_input_accepting:no_active_exec_session\");\n  }\n  if (\n    activeUsable\n    && active.session_id !== sessionId\n    && active.native_session_id !== sessionId\n    && !options.allowInactiveSession\n  ) {\n    throw new Error(`job_not_input_accepting:session_mismatch:${active.session_id}`);\n  }\n\n  const canonicalSessionId = activeUsable && (active.session_id === sessionId || active.native_session_id === sessionId)\n    ? active.session_id\n    : sessionId;\n  const queuePath = sessionQueuePath(options.cwd, canonicalSessionId);\n  const queued: ExecFollowupRecord = {\n    id: randomUUID(),\n    session_id: canonicalSessionId,\n    actor,","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/exec/followup.ts#L209-L245","documentation":"Thrown by injectExecFollowup when no usable active exec session state exists in the given cwd. The library refuses to queue a followup for a directory that has no running (usable) exec session, unless explicitly overridden, because there would be no consumer to deliver the prompt to.","triggerScenarios":"Calling injectExecFollowup in a directory where the exec session ended, crashed, or never started; session state file is missing, corrupted, or fails isSessionStateUsable (e.g. stale/pid-dead session); running the inject CLI from the wrong working directory. Only options.allowInactiveSession suppresses it.","commonSituations":"Injecting after the exec session already exited; CI job runs inject in a fresh checkout where no session was created; wrong cwd (repo root vs subdirectory) so session state isn't found; state file truncated by a concurrent writer; session process killed leaving dead-pid state.","solutions":["Start (or restart) the exec session in that cwd and retry the injection.","Verify you are running the command from the same directory the session was started in (check for the session state file).","If you intentionally want to queue for a not-currently-active session, pass allowInactiveSession: true (CLI equivalent flag) after confirming the queue will be consumed later.","Check that the session state file exists and is intact; if corrupted, restart the session to regenerate it."],"exampleFix":"// before\nawait injectExecFollowup(cwd, sessionId, { prompt });\n\n// after\nconst active = await readUsableSessionState(cwd);\nif (!active) throw new Error(`No active exec session in ${cwd}; start one before injecting`);\nawait injectExecFollowup(cwd, sessionId, { prompt });\n\n// or explicitly allow queueing for an inactive session:\nawait injectExecFollowup(cwd, sessionId, { prompt, allowInactiveSession: true });","handlingStrategy":"validation","validationCode":"const active = await readUsableSessionState(cwd);\nif (!active) throw new Error(`no usable exec session in ${cwd}; start one first`);\nawait injectExecFollowup(cwd, active.session_id, { prompt });","typeGuard":"function hasActiveSession(active: Awaited<ReturnType<typeof readUsableSessionState>>): boolean {\n  return active !== null && active !== undefined && !!active.session_id;\n}","tryCatchPattern":"try { await injectExecFollowup(cwd, sessionId, { prompt }); }\ncatch (e) {\n  if (e instanceof Error && e.message.includes('no_active_exec_session')) { await startExecSession(cwd); /* then retry */ }\n  else throw e;\n}","preventionTips":["Always inject from the same cwd the session was started in.","Re-resolve session state immediately before injecting.","Pass allowInactiveSession only when you own the delivery lifecycle."],"tags":["session-state","exec-followup","validation","lifecycle"],"backgroundTag":"no-active-session","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}