Fix: update parallel tool call exec approval to approve on request id#11162
Fix: update parallel tool call exec approval to approve on request id#11162shijie-oai wants to merge 3 commits intomainfrom
Conversation
| if let Err(err) = conversation | ||
| .submit(Op::ExecApproval { | ||
| id: event_turn_id, | ||
| id: item_id, |
There was a problem hiding this comment.
For v2 - we are submitting the item_id so that individual request can be approved. I did not change the v1 behavior as it is no longer being used.
There was a problem hiding this comment.
Edit: I brought v1 API up to use item_id too so that test can pass as expected too. Should not have any affect on usage though.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3c37d6306f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let _ = codex | ||
| .submit(Op::ExecApproval { | ||
| id: approval_id, | ||
| decision, |
There was a problem hiding this comment.
Preserve turn id for execpolicy amendment logging
Here Op::ExecApproval now carries call_id, but exec_approval later uses that id to log the execpolicy amendment message and warning events via record_execpolicy_amendment_message(&id, …), which looks up a turn context by sub_id. With a call ID, that lookup always fails and the message is injected into the current active turn (or dropped), so approvals that include ApprovedExecpolicyAmendment can be recorded on the wrong turn or not recorded at all. This is visible when a user approves an execpolicy amendment while another turn is active or after the original turn finishes.
Useful? React with 👍 / 👎.
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
Screen.Recording.2026-02-08.at.11.30.46.PM.mov
After
Screen.Recording.2026-02-08.at.11.31.40.PM.mov