Function Call Cancelled

Tells the client that a function call it already received will not be used, because the user started speaking again, either before or after the turn was confirmed.
Voice Agent

The Voice Agent server sends FunctionCallCancelled when a client-side function call it already sent you is cancelled because the user started speaking again, either inside the speculative window (the turn resumed) or after the turn was confirmed (barge-in). Only calls the client already received are announced.

Purpose

The agent begins building a reply before the user’s turn is confirmed. Function calls produced in that window are dispatched immediately unless the function sets defer_until_eot. When the turn resumes, those calls are cancelled, and this message tells you which ones. The same message arrives when the user barges in after the turn was confirmed and the agent abandons the reply that produced the call.

Without it, a client holding a FunctionCallRequest cannot tell a live request from an abandoned one. For background on the window itself, see Speculative Replies & Turn Confirmation.

When you receive it

The server sends this message only for calls it already sent you, whether the cancellation came from a resumed turn or from a barge-in after the turn was confirmed. A call that was still held when the turn resumed was never announced, so there is nothing to cancel and no message arrives.

Handling the message

When your client receives a FunctionCallCancelled:

  1. Stop any work in progress for each id in the list.
  2. Do not send a FunctionCallResponse for those ids. A late response is dropped.
  3. Roll back anything you already committed, if your function is not idempotent. Better still, set defer_until_eot: true on functions that cannot be rolled back, so they never fire speculatively.

Example payload

1{
2 "type": "FunctionCallCancelled",
3 "functions": [
4 {
5 "id": "fc_12345678-90ab-cdef-1234-567890abcdef",
6 "name": "book_appointment"
7 }
8 ]
9}

Fields

FieldTypeDescription
typestringAlways "FunctionCallCancelled".
functions[].idstringThe id from the FunctionCallRequest that is now cancelled.
functions[].namestringThe name of the cancelled function.