Problem
In CodexConnection.ts, the exit handler during startup has condition code !== 0 && code !== null which fails when the process is killed by signal (code=null, signal=SIGTERM/SIGKILL). This causes:
handleProcessExit never runs — child reference dangles
- The 5-second timeout fires with a generic unhelpful error: "Codex process failed to start or was killed during startup"
Sentry issue: ELECTRON-E4 — 9 events from multiple users (CA, CN, SG), last seen 5 hours ago.
Root Cause
null !== null evaluates to false, so code !== 0 && code !== null is false when code === null (signal kill). The exit handler skips entirely.
Fix
Remove the condition — any exit during the startup window is a failure. The error message now includes both code and signal for better diagnostics.
Problem
In
CodexConnection.ts, the exit handler during startup has conditioncode !== 0 && code !== nullwhich fails when the process is killed by signal (code=null, signal=SIGTERM/SIGKILL). This causes:handleProcessExitnever runs — child reference danglesSentry issue: ELECTRON-E4 — 9 events from multiple users (CA, CN, SG), last seen 5 hours ago.
Root Cause
null !== nullevaluates tofalse, socode !== 0 && code !== nullisfalsewhencode === null(signal kill). The exit handler skips entirely.Fix
Remove the condition — any exit during the startup window is a failure. The error message now includes both code and signal for better diagnostics.