core tests: migrate more turns to permission profiles (#20013)

## Summary
- Migrate another batch of direct `Op::UserTurn` test construction from
legacy `SandboxPolicy` values to `PermissionProfile` inputs via
`turn_permission_fields()`.
- Replace a one-off read-only `SandboxPolicy` bridge in the macOS exec
test with `PermissionProfile::read_only()`.
- Reduce `SandboxPolicy` references in `codex-rs/core/tests` from 32
files at the start of the cleanup stack to 27 files.

## Testing
- `cargo check -p codex-core --tests`
- `just fmt`
- `just fix -p codex-core`
This commit is contained in:
Michael Bolin
2026-04-28 17:05:53 -07:00
committed by GitHub
parent 7d15936e69
commit 52e79ee49a
5 changed files with 67 additions and 38 deletions

View File

@@ -9,7 +9,6 @@ use codex_protocol::config_types::WindowsSandboxLevel;
use codex_protocol::error::Result;
use codex_protocol::exec_output::ExecToolCallOutput;
use codex_protocol::models::PermissionProfile;
use codex_protocol::protocol::SandboxPolicy;
use codex_sandboxing::SandboxType;
use codex_sandboxing::get_platform_sandbox;
use core_test_support::PathExt;
@@ -50,12 +49,9 @@ where
arg0: None,
};
let policy = SandboxPolicy::new_read_only_policy();
let permission_profile = PermissionProfile::from_legacy_sandbox_policy(&policy);
process_exec_tool_call(
params,
&permission_profile,
&PermissionProfile::read_only(),
&cwd,
&None,
/*use_legacy_landlock*/ false,