Guard _drain_cancelled_response against None websocket

This commit is contained in:
Paul Kompfner
2026-03-31 10:32:47 -04:00
parent 657a5def57
commit 0fb45c6114

View File

@@ -622,6 +622,10 @@ class OpenAIResponsesLLMService(_BaseOpenAIResponsesLLMService, WebsocketLLMServ
state and returns — ``_ensure_connected`` will handle reconnection
before the next inference.
"""
if not self._websocket:
self._clear_cancellation_state()
return
logger.debug(f"{self}: Draining cancelled response events")
try:
while True: