Migrate inherit sandbox state to per-tool-call metadata#42
Merged
t-kalinowski merged 5 commits intomainfrom Apr 22, 2026
Merged
Migrate inherit sandbox state to per-tool-call metadata#42t-kalinowski merged 5 commits intomainfrom
t-kalinowski merged 5 commits intomainfrom
Conversation
25f35f9 to
2acdf61
Compare
32f077c to
33eaaac
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--sandbox inheritfrom the obsolete async update flow to per-tool-call_meta["codex/sandbox-state-meta"]Why
Current Codex supplies inherited sandbox state on each tool call instead of through the old async update channel. The old contract no longer matched the client, which risked running a tool call without the sandbox state that actually applied to that call.
Public-facing changes
--sandbox inheritnow expects per-tool-callcodex/sandbox-state-metametadata on calls that spawn, respawn, or reset an inherited workerinheritsandbox modes remain authoritative and ignore Codex metadataInternal-only changes
Diff composition
Measured against
origin/main, this PR is5,300insertions and1,165deletions across46files. Most of that is regression coverage rather than runtime code:src/:+1,048/-343(21.5%of churn)tests/:+3,464/-726(64.8%of churn)src/:+648/-77(11.2%of churn)+140/-19(2.5%of churn)The largest contributors are
tests/sandbox_state_updates.rs,tests/codex_approvals_tui.rs, and inline tests insrc/worker_process.rs.Verification
cargo checkcargo buildcargo clippy --all-targets --all-features -- -D warningscargo testcargo +nightly fmt --all -- --checkcodex review --base origin/main