mirror of
https://github.com/openai/codex.git
synced 2026-10-20 17:38:45 +00:00
Preserve Windows startup variables and MXC child environment defaults (#54027)
## Why Windows MXC needs valid host startup variables, while an empty child environment must remain empty for the SDK to select Windows user-profile defaults. ## What changed - Replace caller overrides of `SystemDrive` and `LOCALAPPDATA` case-insensitively with nonempty Unicode host values, failing before launch if either is unavailable. - Track whether the original child environment was empty, ignoring launcher transport keys. Supply host `SystemRoot` for launcher bootstrap in that case, then clear the bootstrap environment before the SDK selects defaults. ## Testing Extend transport tests to cover host-value replacement and preservation of empty child environments. Strengthen the PowerShell fallback RPC test to require `SystemDrive`, `LOCALAPPDATA`, `USERPROFILE`, and `PATH` in the child. GitOrigin-RevId: a097e1079069ef897ebb5ba5e63546328c5faeaa
This commit is contained in:
@@ -48,7 +48,7 @@ async fn powershell_alias_falls_back_without_primary_runtime_over_rpc(
|
||||
.into_owned(),
|
||||
"-NoProfile".to_owned(),
|
||||
"-Command".to_owned(),
|
||||
"Write-Output 'fallback-ok'".to_owned(),
|
||||
"if (!$env:SystemDrive -or !$env:LOCALAPPDATA -or !$env:USERPROFILE -or !$env:PATH) { throw 'missing Windows defaults' }; Write-Output 'fallback-ok'".to_owned(),
|
||||
],
|
||||
cwd,
|
||||
env_policy: None,
|
||||
|
||||
Reference in New Issue
Block a user