fix: dropped realtime call sometimes shows "Voice connection failed" (#32730)

When the voice provider ended a realtime call, the overlay sometimes said "Voice connection failed" instead of "Voice provider connection closed". It happened when microphone audio reached the server at the same moment the provider hung up, so forwarding that audio failed and the generic error was shown. Anything that fails to reach the provider because it just closed the connection now reports that the provider closed the call.

Fixes #32729
This commit is contained in:
Classic298 2026-10-20 21:45:54 +02:00 • committed by GitHub
parent 6c61227d90
commit cd74e6d126
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -549,6 +549,9 @@ async def realtime_call(ws: WebSocket):
detail = (
str(exc)
if type(exc) is ValueError
# A send can still fail on the provider connection that just closed.
else 'Voice provider connection closed'
if isinstance(exc, aiohttp.ClientConnectionResetError)
else ('Voice connection timed out' if isinstance(exc, TimeoutError) else 'Voice connection failed')
)
log.info('Bridge closed: user_id=%s error_type=%s', user.id if user else None, type(exc).__name__)