Skip to content

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

Open
shijie-oai wants to merge 3 commits intomainfrom
shijie/fix-parallel-tool-call-approvals
Open

Fix: update parallel tool call exec approval to approve on request id#11162
shijie-oai wants to merge 3 commits intomainfrom
shijie/fix-parallel-tool-call-approvals

Conversation

@shijie-oai
Copy link
Collaborator

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

if let Err(err) = conversation
.submit(Op::ExecApproval {
id: event_turn_id,
id: item_id,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@shijie-oai shijie-oai marked this pull request as ready for review February 9, 2026 19:41
Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +337 to +340
let _ = codex
.submit(Op::ExecApproval {
id: approval_id,
decision,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant