[Windows Desktop] Shell child processes get `PATHEXT` truncated to `.CPL`, causing `git`, `cmd`, and other `.exe` commands to stop resolving

Open 💬 4 comments Opened Mar 19, 2026 by STSNaive

What version of the Codex App are you using (From “About Codex” dialog)?

OpenAI Codex Desktop 26.313.5234.0 Windows Store package: OpenAI.Codex_26.313.5234.0_x64__2p2nqsd0c76g0

What subscription do you have?

Chatgpt Plus

What platform is your computer?

Microsoft Windows NT 10.0.22621.0 x64

What issue are you seeing?

Codex Desktop appears to launch some shell child processes with a corrupted PATHEXT.

Inside the broken shell process, the environment contains only:

$env:PATHEXT
.CPL

instead of a normal Windows value such as:

.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

As a result, bare executable names stop resolving in PowerShell. For example:

  • git --version fails with CommandNotFoundException
  • cmd /c ... also fails if invoked without an explicit extension or full path
  • direct invocation with a full path still works, for example:
& 'C:\Program Files\Git\cmd\git.exe' --version

This breaks Codex shell tool calls on Windows whenever the tool tries to run git, cmd, or other .exe programs by name.

What steps can reproduce the bug?

  1. Open Codex Desktop on Windows.
  2. Start a workspace/thread.
  3. Ask Codex to run:
$env:PATHEXT
  1. Observe that inside the shell child process, it prints:
.CPL
  1. Ask Codex to run:
git --version
  1. Observe that it fails with CommandNotFoundException.
  2. Run:
& 'C:\Program Files\Git\cmd\git.exe' --version
  1. Observe that it succeeds.
  2. In the same broken shell, set:
$env:PATHEXT='.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC'
  1. Run again:
git --version
  1. Observe that it immediately starts working.

What is the expected behavior?

Codex should preserve the normal Windows PATHEXT value when spawning shell child processes, so bare .exe commands such as git, cmd, node, etc. resolve the same way they do in a normal PowerShell session.

Additional information

I did some local investigation to narrow this down:

  • Machine-level registry PATHEXT is normal
  • User-level registry does not override PATHEXT
  • My PowerShell profile does not modify PATHEXT
  • git.exe is installed and present on PATH
  • Direct full-path execution works
  • The parent Codex Desktop processes appear to have a normal PATHEXT
  • The corruption appears when app\resources\codex.exe (app-server --analytics-default-enabled) spawns the PowerShell shell child

My current inference is that the desktop app is rebuilding the child environment incorrectly and truncating PATHEXT to the last segment (.CPL).

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗