You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mcp: send sandbox metadata as permission profile only - #20422
Removes the legacy sandboxPolicy field from MCP sandbox-state metadata.
MCP servers that opt into codex/sandbox-state-meta now receive the canonical permissionProfile plus the existing sandbox cwd, Linux sandbox path, and Landlock flag. The duplicated legacy compatibility projection is no longer serialized in SandboxState.
Why
SandboxState already included permissionProfile, and the legacy sandboxPolicy projection is lossy for profiles with richer file-system rules. This keeps MCP metadata aligned with the permission-profile migration and removes SandboxPolicy usage from codex-rs/codex-mcp/src.
Verification
just fmt
cargo test -p codex-mcp
cargo test -p codex-core --test all --no-run
just fix -p codex-mcp -p codex-core
I also tried cargo test -p codex-core stdio_mcp_tool_call_includes_sandbox_state_meta; the direct Cargo run failed before exercising the assertion because it could not locate the test_stdio_server helper binary. CI/Bazel provides that runfile setup.
// Current app-server responses include `permissionProfile`. If it is absent,
// keep the TUI on its configured profile rather than rebuilding a lossy
// profile from the legacy `sandbox` compatibility field.
config.permissions.permission_profile()
Restore sandbox fallback when permissionProfile is missing
permission_profile_from_thread_response now falls back to config.permissions.permission_profile() whenever permissionProfile is absent, instead of reconstructing from the response sandbox context. Since permissionProfile is optional on thread start/resume/fork payloads, this causes remote or version-skewed responses without that field to be reinterpreted as the local config profile, so resumed/forked sessions can silently run with the wrong permissions and send mismatched sandbox overrides on subsequent turns.
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.
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
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
Removes the legacy
sandboxPolicyfield from MCP sandbox-state metadata.MCP servers that opt into
codex/sandbox-state-metanow receive the canonicalpermissionProfileplus the existing sandbox cwd, Linux sandbox path, and Landlock flag. The duplicated legacy compatibility projection is no longer serialized inSandboxState.Why
SandboxStatealready includedpermissionProfile, and the legacysandboxPolicyprojection is lossy for profiles with richer file-system rules. This keeps MCP metadata aligned with the permission-profile migration and removesSandboxPolicyusage fromcodex-rs/codex-mcp/src.Verification
just fmtcargo test -p codex-mcpcargo test -p codex-core --test all --no-runjust fix -p codex-mcp -p codex-coreI also tried
cargo test -p codex-core stdio_mcp_tool_call_includes_sandbox_state_meta; the direct Cargo run failed before exercising the assertion because it could not locate thetest_stdio_serverhelper binary. CI/Bazel provides that runfile setup.Stack created with Sapling. Best reviewed with ReviewStack.