Fix non-Windows direct-spawn clippy

This commit is contained in:
David Wiesen
2026-06-15 09:35:55 -07:00
parent 82a5089f26
commit c11e2f3d1d
2 changed files with 8 additions and 5 deletions
+6 -4
View File
@@ -362,11 +362,13 @@ impl SandboxManager {
&self,
request: SandboxDirectSpawnTransformRequest<'_>,
) -> Result<SandboxExecRequest, SandboxTransformError> {
let SandboxDirectSpawnTransformRequest {
transform,
workspace_roots,
} = request;
let transform = request.transform;
#[cfg(target_os = "windows")]
let workspace_roots = request.workspace_roots;
#[cfg(target_os = "windows")]
let mut request = self.transform(transform)?;
#[cfg(not(target_os = "windows"))]
let request = self.transform(transform)?;
#[cfg(target_os = "windows")]
if request.sandbox == SandboxType::WindowsRestrictedToken {
wrap_windows_sandbox_exec_request_for_direct_spawn(&mut request, workspace_roots)?;
+2 -1
View File
@@ -1,4 +1,5 @@
use super::SandboxCommand;
#[cfg(target_os = "windows")]
use super::SandboxDirectSpawnTransformRequest;
use super::SandboxManager;
use super::SandboxTransformRequest;
@@ -488,7 +489,7 @@ fn transform_for_direct_spawn_windows_materializes_inner_helper() {
let configured_helper = helper_dir.path().join("configured-codex-helper.exe");
std::fs::write(&configured_helper, b"helper").expect("write configured helper");
let cwd = AbsolutePathBuf::from_absolute_path(helper_dir.path()).expect("absolute cwd");
let cwd_uri = PathUri::from_abs_path(&cwd).expect("cwd URI");
let cwd_uri = PathUri::from_abs_path(&cwd);
let other_workspace = tempfile::TempDir::new().expect("other workspace");
let other_workspace_root = AbsolutePathBuf::from_absolute_path(other_workspace.path())
.expect("absolute other workspace");