Repository navigation
[Idea] Surface Unix signal-termination info on shell tool results to distinguish SIGKILL/SIGTERM from voluntary exit 137/143 (codex-cli 0.172.0) #63850
zsicheng0214
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Motivation & Observed Impact on Agent Outcomes
While running our containerized reliability benchmark (TraceTrial-Bench +
TraceTrial-Bench-Pro, paper arXiv:2610.32285) on@openai/codex@0.172.0, Codex performed very well across most single-container reliability checks (100% onV2-table-audit-002,V4-package-target-001,O4-flashcheck-control-001,E1-sigtrap-reaper-003,C1-truncation-tail-offset-004,G4-secret-rotation-spill-004,T2,T5,G1).However, we hit a clean, reproducible signal-fidelity gap that directly degrades agent accuracy on ops/audit tasks (
E1-pumpstop-exit-002): Codex cannot distinguish a process killed by a signal (e.g.,SIGKILL/ OOM-kill) from a process that voluntarily exited with128 + signum(e.g.,exit 137).Verbatim Reproduction on
codex-cli 0.172.0In
E1-pumpstop-exit-002, eight stations print the exact same JSON line, and the agent must classify each station by exit status and termination cause (normal_exitvssignal):PS-14executesexit 137(normal exit).PS-15is terminated bySIGKILL(signal 9, POSIX status137).In
codex-cli 0.172.0, both shell tool results arrive with identical model-facing metadata and output:Because
codexwraps the command in/usr/bin/bash -c '...'and only surfaces the numeric exit status (137) without inspecting or forwarding signal termination, the model has no observable basis to distinguishPS-14fromPS-15(and honestly leaves bothended_byfields undetermined, dropping task accuracy).In real engineering workflows, the same ambiguity shows up whenever a build/test runner is OOM-killed (
SIGKILL→137) or externally stopped (SIGTERM→143) versus returning a high application exit code.Proposal
std::os::unix::process::ExitStatusExt::signal()when exec'd directly, or capturing signal death of the child process group), surface the signal name alongside the POSIX numeric exit code in the shell tool output:termination_signal: Option<String>(e.g."SIGKILL","SIGTERM") in the structured exec event JSON so downstream SDK consumers, hooks, and benchmark harnesses can also observe it cleanly.Benchmark & Reproducibility Links
Happy to share the full
codex-cli 0.172.0trace archive or re-run paired benchmarks if this is picked up!All reactions