Skip to content

session tests: configure runtime permissions directly#20396

Open
bolinfest wants to merge 1 commit intopr20394from
pr20396
Open

session tests: configure runtime permissions directly#20396
bolinfest wants to merge 1 commit intopr20394from
pr20396

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Apr 30, 2026

Why

Several session tests were still setting up runtime scenarios through SandboxPolicy, even though the behavior under test is now driven by PermissionProfile: managed network proxy exposure, permission-profile updates, and split filesystem policy persistence. That made the tests noisier and kept exercising legacy conversion paths unnecessarily.

What Changed

  • Configure session test fixtures with Permissions::set_permission_profile for PermissionProfile::Disabled and PermissionProfile::workspace_write().
  • Update the managed network proxy refresh test to switch turns with a permission_profile override instead of a legacy sandbox override.
  • Build session configuration filesystem policy fixtures directly from PermissionProfile/runtime filesystem policies.
  • Reuse TurnContext::file_system_sandbox_policy() when adding the unreadable glob used by turn-context serialization coverage.

The remaining SandboxPolicy references in session/tests.rs are left in tests that explicitly cover legacy projection or legacy rederivation behavior.

Verification

  • cargo test -p codex-core managed_network_proxy -- --nocapture
  • cargo test -p codex-core session_configuration_apply -- --nocapture
  • cargo test -p codex-core turn_context_item_stores_split_file_system_sandbox_policy_when_different -- --nocapture
  • just fix -p codex-core

Stack created with Sapling. Best reviewed with ReviewStack.

@bolinfest bolinfest requested a review from a team as a code owner April 30, 2026 10:47
@bolinfest bolinfest changed the base branch from main to pr20394 April 30, 2026 10:47
This was referenced Apr 30, 2026
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