Centralize exec-server launches in WrappedSandboxCommand (#61942)

## What changed

- Move process spawning and Windows token session preparation into `codex-sandboxing`. Keep filesystem overrides, proxy enforcement, and the restricting SID with the prepared command, and reject conversion to a plain command request when a Windows session launcher is required.
- Route shell snapshot capture and replay through the prepared command. Limit script replacement to the submitted shell invocation while preserving its sandbox, environment, and proxy.
- Pass borrowed launch facts to sandbox integrity checks, and distinguish explicitly supplied runtime readable paths from automatic proxy CA bundle discovery.

## Testing

Extend coverage for Windows TEMP permissions and managed proxy routing with empty workspace roots, native launch and prewarm input validation, and proxy availability after the process leader exits while a descendant holds stdout open.

GitOrigin-RevId: fe2bdb9e44f4fb273295fbde66b44bf01f0b7fbc
This commit is contained in:
viyatb-oai
2026-11-17 02:02:21 +00:00
committed by copyberry
parent 1d97869412
commit c656014177
30 changed files with 756 additions and 475 deletions
+1 -1
View File
@@ -436,7 +436,7 @@ async fn run_command_under_sandbox(
},
permissions: &permission_profile,
workspace_roots: workspace_roots.as_deref(),
runtime_readable_paths: &[],
runtime_readable_paths: None,
selection: SandboxSelection::Explicit(sandbox),
enforce_managed_network: network.is_some(),
network: network.as_ref(),