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 7e252ebf5..39cf06a10 100644 --- a/src/pipecat/services/grok/realtime/llm.py +++ b/src/pipecat/services/grok/realtime/llm.py @@ -676,7 +676,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 c25181dd1..25afc0ef1 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 689ca91a5..d603eda83 100644 --- a/src/pipecat/services/openai_realtime_beta/openai.py +++ b/src/pipecat/services/openai_realtime_beta/openai.py @@ -555,7 +555,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)