Skip to content

test: construct permission profiles directly#23030

Merged
bolinfest merged 1 commit into
mainfrom
pr23030
May 16, 2026
Merged

test: construct permission profiles directly#23030
bolinfest merged 1 commit into
mainfrom
pr23030

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented May 16, 2026

Why

SandboxPolicy is now a legacy compatibility shape, but several tests still built a SandboxPolicy only to immediately convert it into PermissionProfile for APIs that already accept canonical runtime permissions. Those detours make it harder to audit where legacy sandbox policy is still required, because boundary-only usages are mixed together with ordinary test setup.

What Changed

  • Updated tests in codex-core, codex-exec, codex-analytics, and codex-config to construct PermissionProfile values directly when the code under test takes a permission profile.
  • Changed exec-policy, request-permissions, session, and sandbox test helpers to pass PermissionProfile through instead of converting from SandboxPolicy internally.
  • Left SandboxPolicy in place where tests are explicitly exercising legacy compatibility or request/response boundaries.

Test Plan

  • cargo test -p codex-analytics -p codex-config
  • cargo test -p codex-core --lib safety::tests
  • cargo test -p codex-core --lib exec_policy::tests::
  • cargo test -p codex-core --lib exec::tests
  • cargo test -p codex-core --lib guardian_review_session_config
  • cargo test -p codex-core --lib tools::network_approval::tests
  • cargo test -p codex-core --lib tools::runtimes::shell::unix_escalation::tests
  • cargo test -p codex-core --lib managed_network
  • cargo test -p codex-core --test all request_permissions::
  • cargo test -p codex-exec sandbox

Stack created with Sapling. Best reviewed with ReviewStack.

Comment thread codex-rs/core/src/safety_tests.rs Outdated
@bolinfest bolinfest merged commit d91bc15 into main May 16, 2026
47 of 62 checks passed
@bolinfest bolinfest deleted the pr23030 branch May 16, 2026 19:12
@github-actions github-actions Bot locked and limited conversation to collaborators May 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants