This commit is contained in:
Ahmed Ibrahim
2026-01-11 15:55:19 -08:00
parent c9abdd043b
commit 282696e625
3 changed files with 9 additions and 2 deletions

1
codex-rs/Cargo.lock generated
View File

@@ -1523,6 +1523,7 @@ dependencies = [
"seccompiler",
"tempfile",
"tokio",
"tokio-util",
]
[[package]]

View File

@@ -32,3 +32,4 @@ tokio = { workspace = true, features = [
"rt-multi-thread",
"signal",
] }
tokio-util = { workspace = true }

View File

@@ -2,6 +2,7 @@
use codex_core::config::types::ShellEnvironmentPolicy;
use codex_core::error::CodexErr;
use codex_core::error::SandboxErr;
use codex_core::exec::ExecExpiration;
use codex_core::exec::ExecParams;
use codex_core::exec::process_exec_tool_call;
use codex_core::exec_env::create_env;
@@ -11,6 +12,7 @@ use codex_utils_absolute_path::AbsolutePathBuf;
use std::collections::HashMap;
use std::path::PathBuf;
use tempfile::NamedTempFile;
use tokio_util::sync::CancellationToken;
// At least on GitHub CI, the arm64 tests appear to need longer timeouts.
@@ -41,7 +43,7 @@ async fn run_cmd(cmd: &[&str], writable_roots: &[PathBuf], timeout_ms: u64) {
let params = ExecParams {
command: cmd.iter().copied().map(str::to_owned).collect(),
cwd,
expiration: timeout_ms.into(),
expiration: ExecExpiration::from_timeout_ms(Some(timeout_ms), CancellationToken::new()),
env: create_env_from_core_vars(),
sandbox_permissions: SandboxPermissions::UseDefault,
justification: None,
@@ -146,7 +148,10 @@ async fn assert_network_blocked(cmd: &[&str]) {
cwd,
// Give the tool a generous 2-second timeout so even slow DNS timeouts
// do not stall the suite.
expiration: NETWORK_TIMEOUT_MS.into(),
expiration: ExecExpiration::from_timeout_ms(
Some(NETWORK_TIMEOUT_MS),
CancellationToken::new(),
),
env: create_env_from_core_vars(),
sandbox_permissions: SandboxPermissions::UseDefault,
justification: None,