Skip to content

sandbox: remove dead seatbelt helper and update tests#17859

Merged
bolinfest merged 1 commit into
mainfrom
pr17859
Apr 15, 2026
Merged

sandbox: remove dead seatbelt helper and update tests#17859
bolinfest merged 1 commit into
mainfrom
pr17859

Conversation

@bolinfest
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest commented Apr 15, 2026

Why

spawn_command_under_seatbelt() in codex-rs/core/src/seatbelt.rs had fallen out of production use and was only referenced by test-only wrappers. That left us with sandbox tests that could stay green even if the actual seatbelt exec path regressed, because production shell execution now flows through SandboxManager::transform() and ExecRequest::from_sandbox_exec_request() instead of that helper.

Removing the dead helper also exposed one downstream codex-exec integration test that still imported it, which broke just clippy.

What Changed

  • Removed codex-rs/core/src/seatbelt.rs and stopped exporting codex_core::seatbelt.
  • Removed the redundant codex-rs/core/tests/suite/seatbelt.rs coverage that only exercised the dead helper.
  • Kept the openpty regression check, but moved it into codex-rs/core/tests/suite/exec.rs so it now runs through process_exec_tool_call().
  • Fixed the seatbelt denial test in codex-rs/core/tests/suite/exec.rs to use /usr/bin/touch, so it actually exercises the sandbox instead of a nonexistent path.
  • Updated codex-rs/exec/tests/suite/sandbox.rs on macOS to build the sandboxed command through build_exec_request() and spawn the transformed command, instead of importing the removed helper.
  • Left the lower-level seatbelt policy coverage in codex-rs/sandboxing/src/seatbelt_tests.rs, where the policy generator is still covered directly.

Verification

  • cargo test -p codex-core suite::exec::
  • cargo test -p codex-exec
  • cargo clippy -p codex-exec --tests -- -D warnings
@bolinfest bolinfest changed the title core: remove dead seatbelt helper core: remove dead seatbelt helper and test the real exec path Apr 15, 2026
@bolinfest bolinfest force-pushed the pr17859 branch 2 times, most recently from b1c161a to ddb0b2d Compare April 15, 2026 00:48
@bolinfest bolinfest changed the title core: remove dead seatbelt helper and test the real exec path sandbox: remove dead seatbelt helper and update tests Apr 15, 2026
@bolinfest bolinfest marked this pull request as ready for review April 15, 2026 01:29
@bolinfest bolinfest merged commit d34bc66 into main Apr 15, 2026
48 of 50 checks passed
@bolinfest bolinfest deleted the pr17859 branch April 15, 2026 03:48
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants