diff --git a/changelog/3960.fixed.md b/changelog/3960.fixed.md new file mode 100644 index 000000000..404569234 --- /dev/null +++ b/changelog/3960.fixed.md @@ -0,0 +1 @@ +- Fixed OpenAI Realtime, OpenAI Realtime Beta, and Grok realtime services treating `conversation_already_has_active_response` as a fatal error. These services now log it as a non-fatal debug event when a response is already in progress. diff --git a/src/pipecat/services/grok/realtime/llm.py b/src/pipecat/services/grok/realtime/llm.py index 30061af4a..9063ac22c 100644 --- a/src/pipecat/services/grok/realtime/llm.py +++ b/src/pipecat/services/grok/realtime/llm.py @@ -677,7 +677,10 @@ class GrokRealtimeLLMService(LLMService): elif evt.type == "response.function_call_arguments.done": await self._handle_evt_function_call_arguments_done(evt) elif evt.type == "error": - if evt.error.code == "response_cancel_not_active": + if evt.error.code in ( + "response_cancel_not_active", + "conversation_already_has_active_response", + ): logger.debug(f"{self} {evt.error.message}") else: await self._handle_evt_error(evt) diff --git a/src/pipecat/services/openai/realtime/llm.py b/src/pipecat/services/openai/realtime/llm.py index d1a90779e..23d044c5f 100644 --- a/src/pipecat/services/openai/realtime/llm.py +++ b/src/pipecat/services/openai/realtime/llm.py @@ -747,7 +747,10 @@ class OpenAIRealtimeLLMService(LLMService): await self._handle_evt_function_call_arguments_done(evt) elif evt.type == "error": if not await self._maybe_handle_evt_retrieve_conversation_item_error(evt): - if evt.error.code == "response_cancel_not_active": + if evt.error.code in ( + "response_cancel_not_active", + "conversation_already_has_active_response", + ): logger.debug(f"{self} {evt.error.message}") else: await self._handle_evt_error(evt) diff --git a/src/pipecat/services/openai_realtime_beta/openai.py b/src/pipecat/services/openai_realtime_beta/openai.py index 51fcc2720..d8f817ffc 100644 --- a/src/pipecat/services/openai_realtime_beta/openai.py +++ b/src/pipecat/services/openai_realtime_beta/openai.py @@ -556,7 +556,10 @@ class OpenAIRealtimeBetaLLMService(LLMService): await self._handle_evt_audio_transcript_delta(evt) elif evt.type == "error": if not await self._maybe_handle_evt_retrieve_conversation_item_error(evt): - if evt.error.code == "response_cancel_not_active": + if evt.error.code in ( + "response_cancel_not_active", + "conversation_already_has_active_response", + ): logger.debug(f"{self} {evt.error.message}") else: await self._handle_evt_error(evt)