Wire up the native Windows MXC helper entry point (#44903)

## What changed

- Dispatch `--__codex-windows-mxc` before normal CLI parsing, launch the decoded request, and propagate the child exit code.
- Build the native request from the helper's environment and working directory, discovered Windows platform directories, and volume roots, including UNC working-directory roots. Reject non-Unicode environment values and empty child environments.
- Allow Win32k calls and desktop handles needed for PowerShell startup while retaining clipboard, input-injection, and desktop/system-control restrictions.
- Keep policy, transport, and native launch internals private, and report an explicit error when the helper is invoked outside Windows.

## Testing

Add a wrapper regression test covering exact argument preservation, Windows quoting, separate policy and command working directories, and explicit environment forwarding.

GitOrigin-RevId: 674d0d61a3265bd517b77da9f9de2cd9fad62917
This commit is contained in:
iceweasel-oai authored and copyberry committed 2026-09-11 20:10:02 +00:00
1 parent e3a52b87b2
commit 42cd1ec497
10 files changed
+232 -33

No files matched your search

+3
View File
@@ -100,6 +100,9 @@ pub fn arg0_dispatch() -> Option<Arg0PathEntryGuard> {
}
let argv1 = args.next().unwrap_or_default();
if argv1 == codex_sandboxing::CODEX_WINDOWS_MXC_ARG1 {
codex_sandboxing::run_windows_mxc_main();
}
#[cfg(unix)]
if argv1 == CODEX_ARG0_EXEC_HELPER_ARG1 {
codex_exec_server::run_arg0_exec_helper_main();