Skip to content

tests: use permission profiles in suite turn submits#20370

Open
bolinfest wants to merge 1 commit intopr20369from
pr20370
Open

tests: use permission profiles in suite turn submits#20370
bolinfest wants to merge 1 commit intopr20369from
pr20370

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Apr 30, 2026

Why

A couple of integration test helpers were still passing SandboxPolicy::DangerFullAccess for ordinary turn submission. These tests are not validating the legacy policy bridge; they just need the turn to run without sandbox restrictions. Using PermissionProfile directly keeps the tests aligned with the canonical permissions model and removes more incidental legacy usage.

What Changed

  • Updated the apply-patch CLI helper that constructs Op::UserTurn directly to populate both permission fields from PermissionProfile::Disabled via turn_permission_fields(...).
  • Updated the plugin hook test to call submit_turn_with_permission_profile(...) instead of submit_turn_with_policy(...).
  • Removed the SandboxPolicy import from core/tests/suite/apply_patch_cli.rs.

Verification

cargo test -p codex-core apply_patch_cli_move_without_content_change_has_no_turn_diff -- --nocapture
cargo test -p codex-core plugin_pre_tool_use_blocks_shell_command_before_execution -- --nocapture

Stack created with Sapling. Best reviewed with ReviewStack.

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

💡 Codex Review

let writable_entries = writable_roots
.iter()
.map(|root| writable_root_display(root.root.as_path(), cwd))
.collect::<Vec<_>>();
summary_with_network(
&format!("workspace-write [{}]", writable_entries.join(", ")),
network_enabled,
)

P1 Badge Preserve custom label for non-workdir writable policies

This branch classifies any managed profile with at least one writable root as workspace-write, but some valid managed policies grant writes outside the working directory (for example, write access only to /tmp or other explicit roots) and are not equivalent to workspace mode. Before this change those profiles were surfaced as custom permissions via the legacy-conversion fallback, while now they are mislabeled and downstream UI logic can collapse them to "Workspace", which understates the actual permission shape. Please gate the workspace-write label on workdir-write semantics rather than just writable_roots.is_empty().

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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