Approvals are now tied to the exact tool call they answer, so a late one can't hit the wrong call.
What's wrong with this entry?
Approve and deny responses now carry the id of the tool call they belong to, and the code that collects them refuses any response aimed at a different call, logging "answered for a different tool use". This closes a window where a late or misrouted approval could be applied to the wrong tool call. Always on, with no flag or setting to turn it off.
tool_use_idis added to both the error and success shapes of the permission response message, sitting alongside the existingrequest_id,subtype,updated_inputandpermission_updatesfields.- Both the approved and rejected branches of mailbox permission handling, the path that carries permission decisions between sessions, forward the tool use id.
- The poller that waits for a queued response compares ids and rejects mismatches rather than accepting the first answer that arrives.
- A response that cannot be routed because the owning team is unknown fails with
[PermissionSync] Cannot send permission response: team name not found.
[PermissionSync] Cannot send permission response: team name not found, processMailboxPermissionResponse, answered for a different tool use
Strings lifted out of the shipped bundle, so the claim above can be checked against them.