Windows Codex runner injects duplicate PATH/Path env vars, breaking pnpm exec local bin resolution
What version of the Codex App are you using (From “About Codex” dialog)?
26.422.30944
What subscription do you have?
Plus
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
On Windows, Codex desktop runner starts tool execution with duplicate PATH environment variables: both PATH and Path.
Inside Codex runner:
node -e "console.log(Object.keys(process.env).filter(k => k.toLowerCase() === 'path'))"
Output:
[ 'PATH', 'Path' ]
This breaks pnpm exec local binary resolution. Project-local binaries in node_modules/.bin are not found.
Example:
pnpm exec tsc --version
Output inside Codex runner:
'tsc' is not recognized as an internal or external command,
operable program or batch file.
The same happens with other local binaries:
pnpm exec vite --version
Output:
'vite' is not recognized as an internal or external command,
operable program or batch file.
Environment:
- OS: Windows
- App: Codex desktop
- Codex runner shell:
C:\Program Files\WindowsApps\Microsoft.PowerShell_7.6.1.0_x64__8wekyb3d8bbwe\pwsh.exe - PowerShell in Codex runner:
7.6.1 - pnpm:
10.18.3 - Node:
22.12.0
What steps can reproduce the bug?
- Open Codex desktop on Windows.
- Open a project that has local binaries installed under
node_modules/.bin, for example a frontend project withtypescriptandvite. - Run this inside Codex tool execution:
node -e "console.log(Object.keys(process.env).filter(k => k.toLowerCase() === 'path'))"
- Observe that Codex runner prints:
[ 'PATH', 'Path' ]
- Run:
pnpm exec tsc --version
- Observe that it fails:
'tsc' is not recognized as an internal or external command,
operable program or batch file.
For comparison, in a normal Windows PowerShell terminal on the same machine:
node -e "console.log(Object.keys(process.env).filter(k => k.toLowerCase() === 'path'))"
prints:
[ 'Path' ]
and:
pnpm exec tsc --version
prints:
Version 5.9.3
The registry environment variables were checked and normalized. Full registry listing shows only Path under both:
HKCU\Environment
HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
A workaround using ProcessStartInfo with a manually cleaned environment also confirms the issue is caused by duplicate PATH/Path in the Codex runner process environment.
What is the expected behavior?
Codex runner on Windows should start tool execution with a normalized process environment containing only one PATH key, preferably Path.
Expected inside Codex runner:
node -e "console.log(Object.keys(process.env).filter(k => k.toLowerCase() === 'path'))"
[ 'Path' ]
Then pnpm exec should correctly inject node_modules/.bin and resolve project-local binaries.
Expected:
pnpm exec tsc --version
Version 5.9.3
Additional information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗