Skip to content

Conversation

@tomc98
Copy link

@tomc98 tomc98 commented Dec 5, 2025

Fixed critical bugs causing agent to go silent after nested workflow agents (AgentTasks) complete:

  1. 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 None was False
    • Fix: Set audio_recognition, rt_session, and realtime_spans to None after closing them in _close_session()
  2. 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
  3. Transcript buffering during handover:

    • Buffer transcripts received during prestart mode
    • Replay them after complete_start() finishes
  4. 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

Fixed critical bugs causing agent to go silent after nested workflow
agents (AgentTasks) complete:

1. 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 None` was False
   - Fix: Set audio_recognition, rt_session, and realtime_spans to None
     after closing them in _close_session()

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

3. Transcript buffering during handover:
   - Buffer transcripts received during prestart mode
   - Replay them after complete_start() finishes

4. 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
@CLAassistant
Copy link

CLAassistant commented Dec 5, 2025

CLA assistant check
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.

✅ tomc98
❌ 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.

@Hormold
Copy link
Contributor

Hormold commented Dec 5, 2025

Could you please share a minimal PoC agent to reproduce this issue? Thanks!

@tomc98 tomc98 force-pushed the sophiie-fork-1.3.6 branch from 5951c95 to 72551bb Compare December 9, 2025 23:46
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.

3 participants