Skip to content

approval tests: configure scenarios with permission profiles#20407

Closed
bolinfest wants to merge 1 commit into
pr20406from
pr20407
Closed

approval tests: configure scenarios with permission profiles#20407
bolinfest wants to merge 1 commit into
pr20406from
pr20407

Conversation

@bolinfest

@bolinfest bolinfest commented Apr 30, 2026

Copy link
Copy Markdown
Collaborator

Why

The approvals integration matrix was still modeling each scenario with SandboxPolicy, then applying that legacy policy to config and turns. That made the tests less representative of the new permission-profile path and kept the largest non-boundary SandboxPolicy cluster alive in core/tests.

This PR keeps the same approval scenarios and expected behavior, but seeds them from PermissionProfile instead.

What Changed

  • ScenarioSpec now stores a PermissionProfile rather than a SandboxPolicy.
  • Scenario config uses config.permissions.set_permission_profile(...) instead of the legacy sandbox setter.
  • Turn submission derives the required legacy Op::UserTurn.sandbox_policy compatibility field from the profile via turn_permission_fields(...), while also sending the profile.
  • Standalone approval tests in core/tests/suite/approvals.rs now use PermissionProfile::Disabled, PermissionProfile::read_only(), or PermissionProfile::workspace_write_with(...) directly.
  • rg '\bSandboxPolicy\b' codex-rs/core/tests/suite/approvals.rs no longer matches anything.

Verification

cargo test -p codex-core --test all approvals --no-run

Stack created with Sapling. Best reviewed with ReviewStack.

@bolinfest bolinfest requested a review from a team as a code owner April 30, 2026 11:54
@bolinfest bolinfest changed the base branch from main to pr20406 April 30, 2026 11:54
This was referenced Apr 30, 2026
This was referenced Apr 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 14 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this May 15, 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