chore: snapshot current state before cleanup

This commit is contained in:
kacper 2026-03-14 12:10:39 -04:00
parent db4ce8b14f
commit 94e62c9456
14 changed files with 489 additions and 3929 deletions

View file

@ -1045,7 +1045,7 @@ class WebRTCVoiceSession:
if self._stt_worker_task:
self._stt_worker_task.cancel()
with contextlib.suppress(asyncio.CancelledError):
with contextlib.suppress(asyncio.CancelledError, RuntimeError):
await self._stt_worker_task
self._stt_worker_task = None
@ -1313,10 +1313,15 @@ class WebRTCVoiceSession:
await self._gateway.bus.publish(
WisperEvent(role="wisper", text=f"voice transcript: {transcript}")
)
await self._gateway.send_user_message(
transcript,
metadata=dict(self._active_message_metadata),
)
try:
await self._gateway.send_user_message(
transcript,
metadata=dict(self._active_message_metadata),
)
except RuntimeError as exc:
if self._closed:
return
await self._publish_system(f"Could not deliver voice transcript: {exc}")
async def _close_peer_connection(self) -> None:
self._dc = None