Skip to content

fix(voice): reset user away timer on final transcript#2063

Open
rosetta-livekit-bot[bot] wants to merge 1 commit into
mainfrom
sociably-caissons-simper
Open

fix(voice): reset user away timer on final transcript#2063
rosetta-livekit-bot[bot] wants to merge 1 commit into
mainfrom
sociably-caissons-simper

Conversation

@rosetta-livekit-bot

@rosetta-livekit-bot rosetta-livekit-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Source diff coverage

Coverage classification
Source file Classification Target file Notes
livekit-agents/livekit/agents/voice/agent_session.py Ported agents/src/voice/agent_session.ts Mapped the Python _user_input_transcribed behavior to the JS _onUserInputTranscribed event handler. Final transcripts still move away users back to listening; when user and agent are both listening, final transcripts now refresh _setUserAwayTimer().
tests/test_agent_session.py Adapted agents/src/voice/agent_session.test.ts Ported the Python test to Vitest/TypeScript by emitting user_input_transcribed events 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.ts passed.
  • pnpm test agents/src failed due existing/baseline agents/src/voice/amd.test.ts failures; rerunning pnpm test agents/src/voice/amd.test.ts independently produced the same 11 AMD classification/timing failures. The new agent session test passed in the full run.
  • pnpm build passed.
  • pnpm lint passed 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.md passed.
  • cue-cli runtime validation passed with a temporary validation agent: final transcript events occurred at 5476 ms and 6175 ms; US_AWAY occurred 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_timeout without changing user state. The existing awaylistening recovery path is unchanged.

Made with Cursor

@rosetta-livekit-bot
rosetta-livekit-bot Bot requested a review from a team as a code owner July 18, 2026 20:51
@changeset-bot

changeset-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2ec005e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 37 packages
Name Type
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-anthropic Patch
@livekit/agents-plugin-assemblyai Patch
@livekit/agents-plugin-azure Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-cerebras Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-did Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-fishaudio Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-hume Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-liveavatar Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-minimax Patch
@livekit/agents-plugin-mistral Patch
@livekit/agents-plugin-mistralai Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-perplexity Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-runway Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugin-soniox Patch
@livekit/agents-plugin-tavus Patch
@livekit/agents-plugins-test Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugin-xai Patch

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

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants