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
session: tag turns with permission profiles - #20432
TurnContext already carries the canonical PermissionProfile for a turn. Keeping a TurnContext::sandbox_policy() convenience method made it easy for production code to re-project that profile into the legacy SandboxPolicy shape even when the caller did not actually need a legacy boundary payload.
This change keeps legacy projection explicit: new turn telemetry records the canonical profile, while tests that intentionally construct old rollout records build the compatibility sandbox_policy locally as a fixture detail.
What Changed
Removed TurnContext::sandbox_policy() from the core session turn context.
Changed sampling feedback tags from sandbox_policy to permission_profile so feedback captures the canonical permission model instead of a lossy compatibility projection.
Updated legacy rollout reconstruction fixtures to call a test-local helper when they need a TurnContextItem with permission_profile: None and a legacy sandbox_policy.
// 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()
Preserve remote thread permissions when profile is omitted
When permissionProfile is absent in a thread/start|resume|fork response (e.g., older remote app-server versions that still provide only legacy sandbox), this fallback now uses the local config profile instead of the server thread’s sandbox-derived permissions. That desynchronizes client/server permission state, and subsequent turn_start calls build overrides from the wrong profile (turn_permissions_overrides), which can silently broaden or restrict sandboxing for future turns on that thread. The previous remote-mode fallback reconstructed from the response sandbox, so this is a behavior regression for mixed-version remote deployments.
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.
Why
TurnContextalready carries the canonicalPermissionProfilefor a turn. Keeping aTurnContext::sandbox_policy()convenience method made it easy for production code to re-project that profile into the legacySandboxPolicyshape even when the caller did not actually need a legacy boundary payload.This change keeps legacy projection explicit: new turn telemetry records the canonical profile, while tests that intentionally construct old rollout records build the compatibility
sandbox_policylocally as a fixture detail.What Changed
TurnContext::sandbox_policy()from the core session turn context.sandbox_policytopermission_profileso feedback captures the canonical permission model instead of a lossy compatibility projection.TurnContextItemwithpermission_profile: Noneand a legacysandbox_policy.Verification
cd codex-rs && cargo check -p codex-core --testscd codex-rs && just fix -p codex-coreStack created with Sapling. Best reviewed with ReviewStack.