Fix: update parallel tool call exec approval to approve on request id (#11162)

### Summary

In parallel tool call, exec command approvals were not approved at
request level but at a turn level. i.e. when a single request is
approved, the system currently treats all requests in turn as approved.

### Before

https://github.com/user-attachments/assets/d50ed129-b3d2-4b2f-97fa-8601eb11f6a8

### After

https://github.com/user-attachments/assets/36528a43-a4aa-4775-9e12-f13287ef19fc
This commit is contained in:
Shijie Rao
2026-02-10 09:38:00 -08:00
committed by GitHub
parent 47356ff83c
commit c4b771a16f
15 changed files with 190 additions and 135 deletions

View File

@@ -87,15 +87,19 @@ async fn codex_delegate_forwards_exec_approval_and_proceeds_on_approval() {
.await;
// Expect parent-side approval request (forwarded by delegate).
wait_for_event(&test.codex, |ev| {
let approval_event = wait_for_event(&test.codex, |ev| {
matches!(ev, EventMsg::ExecApprovalRequest(_))
})
.await;
let EventMsg::ExecApprovalRequest(approval) = approval_event else {
panic!("expected ExecApprovalRequest event");
};
// Approve via parent; id "0" is the active sub_id in tests.
// Approve via parent using the emitted approval call ID.
test.codex
.submit(Op::ExecApproval {
id: "0".into(),
id: approval.call_id,
turn_id: None,
decision: ReviewDecision::Approved,
})
.await
@@ -161,15 +165,18 @@ async fn codex_delegate_forwards_patch_approval_and_proceeds_on_decision() {
matches!(ev, EventMsg::EnteredReviewMode(_))
})
.await;
wait_for_event(&test.codex, |ev| {
let approval_event = wait_for_event(&test.codex, |ev| {
matches!(ev, EventMsg::ApplyPatchApprovalRequest(_))
})
.await;
let EventMsg::ApplyPatchApprovalRequest(approval) = approval_event else {
panic!("expected ApplyPatchApprovalRequest event");
};
// Deny via parent so delegate can continue; id "0" is the active sub_id in tests.
// Deny via parent so delegate can continue, using the emitted approval call ID.
test.codex
.submit(Op::PatchApproval {
id: "0".into(),
id: approval.call_id,
decision: ReviewDecision::Denied,
})
.await