Compare commits

...

2 Commits

Author SHA1 Message Date
starr-openai
ffffb9fd68 Reuse guardian shell timeout budget 2026-05-19 21:04:58 -07:00
starr-openai
17ea010769 Stabilize guardian shell timeout test 2026-05-19 21:04:58 -07:00

View File

@@ -49,6 +49,8 @@ use tempfile::tempdir;
use tokio::time::timeout;
use tokio_util::sync::CancellationToken;
const QUICK_SHELL_TIMEOUT_MS: u64 = if cfg!(windows) { 2_500 } else { 1_000 };
fn expect_text_output<T>(output: &T) -> String
where
T: ToolOutput + ?Sized,
@@ -302,8 +304,6 @@ async fn guardian_allows_shell_command_additional_permissions_requests_past_poli
);
let session = Arc::new(session);
let turn_context = Arc::new(turn_context_raw);
let expiration_ms: u64 = if cfg!(windows) { 2_500 } else { 1_000 };
let handler = crate::tools::handlers::ShellCommandHandler::from(
codex_tools::ShellCommandBackendConfig::Classic,
);
@@ -323,7 +323,7 @@ async fn guardian_allows_shell_command_additional_permissions_requests_past_poli
"command": "echo hi",
"login": false,
"workdir": workdir,
"timeout_ms": expiration_ms,
"timeout_ms": QUICK_SHELL_TIMEOUT_MS,
"sandbox_permissions": SandboxPermissions::WithAdditionalPermissions,
"additional_permissions": PermissionProfile {
network: Some(NetworkPermissions {
@@ -406,7 +406,6 @@ async fn strict_auto_review_turn_grant_forces_guardian_for_shell_command_policy_
);
let session = Arc::new(session);
let turn_context = Arc::new(turn_context_raw);
let handler = crate::tools::handlers::ShellCommandHandler::from(
codex_tools::ShellCommandBackendConfig::Classic,
);
@@ -426,7 +425,7 @@ async fn strict_auto_review_turn_grant_forces_guardian_for_shell_command_policy_
"command": "echo hi",
"login": false,
"workdir": workdir,
"timeout_ms": 1_000_u64,
"timeout_ms": QUICK_SHELL_TIMEOUT_MS,
})
.to_string(),
},