Always use private desktops for legacy Windows sandboxes (#46554)

## What changed

- Remove the private-desktop opt-out from elevated and unelevated Windows sandbox launches.
- Remove `windows.sandbox_private_desktop` and its managed requirement and API fields. Warn users to remove the obsolete setting.
- Require a private desktop name when launching through the Windows sandbox wrapper and command runner.

## Testing

Add coverage for the obsolete-setting migration warning and update wrapper tests to verify a live private desktop is passed and a missing desktop name is rejected.

GitOrigin-RevId: c7135f8d211aac8d812180691c2c1e433d77cde4
This commit is contained in:
iceweasel-oai
2026-09-19 01:21:32 +00:00
committed by copyberry
parent c6f5d9e9b5
commit a633ebc124
94 changed files with 179 additions and 680 deletions
+3 -10
View File
@@ -123,7 +123,6 @@ fn unsandboxed_transform_preserves_foreign_cwd_and_unrestricted_file_system_poli
sandbox_exe: None,
use_legacy_landlock: false,
windows_sandbox_level: WindowsSandboxLevel::Disabled,
windows_sandbox_private_desktop: false,
})
.expect("transform");
@@ -180,7 +179,6 @@ fn symlinked_workspace_reports_seatbelt_preparation_error() {
sandbox_exe: None,
use_legacy_landlock: false,
windows_sandbox_level: WindowsSandboxLevel::Disabled,
windows_sandbox_private_desktop: false,
})
.expect_err("symlinked workspace should be rejected");
@@ -235,7 +233,6 @@ fn transform_additional_permissions_enable_network_for_external_sandbox() {
sandbox_exe: None,
use_legacy_landlock: false,
windows_sandbox_level: WindowsSandboxLevel::Disabled,
windows_sandbox_private_desktop: false,
})
.expect("transform");
@@ -306,7 +303,6 @@ fn transform_additional_permissions_preserves_denied_entries() {
sandbox_exe: None,
use_legacy_landlock: false,
windows_sandbox_level: WindowsSandboxLevel::Disabled,
windows_sandbox_private_desktop: false,
})
.expect("transform");
@@ -408,7 +404,6 @@ fn transform_linux_seccomp_request(
sandbox_exe: Some(codex_linux_sandbox_exe),
use_legacy_landlock: false,
windows_sandbox_level: WindowsSandboxLevel::Disabled,
windows_sandbox_private_desktop: false,
})
.expect("transform")
}
@@ -618,7 +613,6 @@ async fn linux_unix_socket_grant_uses_effective_managed_policy() -> anyhow::Resu
sandbox_exe: Some(std::path::Path::new("/tmp/codex-linux-sandbox")),
use_legacy_landlock: false,
windows_sandbox_level: WindowsSandboxLevel::Disabled,
windows_sandbox_private_desktop: false,
})?;
let transported_context = request
.command
@@ -720,7 +714,7 @@ fn transform_for_direct_spawn_windows_materializes_inner_helper() {
},
FileSystemSandboxEntry {
path: blocked.into(),
access: FileSystemAccessMode::Deny,
access: FileSystemAccessMode::Read,
missing_path_behavior: None,
},
]),
@@ -757,8 +751,7 @@ fn transform_for_direct_spawn_windows_materializes_inner_helper() {
sandbox_policy_cwd: &cwd_uri,
sandbox_exe: None,
use_legacy_landlock: false,
windows_sandbox_level: WindowsSandboxLevel::Elevated,
windows_sandbox_private_desktop: false,
windows_sandbox_level: WindowsSandboxLevel::RestrictedToken,
},
},
codex_home.path(),
@@ -803,7 +796,7 @@ fn transform_for_direct_spawn_windows_materializes_inner_helper() {
exec_request
.command
.iter()
.any(|arg| arg == "--deny-read-paths-json")
.any(|arg| arg == "--deny-write-paths-json")
);
assert_eq!(
exec_request.command[separator_index + 2],