fix(config): honor selected profile approval policy - #530
Open
sylvesterkaczmarek wants to merge 2 commits into
Open
fix(config): honor selected profile approval policy#530sylvesterkaczmarek wants to merge 2 commits into
sylvesterkaczmarek wants to merge 2 commits into
Conversation
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
Resolve scan approval policy with the same selected-profile precedence already used for model, reasoning effort, and provider settings.
Fixes #528.
Reproduction / evidence
Use an effective Codex configuration with a restrictive root policy and an explicitly selected profile that overrides it:
On current
main,scanApprovalPolicy()evaluates the root and profile with an OR condition:Actual result on
main:never.Expected result:
on-request, because an explicitly selected profile should take precedence over the root setting, just as selected-profilemodel,model_reasoning_effort, andmodel_provideralready do.This is operational rather than display-only. The resolved value is passed to
codex.startThread({ approvalPolicy }), written into scan setup, and projected into the hardened runtime config.The regression coverage also checks the reverse direction and fallback behavior:
never, selected profileon-request->on-request;on-request, selected profilenever->never;Root cause
scanApprovalPolicy()implemented an independent restrictive merge rule instead of using the selected-profile precedence used by the other effective scan settings.Fix
approval_policy, resolve that value;neveroron-request.Tests / validation
Added a focused regression file covering both override directions and root fallback.
The branch was created from upstream
mainat99c85613b0c4b8202b33dfbd80f41884fb9eac11. The production diff is 7 additions and 4 deletions plus the focused 36-line test file.Full repository tests cannot be run in this execution environment because the repository cannot be cloned here, so pushed-head CI remains the authoritative full-suite validation.
Risk
Low. Behavior changes only when the selected profile explicitly sets
approval_policydifferently from the root. Profiles without their own approval policy retain root behavior.