Separate executor sandbox selection from Windows sandbox levels (#45730)

## Why

MXC is a sandbox implementation, not a restricted-token sandbox level. Executor requests need to represent that choice separately from `WindowsSandboxLevel`.

## What changed

- Introduce `WindowsSandboxSelection` for executor sandbox contexts and remove `Mxc` from `WindowsSandboxLevel`.
- Preserve the `windowsSandboxLevel` wire field and its serialized values for compatibility.
- Share sandbox selection between executor process launches and filesystem helpers, and use the new selection in capability discovery and skill reads.
- Disable Windows sandbox selection for executor paths that do not use Windows path conventions.

## Testing

Extend coverage for MXC wire serialization, Windows skill-read sandbox checks, and capability discovery with distinct permissions. Exercise remote filesystem write restrictions with both restricted-token and MXC sandboxes, including rejection when native MXC is unavailable.

GitOrigin-RevId: 266211377bcb138a0dc75861e9ff2225fa37a53d
This commit is contained in:
iceweasel-oai authored and copyberry committed 2026-09-15 16:40:06 +00:00
1 parent a9d2564bcb
commit d4e11a9b97
32 files changed
+256 -150

No files matched your search

+3 -3
View File
@@ -373,10 +373,10 @@ fn exec_server_env_keeps_command_native_and_carries_sandbox_context() {
workspace_roots: vec![cwd_uri.clone()],
user_home_dir: None,
temporary_directories: None,
windows_sandbox_level: if cfg!(windows) {
codex_protocol::config_types::WindowsSandboxLevel::RestrictedToken
windows_sandbox_selection: if cfg!(windows) {
codex_file_system::WindowsSandboxSelection::RestrictedToken
} else {
codex_protocol::config_types::WindowsSandboxLevel::Disabled
codex_file_system::WindowsSandboxSelection::Disabled
},
windows_sandbox_private_desktop: false,
windows_sandbox_proxy_settings_mode: None,