mirror of
https://github.com/openai/codex.git
synced 2026-05-25 13:34:51 +00:00
codex: candidate A minimal unified exec startup fix
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -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())),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user