[Windows Desktop] Shell child processes get `PATHEXT` truncated to `.CPL`, causing `git`, `cmd`, and other `.exe` commands to stop resolving
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 --versionfails withCommandNotFoundExceptioncmd /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?
- Open Codex Desktop on Windows.
- Start a workspace/thread.
- Ask Codex to run:
$env:PATHEXT
- Observe that inside the shell child process, it prints:
.CPL
- Ask Codex to run:
git --version
- Observe that it fails with
CommandNotFoundException. - Run:
& 'C:\Program Files\Git\cmd\git.exe' --version
- Observe that it succeeds.
- In the same broken shell, set:
$env:PATHEXT='.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC'
- Run again:
git --version
- 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
PATHEXTis normal - User-level registry does not override
PATHEXT - My PowerShell profile does not modify
PATHEXT git.exeis installed and present onPATH- 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).
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗