Back to Engineering Blog
Engineering Field Notes 3 min read

An Empty Answer Crashed the Voice Pipeline

A small local model occasionally returned completely empty output on a long conversation. Blank text then crashed the speech synthesiser, which turned into a permanent HTTP 500 on every poll. We fixed the crash and added a retry, and we are honest that the cause is mitigated, not cured.

Jason NevillBy , Houston, TX
#Voice#LocalAI#Resilience#TTS

Key Architectural Takeaways

  • Treat an empty model output as a failure mode with its own handling: retry once, then fall back to a safe message.
  • Harden the downstream component too; it should not crash on blank input regardless of the upstream fix.
  • Write down what you mitigated and what you did not.

The symptom

On the voice kiosk the assistant spoke its acknowledgement, and then nothing: no answer ever arrived.

Root cause, from the audit trail

We reproduced it from the audit trail rather than guessing. The live voice conversation was unbounded (78+ messages in its thread), and with that much context the small local model that handles the top-level answer occasionally returned completely empty content. This is the same long-context empty-output tendency we had already documented for two other small models in the system, but it had never been mitigated on this path.

The empty string then reached the speech synthesiser. Kokoro produces zero audio chunks for blank text, and the code indexed the first chunk, so it raised a bare IndexError. The background-task wrapper caught the exception and turned it into an HTTP 500 for every subsequent poll. A transient model hiccup became a permanent failure for that request.

The fix

  • A blank-answer check plus a retry-then-safe-fallback in both of the terminal answer paths, the same shape as the existing backstops for false completion claims and internal commentary.
  • The synthesiser hardened so it does not crash on blank input regardless of what is upstream.

It was deployed and verified live, and both smoke tests passed afterwards.

What is not fixed

  • The underlying empty-output tendency is mitigated, not eliminated. The retry can also come back blank, in which case the safe fallback speaks.
  • The unbounded conversation thread is demonstrably contributing to real failures, and no cap or session reset had been decided.
  • Separately, the kiosk's own system clock is broken: a dead RTC, and a time service that never reached an NTP server (zero packets). We flagged it and did not fix it in this change.

Takeaway

Design for the model returning nothing, and make every component downstream of a model tolerate it. A pipeline's reliability is the product of its weakest assumption, and "the model always says something" is a weak one.

Some of what's described here is a design that hasn't been fully tested yet; those parts say so in the text.

Follow the build on LinkedIn or by RSS.

All Articles

Follow the build

Questions about the build, or spotted something we got wrong? Find us on LinkedIn and GitHub.