Reported by @main vortex
On Windows, commands executed by Codex’s internal tool runner appear to receive an environment block containing both Path and PATH entries at the same time. This breaks some .NET/MSBuild/PowerShell code paths with errors like “An item with the same key has already been added”. The issue does not reproduce in a normal user cmd.exe, nor in the interactive PowerShell terminal visible inside Codex for Windows.
only a single Path environment variable should be available to the build environment invoked by Codex
When commands are executed through the internal Codex tool runner, cmd /c set shows both:
PATH=...
Path=...
with effectively the same value.
This causes failures such as:
PowerShell:
Get-ChildItem Env: fails with:
An item with the same key has already been added.
MSBuild / CL:
MSB6001
System.ArgumentException: An item has already been added. Key: 'Path' Added key: 'PATH'
Codex for Windows (Microsoft Store, 2026/03/13) + Visual Studio Community 2026