Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions codex-rs/rmcp-client/src/stdio_server_launcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,12 @@ impl ExecutorStdioServerLauncher {
// environment, not copied from Codex. Start from `All` only so the
// named remote variable is available to the filter below; the
// effective child env is still limited by `include_only`.
// The orchestrator may be Unix while the executor is Windows.
// Preserve Windows runtime initialization and temporary-directory
// inputs even when explicit remote vars activate this allowlist.
crate::utils::DEFAULT_ENV_VARS
.iter()
.chain(["SYSTEMROOT", "TEMP", "TMP"].iter())
.map(|name| (*name).to_string())
.chain(remote_env_vars.iter().cloned())
.collect()
Expand Down Expand Up @@ -763,6 +767,15 @@ mod tests {
let env = shell_environment::create_env_from_vars(
[
("PATH".to_string(), "/remote/bin".to_string()),
("SystemRoot".to_string(), r"C:\Windows".to_string()),
(
"TEMP".to_string(),
r"C:\Users\test\AppData\Local\Temp".to_string(),
),
(
"TMP".to_string(),
r"C:\Users\test\AppData\Local\Temp".to_string(),
),
("REMOTE_TOKEN".to_string(), "remote-secret".to_string()),
(
"UNREQUESTED_SECRET".to_string(),
Expand All @@ -774,6 +787,16 @@ mod tests {
);

assert_eq!(env.get("PATH").map(String::as_str), Some("/remote/bin"));
assert_eq!(
env.get("SystemRoot").map(String::as_str),
Some(r"C:\Windows")
);
for name in ["TEMP", "TMP"] {
assert_eq!(
env.get(name).map(String::as_str),
Some(r"C:\Users\test\AppData\Local\Temp")
);
}
assert_eq!(
env.get("REMOTE_TOKEN").map(String::as_str),
Some("remote-secret")
Expand Down
Loading