You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Codex for Windows: Local command runner hangs indefinitely. Even cmd /c echo CODEX_TEST_1 returns a running session ID but never produces output or an exit code. CMD and PowerShell work normally outside Codex. Reinstallation, sandbox service restart, #53605
What version of the Codex App are you using (From “About Codex” dialog)?
Codex for Windows: Local command runner hangs indefinitely. Even cmd /c echo CODEX_TEST_1 returns a running session ID but never produces output or an exit code. CMD and PowerShell work normally outside Codex. Reinstallation, sandbox service restart, and resetting config.toml did not resolve the issue. All commands remain pending.
What subscription do you have?
Codex for Windows: Local command runner hangs indefinitely. Even cmd /c echo CODEX_TEST_1 returns a running session ID but never produces output or an exit code. CMD and PowerShell work normally outside Codex. Reinstallation, sandbox service restart, and resetting config.toml did not resolve the issue. All commands remain pending.
What platform is your computer?
Codex for Windows: Local command runner hangs indefinitely. Even cmd /c echo CODEX_TEST_1 returns a running session ID but never produces output or an exit code. CMD and PowerShell work normally outside Codex. Reinstallation, sandbox service restart, and resetting config.toml did not resolve the issue. All commands remain pending.
What issue are you seeing?
Codex for Windows: Local command runner hangs indefinitely. Even cmd /c echo CODEX_TEST_1 returns a running session ID but never produces output or an exit code. CMD and PowerShell work normally outside Codex. Reinstallation, sandbox service restart, and resetting config.toml did not resolve the issue. All commands remain pending.
What steps can reproduce the bug?
Codex for Windows: Local command runner hangs indefinitely. Even cmd /c echo CODEX_TEST_1 returns a running session ID but never produces output or an exit code. CMD and PowerShell work normally outside Codex. Reinstallation, sandbox service restart, and resetting config.toml did not resolve the issue. All commands remain pending.
I had a similar issue that seemed to be a relationship to the prefer_mxc = true. It appears to be a compatibility thing with a recent Windows update. The pathing to the mxc was broken after a recent update this morning. After reinstalling there was no change. I had to disable the mxc options. Then it worked. My issue was in 54084
Because CLI -c overrides the config file, setting features.prefer_mxc = false or [windows] sandbox = "elevated" in config.toml has no effect on the desktop app. The sandbox log confirms it: Windows sandbox selection: mxc 60 times in one day, elevated 0 times.
2. When the shell resolves to a Store/MSIX pwsh.exe, the sandbox fails with a different and very misleading error.
Store PowerShell installs %LOCALAPPDATA%\Microsoft\WindowsApps\pwsh.exe as a 0-byte App Execution Alias. The sandbox account (CodexSandboxOffline) cannot resolve it:
windows sandbox failed: runner failed during SpawnChild:
CreateProcessAsUserW failed: 2 (系统找不到指定的文件。)
| cmd=pwsh -NoProfile -Command "Write-Output 'hello'"
Same sandbox, same moment, same command: cmd.exe and powershell.exe (real PE files in System32) both succeed. Installing PowerShell via MSI into C:\Program Files\PowerShell\7\ resolves it. Note that winget install Microsoft.PowerShell installs an MSIX bundle, so it does not fix this — an MSI install is required.
%ProgramFiles%\WindowsApps is owned by TrustedInstaller and grants read/execute only to NT AUTHORITY\RESTRICTED, SYSTEM, LOCAL SERVICE, NETWORK SERVICE and Administrators — the sandbox account is not in that list.
Backend matrix on this machine (via CLI with -c features.prefer_mxc=false):
backend
result
elevated
OK (exit 0)
unelevated
OK (exit 0)
mxc
hangs, no output, never returns
The MXC helper (codex.exe --__codex-windows-mxc) starts, spawns no children, writes nothing to stderr, and never exits. Killing it just leaves it to be respawned.
So the regression is specific to the MXC path. elevated and unelevated both work; the only thing blocking is that the desktop app forces MXC and offers no way to opt out.
Requested: either honor features.prefer_mxc = false / [windows] sandbox for the desktop app, or stop passing -c features.prefer_mxc=true unconditionally, so users can fall back to the working backends while MXC is being fixed.
Additional bounded Windows MXC reproduction (2026-11-20), to help isolate the PowerShell-only startup variant. This is an independently observed symptom; a shared root cause with the original report is not established.
Environment: Windows 11; pinned codex-cli 0.167.0; PowerShell 7.6.9. Invoked the CLI's sandbox subcommand under forced windows.sandbox="mxc", the managed :workspace permission profile, sandbox_workspace_write.network_access=false, and disabled hooks/apps. Executions were non-model, in disposable local workspace, under the same sanitized environment and a 20-second deadline per command.
pwsh 7.6.9 with -NoLogo -NoProfile -NonInteractive: TIMEOUT at 20.234 s, no initial script-start marker, empty stdout and stderr. The intended filesystem and rg checks were not reached, so neither their results nor provider initialization is established.
The bounded launcher attempted cleanup on timeout; termination/wait returned without exception, and subsequent nonprivileged process inspection did not show surviving launcher PIDs or visible canary children. Absence of all service-internal descendants was not independently attested. Testing stopped on the first failed PowerShell probe: no retries, no alternative backend test, no model invocation, no change to the sandbox policy, and no unsandboxed fallback.
Some earlier different executions produced InitializeDefaultDrives warnings, but none occurred in this latest empty-output timeout. I cannot attribute this timeout to that PowerShell warning, mapped drives, TMP behavior, or any specific MXC process-initialization stage.
Request: Is there a maintainer-supported resolution for this PowerShell-only MXC startup stall in CLI 0.167.0, or a documented equally restricted backend/configuration that retains workspace and network denial? What is the minimum one-pass, redacted diagnostic that distinguishes whether the PowerShell child spawned versus the MXC launcher waited, without requiring elevation, ACL changes, or repeated exploratory probes? A related warning-only report is #58174, but that should not be conflated with this no-output hang.
No private repository details, local paths, usernames, account identifiers, source code, credentials, or raw logs are included in this comment.
Activity
github-actions commentedon Oct 13, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
TheSplean commentedon Oct 14, 2026
I had a similar issue that seemed to be a relationship to the prefer_mxc = true. It appears to be a compatibility thing with a recent Windows update. The pathing to the mxc was broken after a recent update this morning. After reinstalling there was no change. I had to disable the mxc options. Then it worked. My issue was in 54084
nehcruhtra commentedon Oct 27, 2026
Confirming this on Codex Desktop 26.1021.3705.0 / CLI 0.164.0-alpha.11.1, Windows 11 25H2 (26200.9711).
Two findings that I did not see in this thread or in #54084 (closed as duplicate):
1. The desktop app hardcodes
-c features.prefer_mxc=true, soconfig.tomlis ignored.The app-server command line on every launch:
Because CLI
-coverrides the config file, settingfeatures.prefer_mxc = falseor[windows] sandbox = "elevated"inconfig.tomlhas no effect on the desktop app. The sandbox log confirms it:Windows sandbox selection: mxc60 times in one day,elevated0 times.2. When the shell resolves to a Store/MSIX
pwsh.exe, the sandbox fails with a different and very misleading error.Store PowerShell installs
%LOCALAPPDATA%\Microsoft\WindowsApps\pwsh.exeas a 0-byte App Execution Alias. The sandbox account (CodexSandboxOffline) cannot resolve it:Same sandbox, same moment, same command:
cmd.exeandpowershell.exe(real PE files inSystem32) both succeed. Installing PowerShell via MSI intoC:\Program Files\PowerShell\7\resolves it. Note thatwinget install Microsoft.PowerShellinstalls an MSIX bundle, so it does not fix this — an MSI install is required.%ProgramFiles%\WindowsAppsis owned byTrustedInstallerand grants read/execute only toNT AUTHORITY\RESTRICTED,SYSTEM,LOCAL SERVICE,NETWORK SERVICEandAdministrators— the sandbox account is not in that list.Backend matrix on this machine (via CLI with
-c features.prefer_mxc=false):The MXC helper (
codex.exe --__codex-windows-mxc) starts, spawns no children, writes nothing to stderr, and never exits. Killing it just leaves it to be respawned.So the regression is specific to the MXC path.
elevatedandunelevatedboth work; the only thing blocking is that the desktop app forces MXC and offers no way to opt out.Requested: either honor
features.prefer_mxc = false/[windows] sandboxfor the desktop app, or stop passing-c features.prefer_mxc=trueunconditionally, so users can fall back to the working backends while MXC is being fixed.bagomeatstudios commentedon Nov 20, 2026
Additional bounded Windows MXC reproduction (2026-11-20), to help isolate the PowerShell-only startup variant. This is an independently observed symptom; a shared root cause with the original report is not established.
Environment: Windows 11; pinned
codex-cli 0.167.0; PowerShell 7.6.9. Invoked the CLI'ssandboxsubcommand under forcedwindows.sandbox="mxc", the managed:workspacepermission profile,sandbox_workspace_write.network_access=false, and disabled hooks/apps. Executions were non-model, in disposable local workspace, under the same sanitized environment and a 20-second deadline per command.One deliberately non-retried sequence:
cmd.exe /d /cmarker: PASS, exit 0, 0.312 s, expected marker, empty stderr.pwsh7.6.9 with-NoLogo -NoProfile -NonInteractive: TIMEOUT at 20.234 s, no initial script-start marker, empty stdout and stderr. The intended filesystem andrgchecks were not reached, so neither their results nor provider initialization is established.The bounded launcher attempted cleanup on timeout; termination/wait returned without exception, and subsequent nonprivileged process inspection did not show surviving launcher PIDs or visible canary children. Absence of all service-internal descendants was not independently attested. Testing stopped on the first failed PowerShell probe: no retries, no alternative backend test, no model invocation, no change to the sandbox policy, and no unsandboxed fallback.
Some earlier different executions produced
InitializeDefaultDriveswarnings, but none occurred in this latest empty-output timeout. I cannot attribute this timeout to that PowerShell warning, mapped drives, TMP behavior, or any specific MXC process-initialization stage.Request: Is there a maintainer-supported resolution for this PowerShell-only MXC startup stall in CLI 0.167.0, or a documented equally restricted backend/configuration that retains workspace and network denial? What is the minimum one-pass, redacted diagnostic that distinguishes whether the PowerShell child spawned versus the MXC launcher waited, without requiring elevation, ACL changes, or repeated exploratory probes? A related warning-only report is #58174, but that should not be conflated with this no-output hang.
No private repository details, local paths, usernames, account identifiers, source code, credentials, or raw logs are included in this comment.