Commit Graph
2 Commits
Author SHA1 Message Date
iceweasel-oai 42cd1ec497 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
2026-09-11 20:10:02 +00:00
iceweasel-oai 4150a2c205 Add bounded environment transport for MXC launch requests (#44626)
## Why

Sandbox policies can exceed Windows command-line limits. Provide an environment transport for these larger MXC launch requests.

## What changed

- Make `MxcCommand` serializable and add JSON encoding and decoding through `CODEX_MXC_LAUNCH_*` environment variables.
- Split payloads into UTF-8-safe chunks of at most 4,096 bytes, with a 1,000,000-byte payload limit and at most 256 chunks.
- Reject malformed or duplicate transport entries and remove all transport variables during decoding, including on failure. Preserve unrelated environment variables.

## Testing

Add tests for large Unicode and escaped-argument round trips, stale variable removal, malformed transport rejection and cleanup, and oversized payload rejection without modifying the environment.

GitOrigin-RevId: 0e5ae2535ef313985a95eb8a5fd4884974dfb1eb
2026-09-10 19:29:54 +00:00