Windows Desktop command runner exposes duplicate Path and PATH process variables

Open 💬 0 comments Opened Aug 8, 2026 by bvjwebservices

What version of Codex is running?

Codex Desktop: 26.803.5235.0
Codex CLI: codex-cli 0.147.0-alpha.6.5

Platform

Windows 11 / PowerShell 5.1

Issue

Codex-spawned PowerShell command processes contain both Path and PATH as separate process environment keys.

This causes failures in tooling that enumerates process environment variables and expects Windows environment variable keys to be case-insensitive/unique.

Reproduction

Run this in a Codex shell command on Windows:

[Environment]::GetEnvironmentVariables('Process').GetEnumerator() | Where-Object { $_.Key -ieq 'path' } | Select-Object Key

Actual result

Key
---
Path
PATH

Expected result

Only one canonical Windows path environment variable should be present, preferably Path.

Additional context

Persistent Windows environment sources only contain Path:

  • HKCU\Environment -> Path
  • HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment -> Path

The duplicate appears only inside Codex-spawned processes.

Attempted mitigation in C:\Users\Bobby\.codex\config.toml:

[shell_environment_policy]
inherit = all
ignore_default_excludes = true

[shell_environment_policy.filters]
PATH = exclude

[shell_environment_policy.set]
Path = ...

After a full PC restart, Codex still exposes both Path and PATH, suggesting the duplicate is created by the Windows command runner / PATH alias layer after shell environment policy is applied.

View original on GitHub ↗