Repository navigation
Description
What version of Codex CLI is running?
codex-cli 0.148.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.6-sol
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What terminal emulator and version are you using (if applicable)?
PowerShell7.6.5
Codex doctor report
Running `codex doctor --json` through exec_command also hangs for more than 30 seconds without returning stdout, stderr, or an exit code. It must be terminated manually.What issue are you seeing?
Local shell commands invoked through Codex's exec_command runner hang indefinitely, even when the command is trivial.
For example, Get-Content and Write-Output remain in the "Script running" state for more than 30 seconds without returning stdout, stderr, or an exit code. The same
behavior occurs in both pipe and PTY modes.
The problem is not limited to PowerShell. Running an equivalent command through cmd.exe also hangs without producing output.
On the same machine, launching PowerShell directly outside Codex completes in approximately 0.6 seconds. This succeeds both with and without loading the PowerShell
profile.
As a result, Codex cannot reliably inspect files, run Git commands, execute tests, or perform other local development tasks.
The evidence suggests that the failure occurs above the PowerShell layer, possibly in the Codex Windows child-process launcher, sandbox helper, unified exec session, or
process-result handoff path. This is only a working hypothesis; I have not confirmed the exact root cause.
What steps can reproduce the bug?
-
Open a local workspace in the Codex Windows app.
-
Ask Codex to run the following command:
Write-Output 'CODEX_EXEC_PROBE'
-
Wait at least 30 seconds.
Observed result:
- The command remains in the "Script running" state.
- No stdout, stderr, or exit code is returned.
- The execution must be terminated manually.
-
Repeat the test with a basic file read:
Get-Content -LiteralPath '.\AGENTS.md' -Raw
-
Repeat it using cmd.exe instead of PowerShell:
cmd.exe /d /c "echo CODEX_CMD_PROBE"
-
Repeat the tests in both pipe and PTY modes.
All Codex-managed executions hang in the same way.
- Outside Codex, launch PowerShell directly with and without the profile.
Both direct executions complete successfully in approximately 0.6 seconds.
What is the expected behavior?
Trivial local commands should start and finish within a few seconds. Codex should return stdout, stderr, and the process exit code.
If the child process cannot be launched or its result cannot be collected, exec_command should fail promptly with an actionable error instead of remaining in the "Script
running" state indefinitely.
Additional information
Impact: Blocker. Local file inspection, Git operations, builds, tests, and other command-based development workflows are unavailable.
The following possible causes appear unlikely:
- PowerShell profile: direct execution succeeds both with and without the profile.
- PowerShell-specific behavior: cmd.exe reproduces the same hang.
- PTY-specific behavior: both pipe and PTY modes are affected.
- Large-output backpressure: the issue reproduces with a single short output line.
Fresh thread: [Reproduces / Does not reproduce / Not tested]
After restarting Codex: [Reproduces / Does not reproduce / Not tested]
After rebooting Windows: [Reproduces / Does not reproduce / Not tested]
Codex unsandboxed execution: [Reproduces / Works / Not tested]
Feedback ID: [Paste the ID returned by /feedback, if available]
Possibly related:
- Windows app sandbox hangs for every child process; packaged codex.exe returns Access is denied #32184
- Windows Codex App: all local child-process tools hang with empty output after update and reboot #32645
- Windows desktop thread can stop returning local shell command results; even small local file reads hang until manually aborted #18538
Activity
[-][Windows Codex App] exec_command hangs on trivial PowerShell and cmd.exe commands in both pipe and PTY modes[/-][+][Windows Codex CLI] exec_command hangs on trivial PowerShell and cmd.exe commands in both pipe and PTY modes[/+]github-actions commentedon Aug 20, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Ra13s commentedon Aug 30, 2026
Adding an independent Windows repro plus a possible workaround.
Environment:
0.151.0-alpha.7.20.145.0approval_policy = "never"sandbox_mode = "danger-full-access"[windows] sandbox = "unelevated"Observed behavior:
cmd.exe /d /c echo OKintermittently failed to return within 30 seconds.tokens_used = 3,867,434,503, and resume logs containCustom tool call output is missing for call id: ...for the interrupted call. The large/corrupt thread may be an amplifier, but it does not explain why trivial commands also hung in a fresh thread.Workaround attempted:
The config was recognized as
unified_exec stable true. A fresh bundled-CLI test then rancmd.exe /c echo CODEX_UNIFIED_EXEC_OKsuccessfully in 0 ms, and the Codex process exited cleanly. I do not yet know whether this workaround is durable, but it switches Windows away from the default non-unified exec path and is the first clean result after the hangs.The conversation-scoped persistence also looks related to #34842.
bzy5354-collab commentedon Aug 31, 2026
Additional reproduction from Codex Desktop on 2026-08-31.
Environment:
Measurements from the same session:
CPU usage was low during the delay. Lowering model reasoning effort or selecting a faster response mode did not change it.
This appears to distinguish filesystem or shell execution time from Codex result delivery time: the child process and local filesystem are fast, while the delay seems to occur in the Windows unified-exec result collection or handoff path.
Fresh task: reproduces
After restarting Codex: not conclusively tested in this measurement run
After rebooting Windows: not tested
Unelevated sandbox: not tested; elevated is the current reproducing configuration
No private repository paths or source content are included in this report. This may be worth correlating with the unified-exec changes released around Codex CLI 0.150.0.
guszzpp commentedon Sep 18, 2026
I can reproduce what appears to be the same blocker on Windows 11.
Environment:
Observed behavior:
I also see a closely related failure in the Codex Desktop app on the same machine: the shell UI can visibly show successful output (for example,
Write-Output OKorGet-Location), while the model says it received no output. In another attempt, the UI showed a one-line path, but the model received only:Output exceeded the available model context and was truncated.This persists across fresh Codex sessions. The same PowerShell commands work when run directly outside Codex.
Impact: blocker — Codex cannot inspect the repository, run Git commands, read files, or execute tests reliably.
joejoejoe12533-coder commentedon Oct 2, 2026
Additional reproduction in the Codex desktop app on native Windows, observed on 2026-10-02/03 (Asia/Shanghai). Posting at the affected user's explicit request. The symptoms overlap with this issue; a shared root cause has not been established.
Confirmed observations
exec_commandrunningGet-Locationwithlogin: falsedid not return output after more than 30 seconds.C:\Windows\System32\cmd.exeinvocation withcmd: "echo local-exec-ok"andlogin: falsealso remained pending without output for more than 30 seconds. No PTY comparison was performed in this reproduction.node_replrunning onlynodeRepl.write('local-runtime-ok');timed out after approximately 10 seconds withjs execution timed out; kernel reset, rerun your request.Write-Output 'terminal-ok'and a basicGet-Itemfile-metadata check in Windows PowerShell outside Codex. Both succeeded. This was confirmed from the user's screenshot, without reading the file contents.Recovery observed
After the user reported rebooting the computer, command execution and file-metadata reads returned again (the first successful execution reported approximately 2.6 seconds of command wall time). Subsequent file edits, TypeScript checks and local integration tests also completed. The JavaScript runtime responded again as well.
This is a single observed recovery after reboot, not proof of the cause or a reliable permanent fix. Unsandboxed execution was not compared while the hang was present. Exact desktop-app/bundled-CLI and Windows build versions were not collected; the versions in the original issue should not be assumed to apply to this reproduction.
Expected behavior: trivial commands should return promptly, or the execution/transport layer should return an actionable error and recover without requiring a computer reboot.
No project paths, source code, credentials, screenshots or private session transcripts are attached.
dollarm865 commentedon Oct 8, 2026
I am seeing a similar symptom in the Windows desktop app. I have not confirmed that it has the same root cause as this issue.
Submitted feedback ID:
01a0f4f7-2310-7f41-93bd-d0af3bd6492f
Observed on 2026-10-08, timezone UTC+08:00.
Nine existing tool sessions could not return usable execution results:
84929, 42426, 96351, 8753, 58535, 3701, 69227, 36616, 64216.
These are tool session_id values, not Windows PIDs. They must not be interpreted as nine confirmed processes.
The calls concern six private validation tests, one additional wrapper invocation, and two preparation-file reads.
Each session was polled twice using write_stdin with empty input: 18 polls in total. Every poll returned the same session_id, empty output, and no exit_code. No explicit error code or rejection reason was returned.
It remains unknown whether the underlying test processes started or exited. I have not established that all local commands are affected.
No tests were replayed and no processes were terminated during this result-recovery attempt. Existing records have been retained.
The configured PowerShell runtime is 7.6.5 x64. The exact desktop app version has not yet been verified.
Could maintainers advise whether there is a supported way to recover the output/completion state of these existing sessions, or inspect their existing execution associations?
If recovery requires restarting an app/executor or terminating a session, please explain the effect on already-started child processes and retained records. Closing the app should not be assumed to prove that all child processes have exited.E