fix(voice): reset user away timer on final transcript#2063
Open
rosetta-livekit-bot[bot] wants to merge 1 commit into
Open
fix(voice): reset user away timer on final transcript#2063rosetta-livekit-bot[bot] wants to merge 1 commit into
rosetta-livekit-bot[bot] wants to merge 1 commit into
Conversation
🦋 Changeset detectedLatest commit: 2ec005e The changes in this PR will be included in the next version bump. This PR includes changesets to release 37 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@livekit/agents.Source diff coverage
Coverage classification
livekit-agents/livekit/agents/voice/agent_session.pyagents/src/voice/agent_session.ts_user_input_transcribedbehavior to the JS_onUserInputTranscribedevent handler. Final transcripts still moveawayusers back tolistening; when user and agent are bothlistening, final transcripts now refresh_setUserAwayTimer().tests/test_agent_session.pyagents/src/voice/agent_session.test.tsuser_input_transcribedevents through the session event path and spying on the internal timer method. The cases match the source test: final transcript resets while listening, interim transcript does not, and final transcript while user is speaking does not.No source files were not applicable.
Validation
pnpm test agents/src/voice/agent_session.test.tspassed.pnpm test agents/srcfailed due existing/baselineagents/src/voice/amd.test.tsfailures; rerunningpnpm test agents/src/voice/amd.test.tsindependently produced the same 11 AMD classification/timing failures. The new agent session test passed in the full run.pnpm buildpassed.pnpm lintpassed with existing warnings only.pnpm exec prettier --check agents/src/voice/agent_session.ts agents/src/voice/agent_session.test.ts .changeset/reset-user-away-final-transcript.mdpassed.US_AWAYoccurred at 7206 ms, after the second final transcript refreshed the away timer.Infrastructure gaps
None.
Ported from livekit/agents#6478
Original PR description
VAD can miss speech while STT still emits a final transcript. In that case the user stays
listening, so the away timer kept counting down and could fire despite recent STT activity. Observed from a user session where short utterance was ignored by the timer.On a final transcript when the user is not already speaking, refresh
user_away_timeoutwithout changing user state. The existingaway→listeningrecovery path is unchanged.Made with Cursor