mirror of
https://github.com/openai/codex.git
synced 2026-11-24 23:20:47 +00:00
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:
@@ -719,7 +719,6 @@ mod tests {
|
||||
SandboxType::WindowsRestrictedToken,
|
||||
vec![cwd],
|
||||
WindowsSandboxLevel::Disabled,
|
||||
/*windows_sandbox_private_desktop*/ false,
|
||||
PermissionProfile::read_only(),
|
||||
/*arg0*/ None,
|
||||
)
|
||||
@@ -837,7 +836,6 @@ mod tests {
|
||||
SandboxType::None,
|
||||
vec![cwd.clone()],
|
||||
WindowsSandboxLevel::Disabled,
|
||||
/*windows_sandbox_private_desktop*/ false,
|
||||
PermissionProfile::read_only(),
|
||||
/*arg0*/ None,
|
||||
),
|
||||
@@ -931,7 +929,6 @@ mod tests {
|
||||
SandboxType::None,
|
||||
vec![cwd],
|
||||
WindowsSandboxLevel::Disabled,
|
||||
/*windows_sandbox_private_desktop*/ false,
|
||||
PermissionProfile::read_only(),
|
||||
/*arg0*/ None,
|
||||
),
|
||||
|
||||
@@ -1696,7 +1696,7 @@ async fn read_materializes_default_allow_login_shell() {
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn write_value_allows_unmanaged_sibling_of_exact_requirement() {
|
||||
async fn write_value_allows_unmanaged_setting_with_exact_requirement() {
|
||||
let tmp = tempdir().expect("tempdir");
|
||||
let path = tmp.path().join(CONFIG_TOML_FILE);
|
||||
std::fs::write(&path, "").unwrap();
|
||||
@@ -1707,8 +1707,7 @@ async fn write_value_allows_unmanaged_sibling_of_exact_requirement() {
|
||||
LoaderOverrides::without_managed_config_for_tests(),
|
||||
CloudConfigBundleFixture::loader_with_enterprise_requirement(
|
||||
r#"
|
||||
[windows]
|
||||
sandbox_private_desktop = false
|
||||
allow_login_shell = false
|
||||
"#,
|
||||
),
|
||||
);
|
||||
@@ -1722,7 +1721,7 @@ sandbox_private_desktop = false
|
||||
expected_version: None,
|
||||
})
|
||||
.await
|
||||
.expect("unmanaged sibling should remain writable");
|
||||
.expect("unmanaged setting should remain writable");
|
||||
|
||||
assert!(
|
||||
std::fs::read_to_string(path)
|
||||
|
||||
@@ -299,10 +299,6 @@ impl CommandExecRequestProcessor {
|
||||
network_environment_id: None,
|
||||
sandbox_permissions: SandboxPermissions::UseDefault,
|
||||
windows_sandbox_level,
|
||||
windows_sandbox_private_desktop: self
|
||||
.config
|
||||
.permissions
|
||||
.windows_sandbox_private_desktop,
|
||||
justification: None,
|
||||
arg0: None,
|
||||
};
|
||||
|
||||
@@ -399,10 +399,6 @@ fn map_requirements_to_api(
|
||||
}
|
||||
None => ConfigRequirementsToml::default(),
|
||||
};
|
||||
let windows_sandbox_private_desktop = requirements
|
||||
.windows
|
||||
.as_ref()
|
||||
.and_then(|windows| windows.sandbox_private_desktop);
|
||||
|
||||
Some(ConfigRequirements {
|
||||
model_provider: requirements.model_provider,
|
||||
@@ -539,7 +535,6 @@ fn map_requirements_to_api(
|
||||
feedback: requirements.feedback.map(|feedback| FeedbackRequirements {
|
||||
enabled: feedback.enabled,
|
||||
}),
|
||||
windows_sandbox_private_desktop,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1105,7 +1100,6 @@ mod tests {
|
||||
codex_config::WindowsSandboxImplementationToml::Elevated,
|
||||
codex_config::WindowsSandboxImplementationToml::Unelevated,
|
||||
]),
|
||||
sandbox_private_desktop: Some(false),
|
||||
}),
|
||||
..ConfigRequirementsToml::default()
|
||||
});
|
||||
@@ -1117,7 +1111,6 @@ mod tests {
|
||||
WindowsSandboxImplementation::Unelevated,
|
||||
])
|
||||
);
|
||||
assert_eq!(mapped.windows_sandbox_private_desktop, Some(false));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user