Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Avoid sandbox helper in apply_patch approval tests (#28915)

jif56703600091d
diff --git a/codex-rs/core/tests/suite/approvals.rs b/codex-rs/core/tests/suite/approvals.rs
index 422fd28260..f26b8e4b85 100644
--- a/codex-rs/core/tests/suite/approvals.rs
+++ b/codex-rs/core/tests/suite/approvals.rs
@@ -1380,7 +1380,7 @@ fn scenarios() -> Vec<ScenarioSpec> {
ScenarioSpec {
name: "apply_patch_shell_command_requires_patch_approval",
approval_policy: UnlessTrusted,
- sandbox_policy: workspace_write(false),
+ sandbox_policy: SandboxPolicy::DangerFullAccess,
action: ActionKind::ApplyPatchShell {
target: TargetPath::Workspace("apply_patch_shell.txt"),
content: "shell-apply-patch",
@@ -1494,7 +1494,7 @@ fn scenarios() -> Vec<ScenarioSpec> {
ScenarioSpec {
name: "apply_patch_freeform_unless_trusted_requires_patch_approval",
approval_policy: UnlessTrusted,
- sandbox_policy: workspace_write(false),
+ sandbox_policy: SandboxPolicy::DangerFullAccess,
action: ActionKind::ApplyPatchFreeform {
target: TargetPath::Workspace("apply_patch_freeform_unless_trusted.txt"),
content: "freeform-patch-unless-trusted",
@@ -2060,13 +2060,8 @@ async fn approving_apply_patch_for_session_skips_future_prompts_for_same_file()
skip_if_no_network!(Ok(()));
let server = start_mock_server().await;
- let approval_policy = AskForApproval::OnRequest;
- let sandbox_policy = SandboxPolicy::WorkspaceWrite {
- writable_roots: vec![],
- network_access: false,
- exclude_tmpdir_env_var: true,
- exclude_slash_tmp: true,
- };
+ let approval_policy = AskForApproval::UnlessTrusted;
+ let sandbox_policy = SandboxPolicy::DangerFullAccess;
let sandbox_policy_for_config = sandbox_policy.clone();
let mut builder = test_codex()