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
protocol: require permission profiles for user turns - #20441
Op::UserTurn is the explicit turn submission path where callers already provide the complete turn context. Keeping permission_profile optional meant core still had to preserve a legacy SandboxPolicy fallback for this path, even though every migrated caller should know the canonical permissions profile at submission time.
This PR makes permission_profile required for UserTurn so core no longer has to derive command permissions from the legacy sandbox field for explicit turns. The legacy sandbox_policy slot is left in place temporarily but is ignored for UserTurn; follow-up PRs can remove it once the remaining mechanical test/helper callsites stop carrying it.
What Changed
Changes Op::UserTurn.permission_profile from Option<PermissionProfile> to required PermissionProfile.
Updates core turn handling to use the required profile directly instead of calling the legacy fallback helper.
Updates TUI command conversion and tests for the non-optional profile shape.
Keeps UserInputWithTurnContext and OverrideTurnContext legacy fallback behavior unchanged because those are still compatibility update surfaces.
// 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
When thread/start, thread/resume, or thread/fork responses omit permissionProfile, this now always falls back to local config permissions instead of deriving from the response sandbox field (the previous remote-mode behavior). In mixed-version setups (new TUI talking to an older remote app-server that only sends sandbox), the TUI can display and submit turns with incorrect permissions, causing mismatched approval/sandbox UX and incorrect turn overrides.
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
Op::UserTurnis the explicit turn submission path where callers already provide the complete turn context. Keepingpermission_profileoptional meant core still had to preserve a legacySandboxPolicyfallback for this path, even though every migrated caller should know the canonical permissions profile at submission time.This PR makes
permission_profilerequired forUserTurnso core no longer has to derive command permissions from the legacy sandbox field for explicit turns. The legacysandbox_policyslot is left in place temporarily but is ignored forUserTurn; follow-up PRs can remove it once the remaining mechanical test/helper callsites stop carrying it.What Changed
Op::UserTurn.permission_profilefromOption<PermissionProfile>to requiredPermissionProfile.UserInputWithTurnContextandOverrideTurnContextlegacy fallback behavior unchanged because those are still compatibility update surfaces.Verification
cargo check -p codex-protocol -p codex-core -p codex-tui --testsStack created with Sapling. Best reviewed with ReviewStack.