fix(voice): capture the full on_enter output when starting with capture_run - #6872
Open
biztex wants to merge 1 commit into
Open
fix(voice): capture the full on_enter output when starting with capture_run#6872biztex wants to merge 1 commit into
biztex wants to merge 1 commit into
Conversation
…re_run start(capture_run=True) never watched the on_enter task on the run state, unlike the handoff path (_update_activity_task). The run completed as soon as the first speech handle did, so a generate_reply issued after an awaited say never reached the RunResult, and an on_enter that produced no speech left the run without any watched handle, hanging start() forever. Start the activity through _update_activity_task so on_enter is watched the same way a handoff already does. Fixes livekit#4662
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.
Problem:
start(capture_run=True)completed itsRunResultas soon as the first speech handle finished, because nothing watched theon_entertask on the run state. Anon_enterthat awaits asay()and then callsgenerate_reply()had the reply silently dropped from the run's events — and anon_enterthat produces no speech left the run with no watched handle at all, hangingstart()forever.The handoff path already solved this:
_update_activity_taskwatcheson_enteron the active run so the run stays open for everythingon_entertriggers, without blocking on it.start()bypassed that by calling_update_activitydirectly.Start the activity through
_update_activity_taskinstead, so session start and handoff share the one implementation. A hermetic regression test covers both shapes: a two-speechon_enterwhose second reply must land in the run's events, and a silenton_enterthat must still complete the run.Of the other observations in the issue: the duplicated handoff events no longer reproduce on current main (the run-state watch and
created_at-ordered insertion resolved them), and chat-context-change events are a separate enhancement.Fixes #4662