Separate Windows sandbox implementations from legacy setup modes (#45737)

## Why

`allowedWindowsSandboxImplementations` uses the legacy setup-mode type, which cannot represent `mxc`.

## What changed

- Introduce `WindowsSandboxImplementation` with `elevated`, `unelevated`, and `mxc` variants for configuration requirements, and update the generated schemas and TypeScript and Python types.
- Keep `WindowsSandboxSetupMode` limited to `elevated` and `unelevated`, and update the requirements mapping and its test assertions to use the new type.
- Document that clients selecting `mxc` skip the legacy setup and readiness APIs and use the standard `command/exec` streaming and process-control path.

GitOrigin-RevId: c926e853f0bbdb29d4b437866c284c1394a7ea13
This commit is contained in:
iceweasel-oai authored and copyberry committed 2026-09-15 17:17:07 +00:00
1 parent eeded5ba1a
commit fbad00774b
13 files changed
+68 -16

No files matched your search

@@ -41,7 +41,7 @@ use codex_app_server_protocol::NetworkRequirements;
use codex_app_server_protocol::NetworkUnixSocketPermission;
use codex_app_server_protocol::NewThreadModelDefaults;
use codex_app_server_protocol::SandboxMode;
use codex_app_server_protocol::WindowsSandboxSetupMode;
use codex_app_server_protocol::WindowsSandboxImplementation;
use codex_config::ConfigRequirementsToml;
use codex_config::HookEventsToml;
use codex_config::HookHandlerConfig as CoreHookHandlerConfig;
@@ -470,10 +470,10 @@ fn map_requirements_to_api(
.into_iter()
.map(|implementation| match implementation {
codex_config::types::WindowsSandboxModeToml::Elevated => {
WindowsSandboxSetupMode::Elevated
WindowsSandboxImplementation::Elevated
}
codex_config::types::WindowsSandboxModeToml::Unelevated => {
WindowsSandboxSetupMode::Unelevated
WindowsSandboxImplementation::Unelevated
}
})
.collect()
@@ -854,7 +854,7 @@ mod tests {
use codex_app_server_protocol::ComputerUseWindowsExeRequirement;
use codex_app_server_protocol::ComputerUseWindowsRequirements;
use codex_app_server_protocol::FeedbackRequirements;
use codex_app_server_protocol::WindowsSandboxSetupMode;
use codex_app_server_protocol::WindowsSandboxImplementation;
use codex_config::AllowDenyRequirementToml;
use codex_config::AutoReviewRequirementsToml;
use codex_config::BrowserUseAccessApprovalLifetimeToml;
@@ -1110,8 +1110,8 @@ mod tests {
assert_eq!(
mapped.allowed_windows_sandbox_implementations,
Some(vec![
WindowsSandboxSetupMode::Elevated,
WindowsSandboxSetupMode::Unelevated,
WindowsSandboxImplementation::Elevated,
WindowsSandboxImplementation::Unelevated,
])
);
assert_eq!(mapped.windows_sandbox_private_desktop, Some(false));