[codex] ez - rename env=>request in codex-rs/core/src/unified_exec/process_manager.rs (#16724)

# External (non-OpenAI) Pull Request Requirements

Before opening this Pull Request, please read the dedicated
"Contributing" markdown file or your PR may be closed:
https://github.com/openai/codex/blob/main/docs/contributing.md

If your PR conforms to our contribution guidelines, replace this text
with a detailed and high quality description of your changes.

Include a link to a bug report or enhancement request.
This commit is contained in:
starr-openai authored and GitHub committed 2026-04-07 10:17:31 +01:00
1 parent 90320fc51a
commit 741e2fdeb8
1 file changed
+14 -14
@@ -582,12 +582,12 @@ impl UnifiedExecProcessManager {
pub(crate) async fn open_session_with_exec_env( pub(crate) async fn open_session_with_exec_env(
&self, &self,
process_id: i32, process_id: i32,
env: &ExecRequest, request: &ExecRequest,
tty: bool, tty: bool,
mut spawn_lifecycle: SpawnLifecycleHandle, mut spawn_lifecycle: SpawnLifecycleHandle,
environment: &codex_exec_server::Environment, environment: &codex_exec_server::Environment,
) -> Result<UnifiedExecProcess, UnifiedExecError> { ) -> Result<UnifiedExecProcess, UnifiedExecError> {
let (program, args) = env let (program, args) = request
.command .command
.split_first() .split_first()
.ok_or(UnifiedExecError::MissingCommandLine)?; .ok_or(UnifiedExecError::MissingCommandLine)?;
@@ -604,24 +604,24 @@ impl UnifiedExecProcessManager {
.get_exec_backend() .get_exec_backend()
.start(codex_exec_server::ExecParams { .start(codex_exec_server::ExecParams {
process_id: exec_server_process_id(process_id).into(), process_id: exec_server_process_id(process_id).into(),
argv: env.command.clone(), argv: request.command.clone(),
cwd: env.cwd.clone(), cwd: request.cwd.clone(),
env: env.env.clone(), env: request.env.clone(),
tty, tty,
arg0: env.arg0.clone(), arg0: request.arg0.clone(),
}) })
.await .await
.map_err(|err| UnifiedExecError::create_process(err.to_string()))?; .map_err(|err| UnifiedExecError::create_process(err.to_string()))?;
return UnifiedExecProcess::from_remote_started(started, env.sandbox).await; return UnifiedExecProcess::from_remote_started(started, request.sandbox).await;
} }
let spawn_result = if tty { let spawn_result = if tty {
codex_utils_pty::pty::spawn_process_with_inherited_fds( codex_utils_pty::pty::spawn_process_with_inherited_fds(
program, program,
args, args,
env.cwd.as_path(), request.cwd.as_path(),
&env.env, &request.env,
&env.arg0, &request.arg0,
codex_utils_pty::TerminalSize::default(), codex_utils_pty::TerminalSize::default(),
&inherited_fds, &inherited_fds,
) )
@@ -630,9 +630,9 @@ impl UnifiedExecProcessManager {
codex_utils_pty::pipe::spawn_process_no_stdin_with_inherited_fds( codex_utils_pty::pipe::spawn_process_no_stdin_with_inherited_fds(
program, program,
args, args,
env.cwd.as_path(), request.cwd.as_path(),
&env.env, &request.env,
&env.arg0, &request.arg0,
&inherited_fds, &inherited_fds,
) )
.await .await
@@ -640,7 +640,7 @@ impl UnifiedExecProcessManager {
let spawned = let spawned =
spawn_result.map_err(|err| UnifiedExecError::create_process(err.to_string()))?; spawn_result.map_err(|err| UnifiedExecError::create_process(err.to_string()))?;
spawn_lifecycle.after_spawn(); spawn_lifecycle.after_spawn();
UnifiedExecProcess::from_spawned(spawned, env.sandbox, spawn_lifecycle).await UnifiedExecProcess::from_spawned(spawned, request.sandbox, spawn_lifecycle).await
} }
pub(super) async fn open_session_with_sandbox( pub(super) async fn open_session_with_sandbox(