Unify skip-review handling for approval_mode = "approve" (#20750)

## Summary
- Treat `approval_mode = "approve"` as skip-review across all permission
modes.
- Remove the mode-specific split in the MCP auto-approval gate so
approved tools bypass review consistently.
- Expand regression coverage in the shared MCP helper and the core
tool-call flow.

## Testing
- `just fmt`
- `cargo test -p codex-mcp`
- `cargo test -p codex-core
approve_mode_skips_arc_and_guardian_in_every_permission_mode`
- `git diff --check`
- Full `cargo test -p codex-core` was also attempted, but the suite hit
an unrelated pre-existing stack overflow in an existing multi-agent test
This commit is contained in:
Matthew Zeng authored and GitHub committed 2026-05-04 10:30:47 -07:00
1 parent 83a4e3b66b
commit 1b900bee8a
3 files changed
+88 -96

No files matched your search

+1 -6
View File
@@ -71,12 +71,7 @@ pub fn mcp_permission_prompt_is_auto_approved(
permission_profile: &PermissionProfile,
context: McpPermissionPromptAutoApproveContext,
) -> bool {
if matches!(
approval_policy,
AskForApproval::OnRequest | AskForApproval::Granular(_)
) && context.approvals_reviewer == Some(ApprovalsReviewer::AutoReview)
&& context.tool_approval_mode == Some(AppToolApproval::Approve)
{
if context.tool_approval_mode == Some(AppToolApproval::Approve) {
return true;
}