Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

fix(windows-path): preserve PATH order; include core env vars (#5579)

Curte9135fa7c584
diff --git a/codex-rs/rmcp-client/src/utils.rs b/codex-rs/rmcp-client/src/utils.rs
index 17e050cb6f..8deb4d402b 100644
--- a/codex-rs/rmcp-client/src/utils.rs
+++ b/codex-rs/rmcp-client/src/utils.rs
@@ -171,13 +171,33 @@ pub(crate) const DEFAULT_ENV_VARS: &[&str] = &[
#[cfg(windows)]
pub(crate) const DEFAULT_ENV_VARS: &[&str] = &[
+ // Core path resolution
"PATH",
"PATHEXT",
+ // Shell and system roots
+ "COMSPEC",
+ "SYSTEMROOT",
+ "SYSTEMDRIVE",
+ // User context and profiles
"USERNAME",
"USERDOMAIN",
"USERPROFILE",
+ "HOMEDRIVE",
+ "HOMEPATH",
+ // Program locations
+ "PROGRAMFILES",
+ "PROGRAMFILES(X86)",
+ "PROGRAMW6432",
+ "PROGRAMDATA",
+ // App data and caches
+ "LOCALAPPDATA",
+ "APPDATA",
+ // Temp locations
"TEMP",
"TMP",
+ // Common shells/pwsh hints
+ "POWERSHELL",
+ "PWSH",
];
#[cfg(test)]