mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Add hidden Windows sandbox wrapper entrypoint (#28358)
## Why This is the second PR in the Windows fs-helper sandbox stack. The fs-helper path needs a Windows sandbox launcher that has the same argv-shaped contract as macOS `sandbox-exec` and `codex-linux-sandbox`, but this PR only introduces that hidden launcher. It does not route fs-helper through it yet. The hidden launcher still needs to be policy-complete before later direct-spawn callers use it. In particular, it has to carry the same Windows sandbox policy details that the existing spawn paths already understand: proxy enforcement, read/write root overrides, and deny-read/deny-write overrides. ## What Changed - Added the hidden `codex.exe --run-as-windows-sandbox` arg1 dispatch path. - Added `windows-sandbox-rs/src/wrapper.rs`, which parses the wrapper argv, launches the requested command through the shared Windows sandbox session runner from PR1, and forwards stdio. - Added `create_windows_sandbox_command_args_for_permission_profile()` so later direct-spawn callers can build the wrapper argv consistently. - Made the wrapper argv round-trip the full Windows sandbox policy surface it needs later: workspace roots, environment, permission profile, sandbox level, private desktop, proxy enforcement, read/write root overrides, and deny-read/deny-write overrides. - Carried `proxy_enforced` through the shared Windows session request so proxy-managed executions continue to use the offline/elevated sandbox identity. - Added wrapper argument round-trip coverage for the full policy fields. ## Verification - `just test -p codex-windows-sandbox windows_wrapper_args_round_trip` - `just test -p codex-arg0` - `just test -p codex-core exec::tests::windows_` - `just fix -p codex-windows-sandbox -p codex-core -p codex-cli` Local note: the full `just fmt` command still fails on this workstation in non-Rust formatter setup (`uv` cache access denied and missing `dotslash`/buildifier), but the Rust formatter phase completed.
This commit is contained in:
1 parent
e7a9988d1a
commit
fbbe7706d6
11 files changed
+491
-39
No files matched your search
@@ -109,6 +109,8 @@ mod stdio_bridge;
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
mod unified_exec;
|
||||
#[cfg(target_os = "windows")]
|
||||
mod wrapper;
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
pub(crate) use elevated::ipc_framed;
|
||||
@@ -318,6 +320,12 @@ pub use winutil::string_from_sid_bytes;
|
||||
pub use winutil::to_wide;
|
||||
#[cfg(target_os = "windows")]
|
||||
pub use workspace_acl::is_command_cwd_root;
|
||||
#[cfg(target_os = "windows")]
|
||||
pub use wrapper::CODEX_WINDOWS_SANDBOX_ARG1;
|
||||
#[cfg(target_os = "windows")]
|
||||
pub use wrapper::create_windows_sandbox_command_args_for_permission_profile;
|
||||
#[cfg(target_os = "windows")]
|
||||
pub use wrapper::run_windows_sandbox_wrapper_main;
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
pub use stub::CaptureResult;
|
||||
|
||||
Reference in new issue
Block a user