mirror of
https://github.com/openai/codex.git
synced 2026-05-03 10:56:37 +00:00
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:
@@ -5130,9 +5130,9 @@ async fn apply_patch_manual_flow_snapshot() {
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn apply_patch_approval_sends_op_with_submission_id() {
|
||||
async fn apply_patch_approval_sends_op_with_call_id() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(None).await;
|
||||
// Simulate receiving an approval request with a distinct submission id and call id
|
||||
// Simulate receiving an approval request with a distinct event id and call id.
|
||||
let mut changes = HashMap::new();
|
||||
changes.insert(
|
||||
PathBuf::from("file.rs"),
|
||||
@@ -5155,11 +5155,11 @@ async fn apply_patch_approval_sends_op_with_submission_id() {
|
||||
// Approve via key press 'y'
|
||||
chat.handle_key_event(KeyEvent::new(KeyCode::Char('y'), KeyModifiers::NONE));
|
||||
|
||||
// Expect a CodexOp with PatchApproval carrying the submission id, not call id
|
||||
// Expect a CodexOp with PatchApproval carrying the call id.
|
||||
let mut found = false;
|
||||
while let Ok(app_ev) = rx.try_recv() {
|
||||
if let AppEvent::CodexOp(Op::PatchApproval { id, decision }) = app_ev {
|
||||
assert_eq!(id, "sub-123");
|
||||
assert_eq!(id, "call-999");
|
||||
assert_matches!(decision, codex_core::protocol::ReviewDecision::Approved);
|
||||
found = true;
|
||||
break;
|
||||
@@ -5207,7 +5207,7 @@ async fn apply_patch_full_flow_integration_like() {
|
||||
.expect("expected op forwarded to codex channel");
|
||||
match forwarded {
|
||||
Op::PatchApproval { id, decision } => {
|
||||
assert_eq!(id, "sub-xyz");
|
||||
assert_eq!(id, "call-1");
|
||||
assert_matches!(decision, codex_core::protocol::ReviewDecision::Approved);
|
||||
}
|
||||
other => panic!("unexpected op forwarded: {other:?}"),
|
||||
|
||||
Reference in New Issue
Block a user