codex: candidate A minimal unified exec startup fix

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
starr-openai
2026-05-12 15:51:02 -07:00
parent d19daff01d
commit e0554f5167
2 changed files with 7 additions and 8 deletions

View File

@@ -280,7 +280,7 @@ impl<'a> ToolRuntime<UnifiedExecRequest, UnifiedExecProcess> for UnifiedExecRunt
if let UnifiedExecShellMode::ZshFork(zsh_fork_config) = &self.shell_mode {
let command =
build_sandbox_command(&command, &req.cwd, &env, req.additional_permissions.clone())
.map_err(|_| ToolError::Rejected("missing command line for PTY".to_string()))?;
.map_err(|_| ToolError::Codex(CodexErr::InvalidRequest("missing command line for PTY".into())))?;
let options = unified_exec_options(attempt.network_denial_cancellation_token.clone());
let mut exec_env = attempt
.env_for(command, options, managed_network)
@@ -319,7 +319,7 @@ impl<'a> ToolRuntime<UnifiedExecRequest, UnifiedExecProcess> for UnifiedExecRunt
network_policy_decision: None,
}))
}
other => ToolError::Rejected(other.to_string()),
other => ToolError::Codex(CodexErr::Fatal(other.to_string())),
});
}
None => {
@@ -331,7 +331,7 @@ impl<'a> ToolRuntime<UnifiedExecRequest, UnifiedExecProcess> for UnifiedExecRunt
}
let command =
build_sandbox_command(&command, &req.cwd, &env, req.additional_permissions.clone())
.map_err(|_| ToolError::Rejected("missing command line for PTY".to_string()))?;
.map_err(|_| ToolError::Codex(CodexErr::InvalidRequest("missing command line for PTY".into())))?;
let options = unified_exec_options(attempt.network_denial_cancellation_token.clone());
let mut exec_env = attempt
.env_for(command, options, managed_network)
@@ -353,7 +353,7 @@ impl<'a> ToolRuntime<UnifiedExecRequest, UnifiedExecProcess> for UnifiedExecRunt
network_policy_decision: None,
}))
}
other => ToolError::Rejected(other.to_string()),
other => ToolError::Codex(CodexErr::Fatal(other.to_string())),
})
}
}

View File

@@ -398,14 +398,13 @@ impl UnifiedExecProcessManager {
}
Err(err) => {
let failure = match &err {
UnifiedExecError::MissingCommandLine => ToolEventFailure::Rejected {
message: "missing command line for unified exec request".to_string(),
applied_patch_delta: None,
},
UnifiedExecError::Rejected { message } => ToolEventFailure::Rejected {
message: message.clone(),
applied_patch_delta: None,
},
UnifiedExecError::SandboxDenied { output, .. } => {
ToolEventFailure::Output(output.clone())
}
_ => ToolEventFailure::Message(format!("execution error: {err:?}")),
};
emitter