Skip to content

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

Open

Description

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.

What is the expected behavior?

No response

Additional information

No response

Activity

  1. added
    bugSomething isn't working
    windows-osIssues related to Codex on Windows systems
    tool-callsIssues related to tool calling
    on Oct 13, 2026
  2. github-actions commented on Oct 13, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. TheSplean commented on Oct 14, 2026

    @TheSplean

    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

  4. nehcruhtra commented on Oct 27, 2026

    @nehcruhtra

    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, so config.toml is ignored.

    The app-server command line on every launch:

    codex.exe -c features.code_mode_host=true app-server --analytics-default-enabled \
      -c features.prefer_mxc=true \
      -c plugins.codex-app-tools@openai-bundled.mcp_servers.codex_app.enabled=true
    

    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.

  5. bagomeatstudios commented on Nov 20, 2026

    @bagomeatstudios

    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.

    One deliberately non-retried sequence:

    • Python 3.11 create/read/delete disposable canary: PASS, exit 0, 0.297 s, expected markers, empty stderr.
    • cmd.exe /d /c marker: PASS, exit 0, 0.312 s, expected marker, empty stderr.
    • 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingtool-callsIssues related to tool callingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions