Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions codex-rs/app-server/src/codex_message_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ use codex_core::exec::ExecParams;
use codex_core::exec_env::create_env;
use codex_core::features::Feature;
use codex_core::find_conversation_path_by_id_str;
use codex_core::get_platform_sandbox;
use codex_core::git_info::git_diff_to_remote;
use codex_core::parse_cursor;
use codex_core::protocol::EventMsg;
Expand Down Expand Up @@ -1182,13 +1181,6 @@ impl CodexMessageProcessor {
.sandbox_policy
.unwrap_or_else(|| self.config.sandbox_policy.clone());

let sandbox_type = match &effective_policy {
codex_core::protocol::SandboxPolicy::DangerFullAccess => {
codex_core::exec::SandboxType::None
}
_ => get_platform_sandbox().unwrap_or(codex_core::exec::SandboxType::None),
};
tracing::debug!("Sandbox type: {sandbox_type:?}");
let codex_linux_sandbox_exe = self.config.codex_linux_sandbox_exe.clone();
let outgoing = self.outgoing.clone();
let req_id = request_id;
Expand All @@ -1197,7 +1189,6 @@ impl CodexMessageProcessor {
tokio::spawn(async move {
match codex_core::exec::process_exec_tool_call(
exec_params,
sandbox_type,
&effective_policy,
sandbox_cwd.as_path(),
&codex_linux_sandbox_exe,
Expand Down
9 changes: 7 additions & 2 deletions codex-rs/core/src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use tokio_util::sync::CancellationToken;
use crate::error::CodexErr;
use crate::error::Result;
use crate::error::SandboxErr;
use crate::get_platform_sandbox;
use crate::protocol::Event;
use crate::protocol::EventMsg;
use crate::protocol::ExecCommandOutputDeltaEvent;
Expand Down Expand Up @@ -127,12 +128,17 @@ pub struct StdoutStream {

pub async fn process_exec_tool_call(
params: ExecParams,
sandbox_type: SandboxType,
sandbox_policy: &SandboxPolicy,
sandbox_cwd: &Path,
codex_linux_sandbox_exe: &Option<PathBuf>,
stdout_stream: Option<StdoutStream>,
) -> Result<ExecToolCallOutput> {
let sandbox_type = match &sandbox_policy {
SandboxPolicy::DangerFullAccess => SandboxType::None,
_ => get_platform_sandbox().unwrap_or(SandboxType::None),
};
tracing::debug!("Sandbox type: {sandbox_type:?}");

let ExecParams {
command,
cwd,
Expand Down Expand Up @@ -893,7 +899,6 @@ mod tests {
});
let result = process_exec_tool_call(
params,
SandboxType::None,
&SandboxPolicy::DangerFullAccess,
cwd.as_path(),
&None,
Expand Down
2 changes: 1 addition & 1 deletion codex-rs/core/tests/suite/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async fn run_test_cmd(tmp: TempDir, cmd: Vec<&str>) -> Result<ExecToolCallOutput

let policy = SandboxPolicy::new_read_only_policy();

process_exec_tool_call(params, sandbox_type, &policy, tmp.path(), &None, None).await
process_exec_tool_call(params, &policy, tmp.path(), &None, None).await
}

/// Command succeeds with exit code 0 normally
Expand Down
3 changes: 0 additions & 3 deletions codex-rs/exec-server/src/posix/escalate_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ use std::time::Duration;
use anyhow::Context as _;
use path_absolutize::Absolutize as _;

use codex_core::exec::SandboxType;
use codex_core::exec::process_exec_tool_call;
use codex_core::get_platform_sandbox;
use codex_core::protocol::SandboxPolicy;
use tokio::process::Command;
use tokio_util::sync::CancellationToken;
Expand Down Expand Up @@ -96,7 +94,6 @@ impl EscalateServer {
justification: None,
arg0: None,
},
get_platform_sandbox().unwrap_or(SandboxType::None),
&sandbox_policy,
&sandbox_cwd,
&None,
Expand Down
3 changes: 0 additions & 3 deletions codex-rs/linux-sandbox/tests/suite/landlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use codex_core::config::types::ShellEnvironmentPolicy;
use codex_core::error::CodexErr;
use codex_core::error::SandboxErr;
use codex_core::exec::ExecParams;
use codex_core::exec::SandboxType;
use codex_core::exec::process_exec_tool_call;
use codex_core::exec_env::create_env;
use codex_core::protocol::SandboxPolicy;
Expand Down Expand Up @@ -60,7 +59,6 @@ async fn run_cmd(cmd: &[&str], writable_roots: &[PathBuf], timeout_ms: u64) {
let codex_linux_sandbox_exe = Some(PathBuf::from(sandbox_program));
let res = process_exec_tool_call(
params,
SandboxType::LinuxSeccomp,
&sandbox_policy,
sandbox_cwd.as_path(),
&codex_linux_sandbox_exe,
Expand Down Expand Up @@ -155,7 +153,6 @@ async fn assert_network_blocked(cmd: &[&str]) {
let codex_linux_sandbox_exe: Option<PathBuf> = Some(PathBuf::from(sandbox_program));
let result = process_exec_tool_call(
params,
SandboxType::LinuxSeccomp,
&sandbox_policy,
sandbox_cwd.as_path(),
&codex_linux_sandbox_exe,
Expand Down
Loading