fix(voice): bound EndCallTool wait for tool-reply playout - #7186
Open
usmamalik345 wants to merge 2 commits into
Open
fix(voice): bound EndCallTool wait for tool-reply playout#7186usmamalik345 wants to merge 2 commits into
usmamalik345 wants to merge 2 commits into
Conversation
Wrap the speech_handle await in TOOL_REPLY_TIMEOUT so a hanging tool reply still reaches finally and shuts down the session (livekit#5096). Co-authored-by: Cursor <cursoragent@cursor.com>
|
|
On the timeout path, force-interrupt the hanging speech and call shutdown(drain=False) so close is not blocked waiting for the same unfinished reply. Successful playout still drains normally. Co-authored-by: Cursor <cursoragent@cursor.com>
Author
|
Addressed the Devin review note:
|
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
_delayed_session_shutdownalready wraps the wait forspeech_createdinasyncio.wait_for(..., timeout=5.0), but then does a bareawait speech_handlefinallynever runs andctx.session.shutdown()is skipped — room/delete_roomcleanup never happens (SIP can stay up)TOOL_REPLY_TIMEOUT, keep the existing warning + shutdown pathCloses #5096 (timeout asymmetry only; not Gemini instruction-following).
Testing
pytest tests/test_tools.py::test_delayed_session_shutdown_times_out_when_speech_handle_hangs— fails on main (hangs), passes with the fixspeech_creatednever fires; handle completes normallyruff check/ruff formatclean on touched files