Codex App on Windows sometimes drops completed command output and can hang after redirected output is written
What version of the Codex App are you using (From “About Codex” dialog)?
Observed from the running Windows process because the agent cannot open the About dialog directly:
- Codex App package path:
C:\Program Files\WindowsApps\OpenAI.Codex_26.429.3425.0_x64__2p2nqsd0c76g0\app\Codex.exe - Codex App product version:
26.429.30905 - Codex App file version:
2345 - Bundled
codex.exeproduct/file version:0.128.0-alpha.1
What subscription do you have?
ChatGPT/Codex paid plan. The exact subscription string is not programmatically visible to the agent from this Windows session.
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
On Windows, shell commands run through the Codex App tool can complete but return empty stdout/stderr to the agent, and a PowerShell wrapper that redirects output can hang until the tool timeout even after the underlying command has already written the complete result.
This was observed while running an Elixir coverage gate from PowerShell in Codex App. The command itself generated the expected coverage report and exited, but the Codex App tool did not reliably surface the command output back to the conversation.
Observed cases:
- Direct failing coverage run:
mise exec -- mix test --cover
The Codex tool returned Exit code: 1 after about 59 seconds but with an empty output body. The useful coverage table was not visible in the tool result.
- Retried with explicit PowerShell log capture:
$log = Join-Path $env:TEMP ('symphony-cover-' + [guid]::NewGuid().ToString() + '.log')
mise exec -- mix test --cover *> $log
$exit = $LASTEXITCODE
Write-Output "EXIT=$exit"
Write-Output "LOG=$log"
Get-Content -Path $log -Tail 120
exit $exit
The Codex tool timed out after about 304 seconds. However, inspecting the generated temp log showed the coverage command had already completed and written its useful result after about 65 seconds:
Finished in 64.8 seconds (3.8s async, 61.0s sync)
547 tests, 0 failures, 7 skipped (9 excluded)
Coverage test failed, threshold not met:
Coverage: 94.51%
Threshold: 95.00%
- Direct successful coverage run after adding tests:
mise exec -- mix test --cover
The Codex tool returned Exit code: 0 after about 58 seconds, again with an empty output body.
The issue is not that full coverage is slow; the test suite duration is expected. The problem is that Codex App sometimes fails to deliver stdout/stderr from a completed Windows command, and in the redirected wrapper case the tool did not return promptly after the useful output had already been written.
What steps can reproduce the bug?
A public reproduction candidate is the Windows-native Symphony repository:
git clone https://github.com/albert-zen/symphony-windows-native.git
cd symphony-windows-native\elixir
mise trust
mise install
mise exec -- mix deps.get
mise exec -- mix test --cover
In the affected Codex App session on Windows, the command completed but the Codex tool response body was empty. A wrapper that redirects output to a temp log and then tails the log may hang until the tool timeout even though the log already contains the completed coverage result.
The behavior was observed from a PowerShell shell in Codex App with:
- Windows:
Microsoft Windows NT 10.0.26200.0 x64 - Codex App package:
OpenAI.Codex_26.429.3425.0_x64__2p2nqsd0c76g0 - Bundled CLI:
0.128.0-alpha.1 - Command launched via the Codex shell tool from workspace
D:\desktop\symphony\elixir
No secrets are required to reproduce this particular output-capture behavior.
What is the expected behavior?
When a Windows command completes, Codex App should reliably return the captured stdout/stderr to the conversation, including for non-zero exits.
For a PowerShell wrapper that redirects output and then prints a tail, Codex App should return promptly once the wrapper exits and should not continue waiting until the tool timeout after the underlying command has already completed and the log has already been written.
At minimum, the tool result should include enough output to diagnose the failure without rerunning the same broad gate.
Additional information
This caused unnecessary repeated full coverage runs during a coding session because the first failing run already had enough information, but Codex App did not surface it. The local workaround is to avoid rerunning the broad gate and inspect generated files/logs directly, but the app-level behavior makes Windows debugging and validation loops more expensive than needed.
I searched for nearby existing issues with terms like Windows PowerShell stdout mix test cover Codex App, tool output empty Windows command timeout, and mise exec PowerShell output, and did not find an obvious duplicate.
7 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
We're seeing what looks like the same bug on the
codex execCLI path (not the desktop App), which suggests the fault is in shared Windows shell-execution code rather than App-specific glue. Posting a minimal, fully non-interactive repro in case it helps narrow it down.Environment
codex exec --json --dangerously-bypass-approvals-and-sandbox -m <model> -, driven programmatically from a parent process that writes the prompt to stdin and then closes it (so this is not #20919 — stdin gets a clean EOF)Symptom
A short, read-only shell command that completes in well under a second when run by hand is emitted as
item.startedwithstatus:"in_progress"/exit_code:nulland then never receives anitem.completed. Codex stops streaming entirely — no stderr, notools::routererror, only a few hundred bytes of stdout. The outer process just sits there (0% CPU) until our own watchdog kills it at a stdout-silence timeout.This is not the large-output back-pressure deadlock from #18983 (that one is fixed and we're well past it): here total captured stdout is ~700 bytes and there is no nonzero exit involved at all.
Strong correlation: it happens when codex launches multiple commands concurrently
Across every captured instance, the hung sessions had 2–10 commands
in_progressat once. The cleanest example is two parallel read-only VCS metadata commands (Perforcep4 describe) started in the same turn:Deterministic on an affected input
We retried the same prompt 4× and got an identical hang every time — each run ~110s (process startup + our 90s stdout-silence watchdog), tiny stdout, same two commands stuck
in_progress. So for some inputs it reproduces every time, not just intermittently.This matches the issue description ("a completed Windows command's output isn't surfaced; the tool hangs until timeout"), but on the pure
execCLI path and with a much simpler trigger than a long coverage run — just fast read-only commands issued in parallel. If the completion/output is being dropped on a per-PTY or per-channel basis when several commands run concurrently, the "multiple in-flight commands" angle might be where to look.Happy to share full (sanitized)
--jsontranscripts if useful.I can reproduce a much smaller related failure on Windows Codex Desktop.
Observed on 2026-07-14.
Minimal A/B reproduction
Through Codex App
Execution surface: Git Bash MCP
Command:
Configured timeout: 5000 ms
Observed result:
Outside Codex
From a normal PowerShell terminal, with Codex not acting as the parent:
This returned the expected content immediately.
Reproducibility
The problem persisted after:
C:\tmp;rgand Git Bash MCP;Additional observations:
Get-Contentcall with a 20-second timeout remained silent for more than 30 seconds.rgcall with a 5-second timeout remained silent for more than 10 seconds.Expected behavior
Either:
The Codex App should not remain indefinitely in a running state after the tool deadline.
Scope of the evidence
The fast out-of-band PowerShell control rules out the file contents, ordinary PowerShell behavior, and a general inability of Windows to read the file.
This does not yet identify whether the failure is in command orchestration, sandbox/broker execution, process cleanup, stdout/stderr delivery, or an endpoint filter applied specifically to Codex-spawned processes. PID and lifecycle-stage telemetry were not available.
Codex App and Windows build versions were not queried through the affected execution surface because further local process execution had been quarantined.
+1
Windows 11 app
Version 26.707.72221
Follow-up to my 2026-07-14 minimal A/B report, with a smaller and more discriminating reproduction observed on 2026-07-15.
Environment
26.707.3563.0codex-command-runner-0.144.0-alpha.4.execodex-command-runner.exe: SHA25601A582479BF7D31E3EF3F2CBA5BB22DBA5A1D5542CE850B44BBE0217BB4A327Ecodex-windows-sandbox-setup.exe: SHA2565FBFC00734EBB13DC6E0D0323ABE130AD75A979F59A3B84299BDD48A67844FB2This rules out a missing helper or a stale/incomplete local helper copy in this instance.
New minimal reproduction
1. Single command through Codex Desktop
The agent invoked only:
Conditions:
login: falseC:\tmpObserved:
2. Side-effect canary distinguishes this from output-only loss
The agent attempted an
apply_patchthat would only add a uniquely named disposable file containing one line.Observed:
Test-PathreturnedEXISTS=falseTherefore this occurrence is not only "the command completed but stdout/stderr was dropped": the requested side effect was never applied.
3. Direct bundled CLI also hangs
From normal out-of-band PowerShell:
Observed:
Ctrl+CThis suggests the current failure is not confined to Desktop conversation output rendering.
Lifecycle observations
%USERPROFILE%\.codex\.sandbox-bin.%USERPROFILE%\.codex\.sandbox\setup_error.jsondoes not exist.%USERPROFILE%\.codex\.sandbox\sandbox.logdoes not exist.The absence of both the setup error artifact and sandbox log makes it look as though the hang occurs before normal Windows sandbox lifecycle logging, or on a path that does not emit those artifacts.
Impact / request
In this state, all normal local work is blocked: read-only shell commands,
apply_patch, and the direct bundled sandbox command. Retrying, changing cwd/shell, opening a fresh task, fully restarting Desktop, escalation, stopping the runner, and switching to unelevated sandbox have not recovered it.Please add a hard watchdog and structured lifecycle-stage error around helper/runner startup so a five-second tool deadline cannot remain indefinitely
in_progress. Logging before sandbox setup/runner launch would also make it possible to distinguish command orchestration, broker launch, ACL setup, endpoint filtering, and completion delivery failures without repeated blind retries.I can reproduce a broader version of this in the Codex Desktop app on native Windows.
Minimal repro in a fresh task, local workspace:
Expected: immediate stdout and exit.
Actual: the
shell_commandtool produces no output and remains running; I terminated it after ~10 seconds.Additional observations:
cmd.exe, in multiple working directories, including with and without sandbox escalation.No app terminal session is attached to this thread yet.nodeRepl.write("node-probe-ok")call, while in-process Codex Desktop dependency discovery still worked.This suggests the command/kernel result-return or terminal-session path may be failing, not the command itself. Happy to provide Codex Desktop version, Windows build, or any diagnostics that would help.
Additional Windows data point with a workaround that resolved the problem for my setup.
Environment:
26.707.31428Observed behavior:
Get-Date -Format odid not return normally through the shell tool. Its output appeared when the 45-second timeout fired.cmd.exe /d /c "echo shell-ok"showed the same behavior with a 10-second timeout, so this was not specific to a PowerShell cmdlet.login=falsereturnedGet-Datein approximately three seconds.I then set the following in
%USERPROFILE%\.codex\config.toml:allow_login_shell = falseSubsequent shell commands returned normally in the same Codex session. I did not restart Codex.
For my use case, this resolved the practical problem. My Codex commands do not depend on profile-defined aliases, functions, or environment initialization.
I have only noticed the failure while the machine is under heavy load. That is an observed correlation, not proof that load is the root cause.
This does not establish
allow_login_shell = falseas a universal fix, but it appears to be a reliable workaround when profile initialization is unnecessary.