Add hidden Windows sandbox wrapper entrypoint#28358
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 36421a9d53
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| cwd: request.command_cwd.as_path(), | ||
| env_map: request.env_map, | ||
| windows_sandbox_level: request.windows_sandbox_level, | ||
| timeout_ms: None, |
There was a problem hiding this comment.
Propagate timeouts to the sandboxed child
For direct-spawn callers that enforce a timeout/cancellation by supervising the wrapper process, the inner Windows sandbox session is launched with timeout_ms: None. If the parent kills only codex.exe --run-as-windows-sandbox, the elevated runner waits indefinitely and the sandboxed command can continue orphaned; pass the caller timeout/cancellation through the wrapper or terminate the session when the wrapper is torn down.
Useful? React with 👍 / 👎.
36421a9 to
a6155c2
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a6155c29ff
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
a6155c2 to
60d8329
Compare
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-execandcodex-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
codex.exe --run-as-windows-sandboxarg1 dispatch path.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.create_windows_sandbox_command_args_for_permission_profile()so later direct-spawn callers can build the wrapper argv consistently.proxy_enforcedthrough the shared Windows session request so proxy-managed executions continue to use the offline/elevated sandbox identity.Verification
just test -p codex-windows-sandbox windows_wrapper_args_round_tripjust test -p codex-arg0just test -p codex-core exec::tests::windows_just fix -p codex-windows-sandbox -p codex-core -p codex-cliLocal note: the full
just fmtcommand still fails on this workstation in non-Rust formatter setup (uvcache access denied and missingdotslash/buildifier), but the Rust formatter phase completed.