Skip to content

Windows: Codex local commands hang before child process is spawned #50725

Open

Description

@isolopak2

Summary

Codex local command execution is completely blocked in the ChatGPT Windows desktop app.

Even a minimal command such as:

cmd.exe /d /c echo CODEX_OK

hangs indefinitely without returning stdout, stderr, or an exit status.

The same command works normally when executed directly from Windows CMD.

This is not related to a specific project, directory, drive, or conversation. The problem also occurs in a completely new Codex chat.

Environment

  • OS: Windows 11 Pro
  • Windows version: 25H2
  • OS Build: 26200.9457
  • ChatGPT Windows app: 26.930.3930.0
  • Codex workspace version: 26.915.20218
  • ChatGPT plan: Plus

Current Codex executable observed:

C:\Users\itamar\AppData\Local\OpenAI\Codex\bin\8aaf1547b825b104\codex.exe

Windows sandbox configuration currently restored to:

[windows]
sandbox = "unelevated"

Minimal reproduction

  1. Open ChatGPT for Windows.
  2. Open a new Codex chat.
  3. Ask Codex to execute only:

cmd.exe /d /c echo CODEX_OK

  1. The execution remains running indefinitely.

Expected result:

CODEX_OK

Actual result:

The execution hangs and the requested cmd.exe process is never spawned.

Important process-level diagnostic

While the Codex command was hanging, I inspected the Windows process tree using Get-CimInstance Win32_Process.

The main Codex process was running:

codex.exe ... app-server ...

Several processes were also present with:

codex.exe --__codex-windows-mxc

However, the requested process:

cmd.exe /d /c echo CODEX_OK

was NOT present in the Windows process list.

The cmd.exe processes that were present belonged only to internal Codex components, including:

cmd.exe /d /c scripts\launch_code_review_mcp.cmd

and:

cmd.exe /d /s /c call ./scripts/launch_codex_app_tools_mcp.cmd ./server.mjs

Therefore, the requested child process appears not to be spawned at all.

Troubleshooting already performed

  • Confirmed CMD works normally outside Codex.
  • Confirmed filesystem read/write works normally outside Codex.
  • Reduced reproduction to cmd.exe /d /c echo CODEX_OK, eliminating project/filesystem access as the cause.
  • Reproduced in a completely new Codex chat.
  • Fully restarted ChatGPT.
  • ChatGPT Settings > Codex Workspace > Diagnose reports that the Codex dependencies are in order.
  • Used "Reset and install workspace" to download and reinstall the Codex workspace. The issue persisted.
  • Tested Windows sandbox = "elevated". Issue persisted.
  • Tested Windows sandbox = "unelevated". Issue persisted.
  • Tested Windows sandbox = "mxc". Issue persisted.
  • Tested alternate TEMP and TMP directory (C:\CodexTemp). Issue persisted.
  • Restored TEMP/TMP afterward.
  • Verified the normal Windows TEMP directory is readable and writable.
  • Checked winget upgrade; no ChatGPT update is currently offered.
  • Initially investigated project directory and filesystem ACLs, but those were ruled out because even a simple echo command hangs.

Additional observation

An older sandbox log under:

C:\Users\itamar.codex.sandbox\

stopped receiving new entries during the current reproduction attempts.

Earlier logs showed sandbox initialization activity, but the current failing executions did not update that log.

Feedback / diagnostics

A diagnostic feedback report was submitted directly from the affected Codex chat with ChatGPT diagnostic logs enabled.

Feedback ID:

01a103a6-9bd4-71b2-bf70-3c53ae3ea489

Impact

This completely blocks local Codex functionality in ChatGPT for Windows.

Codex cannot execute commands, inspect local projects through command execution, run tests, or perform source-code workflows that depend on local command execution.

sandbox.2026-10-03_.log

sandbox.2026-10-03_.log

Activity

  1. added
    bug
    app
    windows-os
    sandbox
    tool-calls
    on Oct 3, 2026
  2. Autarkis commented on Oct 4, 2026

    @Autarkis

    Observed a transient variant of this failure on Codex CLI 0.160.0 with Windows desktop app 26.930.3930.0 on 2026-10-04.

    Measurements from read-only diagnostics:

    • A simple PowerShell Get-Content -LiteralPath <local markdown file> remained pending for over two minutes. Retrying with login: false / -NoProfile also remained pending. The orchestration cells were cancelled, so the later sandbox log exit-code-1 records do not establish the original failure cause.
    • cmd.exe /c echo CODEX_DISPATCH_PROBE also stalled without accessing a file. The sandbox log recorded START at 13:04:18.989 and SUCCESS at 13:05:05.970: 46.981 seconds. The returned exec result reported wall_time_seconds: 0.0000116, suggesting delay before the normal execution/output wait rather than time spent doing the command's work.
    • Independent node_repl calls, including only nodeRepl.write('NODE_PING'), timed out at 10 seconds. The diagnostic logged redacted_source_available=false.
    • Execution subsequently recovered without an app restart, service restart, reinstall, or configuration change. Reading the same file via cmd.exe /c type took 311 ms round trip; sandbox START-to-SUCCESS was 64 ms. PowerShell file reads subsequently returned normally.
    • node_repl subsequently returned a ping in 684 ms; reading the same 12,929-byte file via node:fs/promises took 2 ms (474 ms total tool round trip).
    • codex doctor --json after recovery reported the desktop app-server handshake, installation consistency, and sandbox configuration as OK. No relevant Codex process-launch error appeared in the inspected Windows Application/System/Code Integrity/Defender error records during the incident.

    This isolates the observed symptom to the sandbox execution/startup path rather than the markdown file or a PowerShell profile. It does not identify the exact internal wait, establish the same root cause as this issue, or demonstrate a permanent fix. I cannot currently reproduce it after recovery.

    Related shell + node_repl timeout report: #48755

  3. isolopak2 commented on Oct 5, 2026

    @isolopak2
    Author

    Update — 2026-10-05
    The issue has now spontaneously recovered without any additional reinstall, service restart, or configuration change.
    I can confirm that:

    • cmd.exe /c echo CODEX_OK now succeeds with exit code 0.
    • Codex can again access and list D:\Obsidian\gestao_command, which was one of the directories that previously could not be accessed.
      However, execution still appears unusually slow. The simple echo CODEX_OK interaction took approximately 22 seconds, and listing the local Obsidian directory took approximately 20 seconds.
      This recovery appears consistent with the transient behavior described in the diagnostic response above. No specific action can currently be identified as the fix.
      I will leave the issue open because the root cause has not been identified and the current command startup latency still appears abnormal.
  4. arektet commented on Oct 6, 2026

    @arektet

    I can reproduce this issue on Windows 11.

    Environment:

    • Codex Desktop reported version: 26.930.61225
    • Desktop build: 13232
    • codex doctor --json detected desktop version: 26.930.7945.0
    • Bundled Codex CLI: 0.160.1
    • Windows: 10.0.26200, Windows 11 Professional x64
    • Sandbox backend: elevated
    • Sandbox provisioning: complete

    Desktop reproduction:

    1. Open an existing Codex Desktop conversation.
    2. Ask the agent to run:
      cmd.exe /d /c echo OK
    3. exec_command remains running indefinitely.
    4. No stdout or stderr is returned.
    5. The execution must be manually interrupted and then exits with code 1.

    The same problem occurs with PowerShell and with local file reads.

    Important isolation result:
    Running the bundled CLI directly outside the Desktop conversation works:

    codex.exe --version
    Result:
    codex-cli 0.160.1

    codex.exe sandbox -- cmd.exe /d /c echo CODEX_SANDBOX_OK
    Result:
    CODEX_SANDBOX_OK

    codex doctor --json reports:

    • sandbox.helpers: ok
    • sandbox provisioning: complete
    • authentication: ok
    • configuration: ok
    • network and WebSocket reachability: ok
    • state databases: ok

    The Desktop logs show that codex.exe and the app-server transport are spawned,
    but there is no corresponding exec_command/sandbox log entry when the command
    from the conversation hangs.

    Troubleshooting already performed:

    • Restarted Codex Desktop completely
    • Restarted Windows
    • Reinstalled the application/workspace
    • Updated to the latest available production build
    • Tested in another conversation
    • Verified direct CMD and PowerShell execution outside Codex
    • Verified the bundled Codex sandbox directly

    Conclusion:
    The Windows sandbox itself works. The failure appears to be in the Desktop
    conversation → unified exec/app-server command bridge or result handoff path.

    This completely blocks local file inspection, editing, Git operations and tests.

  5. hhdias commented on Oct 6, 2026

    @hhdias

    I can reproduce this on a separate Windows 11 system, with one additional A/B result that may help isolate the failure.

    Environment observed before updating:

    • Windows 11 CoreSingleLanguage, build 10.0.26300
    • Codex desktop 26.930.7945.0
    • Codex CLI doctor: 0.159.1 (0.160.1 was available)
    • Git 2.56.0.windows.2
    • Local bundled PowerShell and Python both execute normally outside the Codex task runner

    The issue persisted after updating the desktop app/CLI and after creating fresh Codex/Luna threads.

    Reproduction matrix:

    • Windows sandbox = "elevated": FAIL; even trivial commands time out with no stdout/stderr
    • elevated + sandbox_private_desktop = false: PowerShell builtin Write-Output can return, but child processes such as cmd.exe, git.exe, and python.exe still time out
    • Windows sandbox = "unelevated": FAIL; Write-Output, cmd, git, and python all time out
    • Full access: PASS

    Full-access control results in the same fresh thread environment:

    • cmd /d /c "echo CHILD_PROCESS_OK" -> PASS, exit 0, 1.102 s
    • git --version -> PASS, git version 2.56.0.windows.2, exit 0, 0.300 s
    • python --version -> PASS, Python 3.14.7, exit 0, 0.272 s

    Additional troubleshooting:

    • Windows PowerShell 5.1 works normally outside Codex
    • Codex-bundled pwsh.exe works normally outside the task runner (~0.3 s)
    • Codex-bundled Python works normally outside the task runner
    • process creation with redirected stdout/stderr works normally outside the task runner
    • recreated codex-primary-runtime
    • restarted CodexSandboxService.OpenAI.Codex successfully (new PID)
    • fresh thread still failed afterward
    • codex doctor reports sandbox backend = elevated and sandbox provisioning = complete
    • doctor also reports 5 rollout files missing from the state DB and 5 duplicate rollout thread IDs, but the databases themselves pass integrity checks

    The strongest discriminator here is that the exact same child commands succeed immediately under Full access while both Windows sandbox implementations fail. This looks consistent with a failure in the native Windows sandbox child-process launch path rather than Git/Python/PowerShell themselves.

  6. hhdias commented on Oct 6, 2026

    @hhdias

    Post-update follow-up to my earlier report (comment #6027142910):

    • ChatGPT Windows desktop version: 26.1002.51308 (About dialog: “Powered by Codex & OWL”, released October 6, 2026).
    • Re-tested in a fresh Codex thread using the normal sandboxed workspace-write mode, not Full access.
    • Each command timed out at 10 seconds with no stdout or stderr:
      1. Write-Output "SHELL_OK" — 10.000 s
      2. cmd /d /c "echo CHILD_OK" — 10.011 s
      3. git --version — 10.010 s
      4. python --version — 10.010 s
    • All commands were interrupted; exit code 1 reflects interruption, not their natural exit codes.

    Result: SANDBOX_STILL_BROKEN on ChatGPT desktop 26.1002.51308. The update did not resolve the sandboxed command-execution failure. The previously verified Full-access PASS was obtained before this update; Full access was not re-tested for this specific desktop build.

  7. arektet commented on Oct 7, 2026

    @arektet
  8. arektet commented on Oct 7, 2026

    @arektet
  9. hhdias commented on Oct 12, 2026

    @hhdias

    Update — October 12, 2026 (follow-up to my earlier comments #6027142910 and #6027742224).

    The issue still reproduces after a full reinstall of the ChatGPT Windows desktop application, a Windows reboot, and reinstalling Codex Workspace Dependencies. The app's dependency diagnostics report healthy, but local command execution remains blocked in restricted Desktop modes.

    New controlled A/B tests

    • Normal Windows PowerShell → cmd.exe /d /c echo WINDOWS_CMD_OK: PASS.
    • Codex Desktop, Ask for approval (restricted sandbox): TIMEOUT / no command output.
    • Codex Desktop, Approve automatically (restricted sandbox): TIMEOUT / repeated retries / no command output.
    • Same restricted mode in a new thread with an empty temporary workspace: TIMEOUT, so the issue is not specific to the project directory or workspace size.
    • Codex Desktop, Full access, in a new thread and in an existing project agent workspace: PASS. A cmd.exe /d /c echo CODEX_FULL_ACCESS_OK call returned exit code 0 in 0.786 s.
    • Retested with [windows] sandbox = "unelevated": still fails. Earlier elevated testing also failed.

    Important new discriminator: invoke the sandbox directly via the bundled CLI

    From an ordinary PowerShell session (outside Codex Desktop), using the executable installed at %LOCALAPPDATA%\OpenAI\Codex\bin\2e5e00daee91c61d\codex.exe:

    > codex.exe --version
    codex-cli 0.162.0-alpha.17.2
    
    > codex.exe sandbox -- cmd.exe /d /c echo CLI_SANDBOX_OK
    CLI_SANDBOX_OK
    

    Direct CLI sandbox invocation succeeds while sandboxed command execution initiated from a Desktop conversation hangs. This is consistent with the Desktop conversation → command execution/app-server handoff being implicated (or a different sandbox invocation path), rather than CMD itself or a total inability to launch processes under the Windows sandbox. It does not prove the exact internal root cause.

    Local diagnostic log evidence

    • The ~/.codex/logs_2.sqlite database contains recent exec tool events with outcome="interrupted"; one call took approximately 10.2 seconds before interruption. These are interruption durations, not natural exit codes of the requested commands.
    • The log identifies Codex Desktop app-server client version 26.1007.21434; this is a client version observed in the logs, not a claimed Windows application About-dialog version.
    • No specific Windows process-creation error has been established from the excerpts inspected. The legacy ~/.codex/.sandbox/sandbox.log path is absent on this installation.

    This aligns with the independent Desktop-vs-direct-CLI reproduction in comment #6011061867. The issue remains reproducible after reinstalling, in both restricted approval modes, while Full access and direct CLI sandbox execution succeed.

  10. HABU-daiki-matsushita commented on Oct 13, 2026

    @HABU-daiki-matsushita

    Same issue here on a newer version.

    • ChatGPT Windows app: 26.1007.2314.0 (About: 26.1007.21434)
    • Started right after the Store update installed on 2026-10-13 08:50 JST
      (the update had failed twice on 10-12 with 0x80073D02 because the app was running)
    • Sandbox log shows only START lines, no SUCCESS:
      START: windows -- cmd.exe /d /c echo SANDBOX_OK
    • Full access works (commands finish in ~1s)
    • elevated / unelevated both hang; resetting .codex.sandbox: folder is not recreated
    • Restarting CodexSandboxService and reinstalling the app did not help
    • ChatGPT.exe (155.0.8059.40) repeatedly hangs (MoAppHang) since the update
    • Colleagues on the same version are NOT affected, so it seems machine-specific
  11. robincornelius commented on Oct 14, 2026

    @robincornelius

    I can reproduce this on another Windows 11 system on 14 October 2026. The desktop-versus-direct-CLI distinction described above matches my results closely.

    Environment:

    • ChatGPT Pro account.
    • Windows 11 Enterprise 25H2, build 26200.9448.
    • Running app updater: 26.1007.71326, build 20398, production channel, up_to_date.
    • codex doctor reports desktop package version 26.1007.9446.0; these are different version representations.
    • Bundled CLI: 0.162.0-alpha.17.2.
    • Saved configuration: sandbox_mode = "workspace-write", [windows] sandbox = "unelevated".

    Reproduction:

    • Normal desktop exec_command with Write-Output 'DESKTOP_SANDBOX_PROBE' or CMD echo DESKTOP_CMD_OK returns a running session ID after approximately 10 seconds, with no output. Subsequent polls still return no output.
    • login=false and a working directory outside OneDrive (C:\Windows) do not resolve it.
    • Minimal node_repl readiness checks and browser automation also time out.
    • Approved outside-sandbox execution returns promptly.

    Important positive control:
    Using the same installed CLI directly from PowerShell:

    & $codex -c 'windows.sandbox=unelevated' sandbox --include-managed-config -P ':workspace' -- 'C:\Windows\System32\cmd.exe' /d /c 'echo DIRECT_UNELEVATED_OK'

    This returns DIRECT_UNELEVATED_OK, exit 0 (recorded repeat: 1.75 seconds). Direct sandboxed PowerShell successfully reads a project file, and the bundled Node runtime successfully runs console.log(12345) inside the direct sandbox.

    Caveat: the desktop uses a restricted permission profile while the direct probe uses :workspace; identical effective permissions have not been established.

    Already attempted: repeated full app/subprocess restarts, full PC reboot, disabling OneDrive, closing PowerPoint, and changing elevated to unelevated followed by restart. The updater reports no update available. These have not restored normal desktop execution.

    Diagnostics:

    • codex doctor reports configuration parsing, installation consistency, desktop app-server handshake, provider HTTP/WebSocket connectivity and sandbox configuration as OK.
    • Current desktop logs contain successful windowsSandbox/readiness responses.
    • Today's sandbox log contains successful direct CLI START entries but does not explain the hanging desktop tool calls.
    • Historical elevated logs from 13 October contain access-denied errors under C:\Users\Default, but those should not be assumed to explain the current failure because direct unelevated execution now works.
    • Defender exclusions are unverified; no locally visible recent Codex security enforcement was found. No security settings were changed.

    This supports investigating the desktop command-execution handoff or a different sandbox invocation path. It does not establish the precise internal cause. A supported recovery path and actionable timeout diagnostics would be appreciated; repeated failed attempts have blocked work and consumed Pro usage.

    I have prepared a sanitised diagnostics bundle containing selected log excerpts and diagnostic summaries, excluding credentials, sandbox secrets, full configuration and project documents.

    codex-sandbox-bug-report.zip

  12. danmaster023 commented on Nov 1, 2026

    @danmaster023

    Codex desktop (Windows): remote exec-server command hangs in the MXC runner before any shell starts; user config can't change the backend

    Additional reproduction report from November 1, 2026. Credentials, tokens, account IDs and environment IDs are omitted.

    Versions

    • App: OpenAI.Codex (Microsoft Store package) 26.1027.3384.0, launched as ChatGPT.exe
    • Bundled CLI used by the bridge: codex-cli 0.166.0-alpha.5.1
    • OS: Windows 11 Pro 26H2, build 26300.9711
    • Account type: consumer ChatGPT account
    • Sandbox log on this machine records MXC availability: true and Windows sandbox selection: mxc (for example 2026-11-01 00:06:54 and 00:12:40 local)

    What happens

    1. A remote ChatGPT/Codex agent sends one command to this PC through the desktop app's remote bridge: Write-Output '<marker>'.
    2. The bridge (codex.exe ... exec-server --remote https://codex-cloud-environments.chatgpt.com/api --environment-id <redacted>) starts an MXC runner (codex.exe --__codex-windows-mxc) at 2026-11-01 04:48:05 local.
    3. The runner never starts a shell. Its only child is a conhost. No output, no error text and no new lines in ~/.codex/.sandbox/sandbox.<date>.log. The remote side's first response and one follow-up read both reported "still running" with no output.
    4. The runner was confirmed still alive at 04:50:29 local (2 min 24 s after it started). It had exited by 04:56:49 local (at most 8 min 44 s after start). The exact exit time isn't recorded. It left no sandbox log lines and no Windows Application error event, and nobody stopped it.

    Why user configuration couldn't change it

    • The app starts the bridge with -c features.prefer_mxc=true on the command line. That overrides ~/.codex/config.toml.
    • Test: set [features] prefer_mxc = false in config.toml (keeping [windows] sandbox = "elevated") and ran one marker. It still went to MXC and stalled the same way. The config was then restored, and its hash verified, unchanged since.
    • In the inspected app bundle, the override is added when: platform is win32, environment kind is "local", not running inside WSL, and the stored app setting electron-prefer-mxc-enabled is true. On this machine that setting is true. It appears to be set from a renderer feature gate rather than a visible setting.
    • No supported UI control for the sandbox backend was found in the inspected build (26.1027.3384.0), and the Windows sandbox docs describe automatic MXC preference for consumer accounts.
    • The documented opt-out is [windows] allow_mxc = false, described in the docs as a managed requirements.toml requirement. It was added in CLI 0.163.0 (openai/codex PR 51547). The bundled 0.166 CLI recognises the key. It isn't set on this machine and hasn't been tested. Whether the remote bridge honours it is unknown.

    Related reports

    • Windows: Codex local commands hang before child process is spawned #50725 (open): "Windows: Codex local commands hang before child process is spawned". Several independent reporters describe the same pattern: desktop-initiated commands hang with no output while codex.exe --__codex-windows-mxc processes are present, the requested child process is never spawned, and the sandbox log stops receiving entries. The same commands succeed when run directly through the bundled CLI's codex sandbox. The issue's attachments weren't opened for this report.
    • [Windows] Elevated sandbox blocked by MAXIMUM_ALLOWED on live runtime files; access-mask comparison and verified local recovery #51971: a separate, earlier problem, kept apart from this diagnosis. On 2026-10-10 the app-bundled sandbox setup helper ran six setup refreshes on this PC between 11:48 and 13:54 UTC. The log recorded 18 "runtime read/execute validation failed ... os error 32" lines on the then-current cua_node runtime's node_repl.exe (runtime 3dd31cfff853001c). That error-32 fix (PR 51822, "Avoid sharing violations when repairing Windows runtime ACLs") shipped in CLI 0.163.0. This machine now runs 0.166.0-alpha.5.1 and a newer runtime (5c41f77a7900391c). The current MXC hang showed no setup or validation activity at all.

    Not yet tested

    • The legacy elevated backend through the actual remote bridge path.

    Expected

    • If the MXC runner can't start the command, return an error, or fall back to the configured windows.sandbox backend, instead of hanging silently with no log entry.
    • Provide a supported way to select the sandbox backend for the remote bridge, or make the existing configuration (features.prefer_mxc, windows.sandbox) apply to it.

    Diagnostics available on request

    Process tree (bridge → MXC runner → conhost, no shell), timestamps, and sandbox log excerpts. All of it can be shared with ids redacted.

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

    appbugsandboxtool-callswindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions