[CI] Fix realtime WebSocket timeout deadlock and unhandled model validation errors (#37483)

Signed-off-by: Andreas Karatzas <akaratza@amd.com>
This commit is contained in:
Andreas Karatzas
2026-03-25 11:24:33 +01:00
committed by GitHub
parent e9ae3f8077
commit 9ac2fcafbb
2 changed files with 83 additions and 3 deletions
@@ -102,7 +102,14 @@ class RealtimeConnection:
event_type = event.get("type")
if event_type == "session.update":
logger.debug("Session updated: %s", event)
self._check_model(event["model"])
model = event.get("model")
if model is None:
await self.send_error("Missing required field: model", "invalid_event")
return
err = self._check_model(model)
if err is not None:
await self.send_error(err.error.message, "model_not_found")
return
self._is_model_validated = True
elif event_type == "input_audio_buffer.append":
append_event = InputAudioBufferAppend(**event)
@@ -140,6 +147,7 @@ class RealtimeConnection:
err_msg,
"model_not_validated",
)
return
commit_event = InputAudioBufferCommit(**event)
# final signals that the audio is finished