Fix remote exec env overlay CI failures

This commit is contained in:
pakrym-oai
2026-04-10 18:40:11 -07:00
parent 863d7ba1e0
commit 05f23aebae
2 changed files with 16 additions and 14 deletions

View File

@@ -655,7 +655,13 @@ impl UnifiedExecProcessManager {
environment: &codex_exec_server::Environment,
) -> Result<UnifiedExecProcess, UnifiedExecError> {
let inherited_fds = spawn_lifecycle.inherited_fds();
if inherited_fds.is_empty() {
if environment.is_remote() {
if !inherited_fds.is_empty() {
return Err(UnifiedExecError::create_process(
"remote exec-server does not support inherited file descriptors".to_string(),
));
}
let started = environment
.get_exec_backend()
.start(exec_server_params_for_request(process_id, request, tty))
@@ -665,12 +671,6 @@ impl UnifiedExecProcessManager {
return UnifiedExecProcess::from_exec_server_started(started, request.sandbox).await;
}
if environment.is_remote() {
return Err(UnifiedExecError::create_process(
"remote exec-server does not support inherited file descriptors".to_string(),
));
}
let (program, args) = request
.command
.split_first()

View File

@@ -695,12 +695,14 @@ mod tests {
include_only: Vec::new(),
});
assert_eq!(
child_env(&params),
HashMap::from([
("OVERLAY".to_string(), "overlay".to_string()),
("POLICY_SET".to_string(), "overlay-wins".to_string()),
])
);
let mut expected = HashMap::from([
("OVERLAY".to_string(), "overlay".to_string()),
("POLICY_SET".to_string(), "overlay-wins".to_string()),
]);
if cfg!(target_os = "windows") {
expected.insert("PATHEXT".to_string(), ".COM;.EXE;.BAT;.CMD".to_string());
}
assert_eq!(child_env(&params), expected);
}
}