When a caller interrupts a voice agent, the LLM has almost always written more than the caller heard. If the agent keeps the whole answer in its history, the next turn is built on a conversation that never happened. Brisvox cuts the history at the last word that was actually played, and since 0.1.4 it also tells a real interruption from a cough before it gives up the answer.

The problem, in one exchange

The agent's answer streams in faster than it is spoken:

Agent (written): Your order shipped on Tuesday and should arrive by Friday.
                 Would you like the tracking number sent to your phone?
Caller (cuts in after "arrive by"): Wait, which address is it going to?

The caller never heard "Friday" or the offer of a tracking number. If the history still holds them, the LLM may answer as if the caller had declined the offer, or refer to a date the caller does not know. What the history should hold is Your order shipped on Tuesday and should arrive by.

How Brisvox cuts the history

  • Every user turn is an epoch. Every frame the bot side produces carries the epoch it was made for, and every stage drops frames from a stale epoch. Audio from the abandoned answer cannot leak into the next one.
  • The clear goes straight to the transport. Queued audio is dropped and the client is told to flush what it buffered. In the engine's own benchmark this took 0.022 ms at p95, against a budget of 1 ms.
  • The work behind the answer stops. The LLM round, the text segmenter and any open TTS streams are cancelled. Tools marked as side effects are the exception: a booking or a payment that already started completes, is recorded, and its result is reported on the next turn.
  • The context is cut to what was played. Playback marks, playback positions and the TTS provider's word timestamps locate the last word the caller heard. The engine waits up to 250 ms by default for those reports to settle.

Not every sound is an interruption

A cough, a door or a keyboard can look like the start of speech. A voice agent that stops for every one of them loses its answer for nothing. Since 0.1.4, Brisvox pauses instead of stopping, then decides:

  1. Pause after 400 ms of speech. A click or a door bang shorter than that never pauses the bot.
  2. Interrupt on a word. Any recognised word, or a command such as "stop", "wait", "dur" or "bekle", interrupts at once. The bot's own echo does not count.
  3. Resume when nothing was said. If the sound stopped and no word came, the bot continues the same answer from where it paused. Anything uncertain interrupts, so a real interruption is not dropped on a guess.
  4. Stop pausing for a noisy room. After two resumed pauses in a minute, the bot keeps talking until it hears a word.

This is the same idea as LiveKit's resume_false_interruption. In an agent file it looks like this:

[interruption]
pause_then_decide = true   # the default in agent files
pause_after_ms = 400       # speech must last this long before the bot pauses
decide_ms = 1500           # the window to decide: interrupt or resume
rule = "words"             # resume only when no word was recognised

What it costs

In the built-in harness (mostly synthetic noise and a modelled recognizer), noise without speech cut the bot off on 13 % (wideband) and 19 % (telephone) of the candidates it made; with this setting, on none. The cost is short commands the speech recognizer misses: weighted over sentences and short commands, about 1.2 % of real interruptions on wideband and 5.1 % on telephone are not taken, against none for guards that decide on duration alone. A configuration that behaves like LiveKit's measured the same. A second person who talks still interrupts the bot: telling voices apart in the first half second turned out to be beyond what short speaker models can do. The numbers are in barge-in-noise.md.

How it is tested

Time in Brisvox comes from an injected clock, so whole calls run deterministically in a simulation with mock providers. Property tests drive random sequences of speech, transcripts and pauses and check that the epoch only moves forward, that no transcript is counted twice, and that every pause ends exactly once. They found three real bookkeeping bugs before the release. The design is described in docs/ARCHITECTURE.md and on the how it works page.

Brisvox is designed and directed by Bilal and implemented largely with AI coding agents; this article was written with AI assistance. Every number in it comes from a result file committed to the repository.