Skip to content

fix: release stale transcript gates and playout pauses - #7083

Open
chenghao-mou wants to merge 2 commits into
mainfrom
chenghao/fix/AGT-3421-clear-stale-transcript-gate
Open

fix: release stale transcript gates and playout pauses#7083
chenghao-mou wants to merge 2 commits into
mainfrom
chenghao/fix/AGT-3421-clear-stale-transcript-gate

Conversation

@chenghao-mou

@chenghao-mou chenghao-mou commented Sep 1, 2026

Copy link
Copy Markdown
Member

Problem: False or overlapping speech could leave held transcripts or a parent response active after the interruption ended. The stale state produced concurrent speaking spans and could block uninterruptible tool speech, preventing transfers.

Behavior: Resolve playout before replaying held STT events. When a tool disables interruptions, release its parent response from any false-interruption pause so queued speech can run.

Addresses AGT-3421

Initial prompt and agent context

Model: GPT-5.6

Can you investigate /Users/chenghao/Downloads/observability-RM_2pkD3uFikQDD.zip? There are several concurrent user_speaking spans. I wonder if this is triggered by STT concurrent transcripts.

okay, add the tests and fix it

should we move the trace log into _flush_held_transcripts?

yes please

Held STT start-of-speech events were replayed while agent playout still appeared active, which rearmed the gate. Mark playout inactive first and release any stale gate or buffered transcripts at agent speech end.
@chenghao-mou
chenghao-mou requested a review from a team as a code owner September 1, 2026 11:56

@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.

Note

This report is out of date. Scroll down for Devin Review's latest report on this PR.

✅ Devin Review: No Issues Found

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

Devin Review

chenghao-mou added a commit to livekit/agents-js that referenced this pull request Sep 1, 2026
Replayed STT speech-start events observed active agent playout and rearmed the transcript gate. End playout before replay and release stale buffered events at agent speech end.

Ports livekit/agents#7083 at c27a885e.
RunContext.disallow_interruptions() could leave its current speech paused by false-interruption handling. A tool that awaited session.say() then deadlocked behind the paused parent. Route the state change through the owning activity so it releases only that handle's pause.
@chenghao-mou chenghao-mou changed the title fix: clear stale transcript gate after agent speech fix: release stale transcript gates and playout pauses Sep 1, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

@chenghao-mou
chenghao-mou force-pushed the chenghao/fix/AGT-3421-clear-stale-transcript-gate branch from 1dfa299 to 36f2ec4 Compare September 1, 2026 18:35
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.

1 participant