You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: PTY exec_command collapses Unix signal termination into bare 128+signal exit code, indistinguishable from voluntary exit 137 #64525
When a command executed through Codex's PTY/unified-exec path is terminated by a Unix signal (e.g., SIGKILL / SIGTERM), the model only receives a numeric exit_code of 128 + signal (e.g., 137 or 143) with no explicit signal metadata. A command killed externally by SIGKILL is therefore indistinguishable from a process that voluntarily ran exit 137.
(Related field discussion with full Core-95 context: #63850)
status.signal() is collapsed immediately into 128 + signal and discarded before the result reaches the tool-output formatter.
codex-rs/core/src/exec.rs:771-795:
The non-PTY exec path checks raw_output.exit_status.signal() (lines 773–779), returning SandboxErr::Signal(signal), while ExecToolCallOutput (line 790) carries only exit_code: i32 without a structured signal: Option<i32> field.
Steps to Reproduce
Run Codex CLI 0.172.0 on Linux (x86_64) and execute two commands in a session:
Command A (voluntary exit): sh -c 'echo VOLUNTARY; exit 137'
Command B (killed by SIGKILL): sh -c 'echo SIGNALED; kill -9 $$'
Compare the tool outputs surfaced to the model.
Expected Behavior
The tool result (and structured exec telemetry) should distinguish signal termination from normal exit — for example by preserving signal: Option<i32> alongside exit_code (or surfacing Process terminated by signal SIGKILL (exit code 137) vs Process exited with code 137).
Actual Behavior
Both commands surface as an undifferentiated 137 exit code. In our controlled 95-task evaluation of Codex CLI 0.172.0 (DeepSeek-V4.1-Flash in Docker), this ambiguity directly causes models to misclassify OOM/external SIGKILL kills as voluntary script exits (E1 signal-attribution tasks).
Environment
Codex CLI version: 0.172.0 (verified on main065e18b)
Activity