Skip to content

Codex startup exit handler misses signal-killed processes (ELECTRON-E4) #1962

@kaizhou-lab

Description

@kaizhou-lab

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:

  1. handleProcessExit never runs — child reference dangles
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions