openai/codex · error

prepared escalated command must not be empty

Error message

prepared escalated command must not be empty

What it means

Validation guard after prepare_escalated_exec: the prepared command vector is empty, so there is nothing to exec and the escalation session would be meaningless.

Solutions

  1. Fix the command executor to always produce a non-empty argv
  2. Reject the escalation request earlier when the command is empty
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at codex-rs/shell-escalation/src/unix/escalate_server.rs:334 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of openai/codex@339751715c (2026-08-25). Data as JSON: /api/errors/69dea7db804a7f60. Report an issue: GitHub.

Appendix: source

Thrown at codex-rs/shell-escalation/src/unix/escalate_server.rs:334

                    "mismatched number of fds in SuperExecMessage: {} in the message, {} from the control message",
                    msg.fds.len(),
                    fds.len()
                ));
            }

            let PreparedExec {
                command,
                cwd,
                env,
                arg0,
            } = tokio::select! {
                prepared = command_executor.prepare_escalated_exec(&program, &argv, &workdir, env, execution) => prepared?,
                _ = parent_cancellation_token.cancelled() => return Ok(()),
                _ = session_cancellation_token.cancelled() => return Ok(()),
            };
            let (program, args) = command
                .split_first()
                .ok_or_else(|| anyhow::anyhow!("prepared escalated command must not be empty"))?;
            let mut command = Command::new(program);
            command
                .args(args)
                .arg0(arg0.unwrap_or_else(|| program.clone()))
                .envs(&env)
                .current_dir(&cwd)
                .stdin(Stdio::null())
                .stdout(Stdio::null())
                .stderr(Stdio::null())
                .kill_on_drop(true);
            scrub_non_inheritable_env_vars(command.as_std_mut());
            unsafe {
                command.pre_exec(move || {
                    for (dst_fd, src_fd) in msg.fds.iter().zip(&fds) {
                        libc::dup2(src_fd.as_raw_fd(), *dst_fd);
                    }
                    Ok(())
                });

View on GitHub (pinned to 339751715c)