Skip to content

tests: use permission profiles in unified exec suite#20376

Open
bolinfest wants to merge 1 commit intopr20375from
pr20376
Open

tests: use permission profiles in unified exec suite#20376
bolinfest wants to merge 1 commit intopr20375from
pr20376

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Apr 30, 2026

Why

This stack is migrating runtime/test code away from constructing SandboxPolicy directly. The unified exec suite still used legacy policies for turn setup, which meant the tests were exercising the compatibility field as the source of truth rather than the canonical PermissionProfile that the runtime now carries.

What Changed

  • Updated the unified exec turn helper to accept a PermissionProfile and derive the legacy compatibility sandbox_policy with turn_permission_fields().
  • Replaced direct disabled/read-only turn setup with PermissionProfile::Disabled and PermissionProfile::read_only().
  • Replaced the network-denial setup that created a legacy workspace-write policy just to enable network with a direct PermissionProfile::workspace_write_with(..., NetworkSandboxPolicy::Enabled, ...).
  • Kept the glob deny-read test profile-backed by reusing the configured SessionConfiguredEvent.permission_profile for the turn instead of rebuilding a legacy read-only policy.
  • Leaves rg '\bSandboxPolicy\b' codex-rs/core/tests/suite/unified_exec.rs with zero matches.

Verification

cargo test -p codex-core unified_exec_emits_exec_command_begin_event -- --nocapture
cargo test -p codex-core unified_exec_network_denial -- --nocapture
cargo test -p codex-core unified_exec_enforces_glob_deny_read_policy -- --nocapture

Stack created with Sapling. Best reviewed with ReviewStack.

This was referenced Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant