Enable MXC selection through Windows sandbox configuration (#46271)

## What changed

- Accept `windows.sandbox = "mxc"` and preserve the selected backend through environment configuration, command execution, patch writes, and sandbox metadata.
- Treat MXC as enabled in the TUI and report Windows sandbox readiness as `ready`, avoiding legacy setup prompts.
- Keep `allowed_sandbox_implementations` scoped to the legacy elevated and unelevated backends without restricting MXC.
- Default `windows.sandbox_private_desktop` to `false` for MXC while retaining `true` for legacy sandboxes.

## Testing

Add coverage for MXC configuration precedence, legacy requirement handling, sandbox selection, and TUI state. Add a Wine integration test that verifies command and patch routing fails when native MXC is unavailable and reports `windows_mxc` in turn metadata.

GitOrigin-RevId: e2162447d0750f60753864c92a20e02a7f297bca
This commit is contained in:
iceweasel-oai authored and copyberry committed 2026-09-17 18:20:28 +00:00
1 parent 3d3ae4965a
commit 8b78600dc8
72 files changed
+557 -142

No files matched your search

@@ -6,7 +6,7 @@ use anyhow::bail;
use codex_cloud_config::cloud_config_bundle_loader_for_storage_without_cache;
use codex_config::ConfigLoadOptions;
use codex_config::ConfigRequirementsToml;
use codex_config::types::WindowsSandboxModeToml;
use codex_config::WindowsSandboxImplementationToml;
use codex_core::config::bootstrap_auth_config;
use codex_core::config::load_config_toml_with_layer_stack;
use codex_windows_sandbox::WindowsSandboxProvisioningSettings;
@@ -92,7 +92,7 @@ fn validate_requirements(
.windows
.as_ref()
.and_then(|windows| windows.allowed_sandbox_implementations.as_ref())
.is_some_and(|allowed| !allowed.contains(&WindowsSandboxModeToml::Elevated))
.is_some_and(|allowed| !allowed.contains(&WindowsSandboxImplementationToml::Elevated))
{
bail!("managed policy does not permit the elevated Windows sandbox");
}