Accueil / Articles / Voice Agents and Corrections: Why Hearing the Right Order Isn't Enough

Cet article est publié en anglais.

Voice Agents and Corrections: Why Hearing the Right Order Isn't Enough

A voice agent repeated the corrected order number yet changed the wrong order. Learn how stale tool calls survive barge-in and how state machines and traces catch it.

1121 mots

A confirmation that sounded right

A customer asks a voice agent to move order 4821 to Friday delivery. Before the agent finishes answering, the customer cuts in with a correction: the number is 4281, not 4821. The agent stops mid-sentence, agrees, and promises to update order 4281.

The call ends on a happy note. Yet the system changed order 4821, and order 4281 was never touched.

Speech recognition caught both numbers correctly. The agent even repeated the corrected one back verbatim. Nothing in the transcript is wrong, and something still broke.

Why a transcript isn't state

Debugging starts by ruling out the obvious suspects. This wasn't a recognition error, and the agent didn't invent a number. The pipeline simply treated four different things as if they were one:

Conversation history   →  4821, then a correction to 4281
Active intent          →  the order the customer currently means
Pending action         →  the order ID already loaded into the tool call
Backend state          →  the order that was actually written

A transcript is an event log. It records everything said, in order, for good. Both order numbers belong there because both were spoken. After the correction, though, only one of them belongs in the active task state, and if the transcript doubles as the state, nothing can flag the earlier value as obsolete.

The record of what was said was accurate. The state transition was what went wrong.

How the stale value survived

Three ordinary design choices are enough to cause this, and most voice stacks contain all three.

History that only grows

A correction arrives as one more message, and nobody explicitly invalidates the old value. On every turn the model has to work out which of several plausible values is current. When latency is tight, that reasoning can lose the race against the next action.

Tools prepared too early

Voice agents are tuned for responsiveness, so tool calls frequently begin filling in arguments before the customer has finished a sentence. Barge-in silences the audio. It doesn't automatically cancel an API request that's already underway.

Several copies of one fact

The conversational model, the orchestration layer and the tool-calling layer often each keep their own copy of the order ID, and updating one doesn't update the rest. That produces the nastiest outcome. Out loud, the agent announces 4281, but the tool is still holding 4821, so the call sounds correct while the action is wrong.

What the trace shows

Neither the transcript nor the final spoken reply reveals any of this. Only a timestamped execution trace does:

10:03:12.100  Customer mentions order 4821
10:03:12.420  Active state set: order_id = 4821
10:03:13.000  Update tool prepared: order_id = 4821
10:03:13.250  Customer interrupts: "Sorry, I meant 4281."
10:03:13.510  Conversation state updated:  order_id = 4281
10:03:13.700  Previously prepared tool executes: order_id = 4821
10:03:14.100  Agent says: "I've updated order 4281."

The correction landed at 13.510, but the tool call had been committed back at 13.000. Everything after that commit, including the spoken confirmation, reflects a value that no longer matches what the customer wants. An eval asking whether the transcript captured the correction, or whether the reply named the right order, would pass this call. The trace alone exposes the split.

Corrections must cancel pending work

A cleverer prompt isn't the cure. The conversation needs to run as a staged state machine, and a correction must undo every step that depended on the value being replaced:

→ Intent detected
→ Parameters collected
→ Parameters validated
→ Customer confirmation
→ Action committed
→ Backend result verified

When the order ID changes, a whole chain goes stale: the loaded order record, the eligibility result, the arguments queued for the tool, a confirmation the customer already gave, and any write that hasn't finished. The flow returns to the "parameters collected" stage and runs forward again. In practice, that calls for several things working together:

  • structured task state in place of state inferred from the transcript
  • version numbers on state, so a stale write can be detected and refused
  • idempotency keys, so a duplicate or superseded action can't be applied twice without anyone noticing
  • explicit cancellation of in-flight tool calls whenever barge-in happens
  • confirmation tied to the current state and not to the state at the moment confirmation started
  • a check against the backend after execution, instead of trusting what the tool returned

Testing for it

A test that measures transcript accuracy will never find this class of bug, because the transcript is fine. Catching it takes synthetic calls that interrupt at three particular moments: before the tool is prepared, during preparation and after submission. These should run across several kinds of correction: order number, quantity, delivery date, address, customer identity and negation, as in a customer who says to confirm and then immediately says not to.

Each run gets scored on seven questions:

  1. Was the correction captured?
  2. Did the active state update?
  3. Was the old value invalidated?
  4. Did the tool receive the right arguments?
  5. Was a duplicate or stale action attempted?
  6. Was the final backend state correct?
  7. Did the spoken confirmation match the backend?

The gap between the sixth question and the transcript-level checks on spoken confirmation is precisely where this failure hides. It becomes visible only with a suite that measures backend truth and not conversational plausibility.

Hearing isn't applying

A voice agent deserves no credit for hearing a correction or repeating it cleanly. Those are conversational claims. For a correction to count, it must update the active state, kill or replace whatever action is pending, arrive at the tool with the right arguments, and finally show up in the backend.

In voice AI, saying "I heard you" is a conversational claim, while saying "the correction is applied" is a state-management claim. Production systems have to verify the second, because nothing in the transcript will reveal it when they don't.