Repository navigation
fix: snapshot manually committed user turns - #7811
Conversation
Co-authored-by: Ahmet Sakar <56402843+ahmetTW@users.noreply.github.com>
|
Thanks for picking this up so quickly! I tested this branch against the repro from #7806 and it does fix the dropped turn. I think the guard has two side effects, though, one of which the Devin review above also points out. 1. A refused clear also skips the STT reset. 2. Speech the app wanted discarded is merged into the committed turn. While a manual commit is pending, I applied this PR and #7808 to 1.8.7 (both apply cleanly). Results,
The check for (1), on top of the #7806 repro: await rec._commit_user_turn(audio_detached=True, transcript_timeout=1.0, stt_flush_duration=2.0)
before = rec._stt_pipeline
rec._clear_user_turn()
assert rec._stt_pipeline is not before # fails on this branch while delivery is pending#7808 has a gap too (last-but-one row). A FINAL arriving during the delay calls Suggested resolution: land one fix, not both. With this guard in place, #7808's cleared-after-commit branch could never trigger, so the combination behaves like this PR alone. My preference is the snapshot approach, as the Devin review also recommends ("track which utterance each pending commit protects"), extended to cover the reschedule above, either by reworking this PR along those lines or by going with #7808 once its CLA is signed and the gap is closed. Happy to test whichever branch you pick; the four rows above make a reasonable regression set. |
Co-authored-by: DDT <141296842+Hugo-DDT@users.noreply.github.com> Co-authored-by: Ahmet Sakar <56402843+ahmetTW@users.noreply.github.com>
|
Tested f8febb5 applied to 1.8.7 against the scenarios from my earlier comment: all four rows now pass, including the "new FINAL during the delay, then clear" case (turn delivered as |
|
Not trying to talk you out of this one — #7811 is the approved fix here — but two things from putting #8160 together that may help it land:
I'm closing #8160 as the duplicate it is so it doesn't split review attention; the test file ( |
|
Hello what’s next on this? thank you |
|
@chenghao-mou @longcw — #7811 is already APPROVED, but GitHub currently shows it as CONFLICTING against Could you rebase this branch onto current Thanks — and thanks @ahmetTW for the nudge. |
|
@longcw @chenghao-mou much appreciated if you can take a look 🙇 |
…-guard-manual-turn-clear # Conflicts: # livekit-agents/livekit/agents/voice/audio_recognition.py
Manual commits snapshot text and trace data inside the end-of-turn task. Clear resets live input and STT while preserving the snapshot. Later FINALs stay live for the next commit.
Uses @Hugo-DDT’s #7808 snapshot idea and @ahmetTW’s #7806 race analysis. Canceled tasks preserve spans still owned by live data.
During pending manual delivery, clear preserves realtime latency with external STT.
Fixes #7806. Addresses AGT-3740.
Initial prompt and agent context
Model: GPT-6.1