From 9df1e18b431f65f6aa16f47a627549bfa4f838f4 Mon Sep 17 00:00:00 2001 From: Paul Kompfner Date: Fri, 3 Apr 2026 16:27:57 -0400 Subject: [PATCH] Fix Gemini Live session resumption hanging after reconnect After a reconnect, _ready_for_realtime_input was never set back to True because _create_initial_response (which sets the flag) is only called on initial connection. This caused all audio/video/text to be silently dropped after reconnecting, making the bot appear to hang. Set the flag in _handle_session_ready when context already exists (i.e. reconnect case) since we don't need to go through _create_initial_response again. --- src/pipecat/services/google/gemini_live/llm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pipecat/services/google/gemini_live/llm.py b/src/pipecat/services/google/gemini_live/llm.py index 276120f7e..66900fc6e 100644 --- a/src/pipecat/services/google/gemini_live/llm.py +++ b/src/pipecat/services/google/gemini_live/llm.py @@ -1360,6 +1360,9 @@ class GeminiLiveLLMService(LLMService): if self._run_llm_when_session_ready: self._run_llm_when_session_ready = False await self._create_initial_response() + elif self._context: + # Reconnect case: context already exists, no need for _create_initial_response + self._ready_for_realtime_input = True async def _handle_msg_model_turn(self, msg: LiveServerMessage): """Handle the model turn message."""