Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

DuplexRealtimeAdapter: transcript fragment for audio that is never sent anchors the next burst, shifting transcripts by one utterance

Aperta
#7,854 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@dyyfk ci sta già lavorando.

Dal 15/10/2026.

  • #7862 di @dyyfk — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Start with the repro test test_words_for_sound_never_sent_do_not_anchor_the_next_burst in tests/test_duplex_adapter.py and run it with -k never_sent to see the stale fragment become the next utterance. Read how DuplexRealtimeAdapter queues transcript fragments and decides their fate in _close_burst, _on_transcript_delta, and the 3 s unclaimed rule. Done means the test passes and fragments for audio that was never sent are neither used as words nor as an anchor.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Bug Description

After a barge-in, DuplexRealtimeAdapter can put the model's cut-off words on its next utterance, and every later transcript then lands one utterance late.

  1. The model's transcript runs ahead of its audio. The user barges in, the model yields, and the audio for its last stamped fragment is never sent.
  2. That fragment is neither due (_close_burst) nor late (_on_transcript_delta), so it stays queued. The 3 s unclaimed rule runs on the audio clock, which stops while the provider sends nothing ("it may stop between bursts"). A provider that streams its silence instead is caught by the rule only if the model stays quiet for 3 s.
  3. The next burst takes the stale fragment as its first words and its anchor. Its own words are then held against the wrong anchor and roll into the burst after it, and the last utterance's words can be lost.

#7264 fixed this for audio that was played. This is the case where the audio is never played. It is still present on main (the adapter is unchanged since 1.8.7).

Expected Behavior

Words for audio that was never sent never become the next utterance's words or set its anchor. Nobody heard them, so they should not be captioned or recorded either, the same as the played-text-only rule for interrupted realtime messages.

Reproduction Steps

Add the test below to tests/test_duplex_adapter.py and run uv run pytest tests/test_duplex_adapter.py -k never_sent. On main it fails with assert ' there.' == 'Next.': the cut-off " there." became the second utterance's text and "Next." is still queued.

test
async def test_words_for_sound_never_sent_do_not_anchor_the_next_burst(duplex) -> None:
    fake, session, generations = duplex
    fake.push(0.001, count=20, start_ms=0)
    fake.push(0.3, count=3, start_ms=2000)
    await _settle()
    fake.say("Hello", start_ms=2000, end_ms=2200)
    fake.say(" there.", start_ms=3500, end_ms=3800)  # its sound never comes
    fake.push(0.001, count=8, start_ms=2300)
    await _settle()

    fake.say("Next.", start_ms=6000, end_ms=6200)  # nothing was sent in between
    fake.push(0.3, count=3, start_ms=6000)
    fake.push(0.001, count=8, start_ms=6300)
    await _settle()

    assert len(generations) == 2
    assert (await asyncio.wait_for(_read(generations[1]), timeout=1))[1] == "Next."
    assert not session._fragments
Operating System

Any (in-process unit test)

Models Used

A custom DuplexModel for a self-hosted MiniCPM-o 4.5. The repro uses the suite's fake DuplexModel.

Package Versions
livekit-agents==1.8.7 (also main @ 334d336)
Session/Room/Call IDs

n/a

Proposed Solution

#7862, for providers that stamp their audio.

Additional Context

We found this by reading the adapter while deciding whether our plugin should stamp its output. Our live plugin sends unstamped fragments and does not hit it.

Screenshots and Recordings

n/a

Lingua principale
Python
Stelle
14.6k
Fork
3.9k
Merge medio
3g 1h
PR unite (30g)
173

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di livekit/agents

Tutte le issue di livekit/agents

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.