Skip to content

Voice: first audio waits for a full terminated sentence — no sub-sentence fast start #13103

Open

Description

@mrveiss

Problem

In a streaming reply, the first audio does not start until a complete,
terminated sentence of at least 20 characters
exists. Everything before that is
silence. The perceived difference is "talks as it thinks" versus "long pause, then
a wall of speech".

Evidence

autobot-frontend/src/utils/ttsSentences.ts:33-49 — extractCompleteSentences()
only ever emits on the terminator pattern (?<=[.!?])\s+, and only when
candidate.length >= minChars.

autobot-frontend/src/components/chat/ChatInterface.vue:1301,1325 — the caller
passes _MIN_TTS_SENTENCE_CHARS = 20 for every chunk. There is no lower bar
for the first one.

Proposed approach

Release the opening chunk of a reply on a weaker signal, then raise the bar
for everything after:

  • first chunk: emit at an early clause boundary (, ; : — –), or —
    for a long opening sentence with no early pause — at a word boundary once a
    minimum length is reached
  • subsequent chunks: keep the current terminated-sentence + minChars rule

The fast path must only fire when nothing is already held for merging, so the
opening never jumps ahead of an earlier short sentence waiting to be merged.

Risk — must be validated by listening, not just by test

A too-short opening fragment can render with a noticeably different timbre
from the rest of the reply, producing a "the voice changes mid-sentence" artifact.
The safe minimum is model-specific and must be measured against our own TTS worker
(autobot-tts-worker, Kani-TTS-2) — a threshold that works for one model does not
transfer to another.

If the artifact cannot be avoided at any useful length, close this as
not-worth-doing and record the measured finding, rather than shipping a latency
win that costs audio quality.

Acceptance criteria

Activity

  1. mrveiss commented on Jul 31, 2026

    @mrveiss
    OwnerAuthor

    Parent: #13096 (capability audit umbrella).

  2. modified the milestones: Backlog, v0.13.0 on Sep 12, 2026
  3. mrveiss commented on Oct 19, 2026

    @mrveiss
    OwnerAuthor

    Landed through merge train 34 (#18859, merge 7891503). #17972's reviewed head 1a1edaa is an ancestor of main. Evidence from git show origin/main:<path>, in autobot-frontend/src/utils/__tests__/ttsFastStart.test.ts:

    AC Verdict Evidence
    First chunk released at a clause or word boundary below the standard bar ✅ releases the opening at a clause boundary below the standard bar (:31) and falls back to a word boundary for a long opening with no early pause (:41). Thresholds OPENING_CLAUSE_MIN_CHARS = 16 and OPENING_WORD_MIN_CHARS = 48, in ttsSentences.ts.
    Subsequent chunks unchanged ✅ speaks the opening early, then only terminated sentences (:78): after the opening, a clause boundary alone releases nothing.
    Fast path suppressed when a short sentence is already held for merging ✅ stays out of the way once any sentence has terminated (:69): "Hi there." (under the bar) is held, and extractOpeningChunk returns null.
    Cursor accounting advances by the exact consumed span (#12502) ✅ advances the cursor by the exact consumed span — no drift (:102, steps 1/3/7/50): spoken + remainder == the full text.
    Listening test against our TTS worker recorded in the issue ⬜ left unchecked Not run. On 2026-10-18 the owner chose to land with the current defaults (16/48), which stay injectable (OpeningThresholds). The harness that renders candidates for that listening test ships as autobot-frontend/scripts/tts-listening-test.mjs, documented in docs/guides/VOICE_INTERFACE_SETUP.md. This item stays open until someone runs it and records the pick.
  4. added
    needs-structureMissing goal milestone, matching phase label or native parent (#19522)
    on Oct 28, 2026
  5. github-actions commented on Oct 28, 2026

    @github-actions
    Contributor

    needs-structure cleared: goal milestone, matching phase label and native parent (or sub-issues) are all present (#19522).

  6. modified the milestones: v0.13.0, M7 - Voice on Oct 31, 2026
  7. removed
    needs-structureMissing goal milestone, matching phase label or native parent (#19522)
    on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions