fix: forgot to pass codex_linux_sandbox_exe through in cli/src/debug_sandbox.rs (#1095)

I accidentally missed this in https://github.com/openai/codex/pull/1086.
This commit is contained in:
Michael Bolin
2025-05-23 11:53:13 -07:00
committed by GitHub
parent 89ef4efdcf
commit 4bf81373a7
2 changed files with 34 additions and 6 deletions

View File

@@ -13,22 +13,42 @@ use crate::LandlockCommand;
use crate::SeatbeltCommand;
use crate::exit_status::handle_exit_status;
pub async fn run_command_under_seatbelt(command: SeatbeltCommand) -> anyhow::Result<()> {
pub async fn run_command_under_seatbelt(
command: SeatbeltCommand,
codex_linux_sandbox_exe: Option<PathBuf>,
) -> anyhow::Result<()> {
let SeatbeltCommand {
full_auto,
sandbox,
command,
} = command;
run_command_under_sandbox(full_auto, sandbox, command, None, SandboxType::Seatbelt).await
run_command_under_sandbox(
full_auto,
sandbox,
command,
codex_linux_sandbox_exe,
SandboxType::Seatbelt,
)
.await
}
pub async fn run_command_under_landlock(command: LandlockCommand) -> anyhow::Result<()> {
pub async fn run_command_under_landlock(
command: LandlockCommand,
codex_linux_sandbox_exe: Option<PathBuf>,
) -> anyhow::Result<()> {
let LandlockCommand {
full_auto,
sandbox,
command,
} = command;
run_command_under_sandbox(full_auto, sandbox, command, None, SandboxType::Landlock).await
run_command_under_sandbox(
full_auto,
sandbox,
command,
codex_linux_sandbox_exe,
SandboxType::Landlock,
)
.await
}
enum SandboxType {

View File

@@ -86,10 +86,18 @@ async fn cli_main(codex_linux_sandbox_exe: Option<PathBuf>) -> anyhow::Result<()
}
Some(Subcommand::Debug(debug_args)) => match debug_args.cmd {
DebugCommand::Seatbelt(seatbelt_command) => {
codex_cli::debug_sandbox::run_command_under_seatbelt(seatbelt_command).await?;
codex_cli::debug_sandbox::run_command_under_seatbelt(
seatbelt_command,
codex_linux_sandbox_exe,
)
.await?;
}
DebugCommand::Landlock(landlock_command) => {
codex_cli::debug_sandbox::run_command_under_landlock(landlock_command).await?;
codex_cli::debug_sandbox::run_command_under_landlock(
landlock_command,
codex_linux_sandbox_exe,
)
.await?;
}
},
}