Skip to content

Fix stale playout state across multi-step voice turns#5533

Open
jayeshp19 wants to merge 2 commits intolivekit:mainfrom
jayeshp19:Fix-stale-playout-state-across-multi-step-voice-turns
Open

Fix stale playout state across multi-step voice turns#5533
jayeshp19 wants to merge 2 commits intolivekit:mainfrom
jayeshp19:Fix-stale-playout-state-across-multi-step-voice-turns

Conversation

@jayeshp19
Copy link
Copy Markdown
Contributor

@jayeshp19 jayeshp19 commented Apr 23, 2026

Summary

This change makes interruption handling depend on whether the current generation is actively in playout, instead of only checking for the presence of a current SpeechHandle.

Changes

  • track active playout on the current generation
  • clear playout state on _advance_step()
  • reuse shared playout start/finish handling in AgentActivity
  • add regression tests for started vs unstarted interruption behavior

Verification

  • uv run ruff check tests/test_agent_session.py
  • uv run pytest tests/test_agent_session.py -k 'advance_step_resets_playout_state or interrupt_by_audio_activity' -q
  • uv run pytest tests/test_agent_session.py::test_interruption_before_speaking tests/test_agent_session.py::test_interruption tests/test_agent_session.py::test_tool_call -q

Copy link
Copy Markdown
Contributor

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

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 4 additional findings.

Open in Devin Review

@jayeshp19 jayeshp19 force-pushed the Fix-stale-playout-state-across-multi-step-voice-turns branch from efc3ae3 to efcb35c Compare April 24, 2026 08:15
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