Guard against None context ID in append_to_audio_context

After interruption, both _playing_context_id and _turn_context_id are
None. If a subclass calls append_to_audio_context(None, frame), the
recovery path matches (None == None) and creates a bogus audio context
that blocks the handler from ever processing the real context.

Early-return when context_id is falsy to prevent this.
This commit is contained in:
Mark Backman
2026-03-10 11:25:59 -04:00
parent d5c0789ab5
commit 50cc01a578

View File

@@ -1182,6 +1182,9 @@ class TTSService(AIService):
context_id: The context to append audio to.
frame: The audio or control frame to append.
"""
if not context_id:
logger.debug(f"{self} unable to append audio to context: no context ID provided")
return
if self.audio_context_available(context_id):
logger.trace(f"{self} appending audio {frame} to audio context {context_id}")
await self._audio_contexts[context_id].put(frame)