[Windows][CLI 0.151.0] Codex exits abruptly after a failed tool command returns output
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
What version of Codex CLI is running?
codex-cli 0.151.0
What subscription do you have?
ChatGPT subscription (exact plan tier is not exposed by the CLI)
Which model were you using?
gpt-5.6-sol
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64 (Windows 11 Professional; build 26200.9278)
What terminal emulator and version are you using (if applicable)?
Interactive Windows Command Prompt (cmd.exe), Microsoft Windows 10.0.26200.9278; no multiplexer
Codex doctor report
Sanitized summary (full output contains local filesystem paths and session inventory, so it is not posted publicly):
- Codex version: 0.151.0; update check reports 0.151.0 as current/latest
- Runtime: npm installation on windows-x86_64; installation consistent
- Auth/config/network/WebSocket checks: OK
- State database integrity: OK
- Disk: 272.6 GiB free
- Desktop application: not running
- Security check: Microsoft Defender detected, exclusions unverified; separate Windows-event review found no recent Defender enforcement associated with the exits
- The doctor command was run from a non-interactive diagnostic shell, so its TERM=dumb failure does not describe the interactive cmd.exe sessions that exited
- One unrelated pre-existing rollout scan warning was reported
What issue are you seeing?
Codex CLI 0.151.0 abruptly terminates and returns to the Windows command prompt while processing the result of a shell tool call. There is no final assistant response, visible error, cancellation, or normal shutdown marker.
This reproduced in 5/5 sessions between 15:19 and 15:31 CEST on 2026-08-30. Each session ended at the same boundary: the invoked Python unittest process had completed with exit code 1 and ordinary test failures, but Codex exited before recording or displaying the tool result.
The identical command completes normally when run outside Codex: 63 tests in 1.019 seconds, about 31,108 bytes of output, exit code 1, with two Windows file-lock cleanup errors (PermissionError / WinError 32) and two assertion failures.
The command therefore appears to be the trigger, while the Codex process exit appears to occur while handling its returned failure output.
What steps can reproduce the bug?
- On Windows, start Codex CLI 0.151.0 from an interactive cmd.exe prompt.
- In an existing repository, ask Codex to run a Python unittest suite using a shell tool call. The affected suite runs 63 verbose tests, emits about 31 KiB, and exits 1 with two PermissionError [WinError 32] cleanup errors and two normal assertion failures.
- When the command finishes, Codex immediately exits to cmd.exe instead of showing the tool result.
- Restart Codex and repeat. This occurred in five consecutive sessions.
The repository-specific module names are omitted from the public issue, but the affected session identifiers/transcripts can be supplied privately through Codex feedback.
What is the expected behavior?
Codex should display or summarize the nonzero command result and keep the interactive session running. An ordinary child-process failure, assertion failure, or file-lock error must not terminate the Codex CLI itself.
Additional information
Additional diagnostics:
- No Codex ERROR log entries were found for the five affected process/session runs.
- Windows Event Viewer showed no corresponding Application Error, Windows Error Reporting, Defender block, Kernel-Power event, or memory-exhaustion event.
- At diagnosis time the machine had roughly 38 GiB physical memory, 23 GiB virtual memory, and 272 GiB disk space free.
- Context usage was approximately 29K–53K tokens against a 258K window; full_context_window_limit_reached was false.
- A Codex 0.150.1 process started before the 0.151.0 update remained running, although the exact trigger has not yet been A/B-tested under that older version.
- Five affected session IDs are available and can be shared privately rather than posted publicly.
Suspected area: Windows CLI handling/persistence/rendering of a failed tool result, possibly involving the approximately 31 KiB output payload. The exact internal defect is not proven.
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
Reproduce the failure on Windows 11 in interactive cmd.exe with Codex CLI 0.151.0, using a shell command that emits about 31 KiB and exits nonzero. Inspect the Windows CLI handling, persistence, and rendering path for failed tool results; done means the tool result is displayed or summarized and the interactive session remains running.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, rust
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100