#Codex Windows internal command runner injects duplicate Path/PATH environment entries

1 messages · Page 1 of 1 (latest)

outer pantherBOT
#

Reported by @main vortex

Bug Report: Codex Windows internal command runner injects duplicate Path/PATH environment entries
`Steps to Reproduce`

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.

`Expected Result`

only a single Path environment variable should be available to the build environment invoked by Codex

`Actual Result`

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'

`Environment`

Codex for Windows (Microsoft Store, 2026/03/13) + Visual Studio Community 2026

#
Additional Information

Please provide relevant details to help resolve the issue, such as:

  • ChatGPT Shared Link (if applicable).
  • Screenshots or videos demonstrating the problem.

-# ➜ Need to contact support? Visit the OpenAI Help Center.

main vortex
#

From Codex itself :

Important contrast
Inside the interactive PowerShell terminal opened from Codex for Windows, running:

cmd /c set
shows only:

Path=...
and not both Path and PATH.

So the issue seems specific to the internal command execution path, not the visible terminal session.

Repro
In the Codex agent/internal tool execution environment on Windows:

Run:
cmd /c set
Observe both PATH= and Path= entries.
Run a .NET/MSBuild/PowerShell environment enumeration path, for example:
Get-ChildItem Env:
Observe duplicate-key failure.

#

Environment

OS: Windows
App: Codex for Windows
Observed package path in logs:
C:\Program Files\WindowsApps\OpenAI.Codex_26.311.2262.0_x64__2p2nqsd0c76g0\app\resources
Internal components mentioned in logs:
codex.exe
codex-command-runner.exe
codex-windows-sandbox-setup.exe
Additional Observations
Codex sandbox logs also show repeated ACL-related errors against the app resources directory:

SetNamedSecurityInfoW failed: 5
path involved:
C:\Program Files\WindowsApps\OpenAI.Codex_26.311.2262.0_x64__2p2nqsd0c76g0\app\resources
This may or may not be directly related to the Path/PATH duplication, but it suggests issues in the Windows sandbox/setup layer.

#

Why this looks like a Codex runner bug

  • Normal Windows cmd.exe session: no problematic duplicate behavior observed
  • Interactive PowerShell inside Codex UI: does not show the duplicate
  • Internal Codex tool execution: does show duplicate Path and PATH
  • Therefore the bug likely lives in the internal command runner / sandbox environment preparation, not in the user’s machine-wide environment