agents
agents copied to clipboard
fix: resolve audio dropout after AgentTask completion
Fixed critical bugs causing agent to go silent after nested workflow agents (AgentTasks) complete:
-
Audio recognition not recreated on resume:
- When activity is paused for AgentTask handover, _close_session() closed audio_recognition but didn't set it to None
- On resume, _start_session() skipped recreation because the check
if self._audio_recognition is Nonewas False - Fix: Set audio_recognition, rt_session, and realtime_spans to None after closing them in _close_session()
-
Atomic handover with prestart pattern:
- Added prestart() to create audio_recognition before activity swap
- Added complete_start() to finish startup after swap
- Reordered _update_activity() to prestart new activity before pausing old one, eliminating ~100-200ms audio gap
-
Transcript buffering during handover:
- Buffer transcripts received during prestart mode
- Replay them after complete_start() finishes
-
Additional race condition fixes:
- Fixed generation futures not marked done on interruption
- Fixed async generator cleanup race conditions
- Added auth_lock for authorization operations on SpeechHandle
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.
:white_check_mark: tomc98
:x: TC
TC seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.
Could you please share a minimal PoC agent to reproduce this issue? Thanks!