Passive write_stdin polling can return exit_code=143 without a correlated inner-command receipt
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
Environment
- Linux (Strato2 remote compute host)
- Managed Codex unified exec; reporter version was not captured
- Same-host control:
codex-cli 0.154.0 - Long command wrapped by
KB_COMPACT_KEEP_LOG=1 kb-run-compact ...
Intermittent reproduction
- Start a multi-minute foreground command through
exec_commandwith a shortyield_time_msso it returns an innersession_id. - Keep the owning turn active.
- Poll that same id with empty
write_stdincalls. Do not send Ctrl-C or any termination request. - Intermittently, a poll returns
exit_code=143around three minutes even though the command wrapper emitted no correlated terminal receipt.
Observed on a Julia/Documenter build: the last model-visible heartbeat was [kb-run-compact +161s ...] ExpandTemplates; the retained 13,699-byte log ended at ExpandTemplates. It contained neither [kb-run-compact] exit=... nor the wrapper's retained this wrapper received SIGTERM trap stamp. Child completion/cancellation was therefore unknowable, and launching a duplicate was unsafe.
Controls
- On the same host with Codex 0.154.0, the same yielded-session/empty-poll pattern ran 221 seconds and completed with tool exit 0 plus the wrapper's final
exit=0receipt. This is not a deterministic three-minute ceiling. - Deliberately TERM-signaling the wrapper produced all correlated evidence: tool 143, terminal wrapper
exit=143, and a retainedthis wrapper received SIGTERMstamp. The passive incident had none of those wrapper signals.
Expected behavior
A yielded exec session should have a durable, runtime-owned status/lookup channel. Any terminal tool status must be correlated to the actual inner command, or explicitly labeled as transport/session termination. After a polling route is lost or passively settles, callers need to retrieve the inner command's final exit status or verify/cancel it without cross-session PID guessing.
Related: #11058 and #14824.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the exec_command and write_stdin session lifecycle, then run the yielded-session/empty-poll reproduction and compare it with deliberate SIGTERM behavior. Done means terminal status is correlated to the inner command or explicitly identified as transport termination, with a way to retrieve or verify the command's final status after polling is lost.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- backend-api-design, cli
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100