DuplexRealtimeAdapter: transcript fragment for audio that is never sent anchors the next burst, shifting transcripts by one utterance
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 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.
- 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. - 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
- 主要言語
- Python
- スター
- 14.6k
- フォーク
- 3.9k
- 平均マージ
- 3日 1時間
- マージ済み PR(30日)
- 173
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
livekit/agents のほかの issue
-
Agent state stays "speaking" after a realtime reply in sessions without audio output対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
Assistant markup is stripped from chat history when expressive mode is off対応中かも @ShivamSharma43 が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
docs: openai.LLM vs openai.responses.LLM for HTTP OpenAI-compat hosts再び着手できるかも @AbarnaaSree が 48 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
livekit/agents#7022 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
google: support Live Avatar video output for Gemini 3.8 Live (avatar_config, VIDEO modality)対応中かも @percusser が 1 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 22/100
livekit/agents#7843 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
EchoTools/nevr-runtime#651 ·
メンテナーはふだん 1 日以内に返信
-
bug frontend rt sev-3
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
noontide-co/mainbranch#1211 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[1.x Bug] run-operation --sql reports success but rolls back writes on transaction-capable adaptersオープンtriage
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
dbt-labs/dbt#16784 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信