Hey team, I just upgraded to 1.3.5 from 1.2.18 and...
# server-api
b
Hey team, I just upgraded to 1.3.5 from 1.2.18 and are seeing this issue consistently "livekit.agents.llm.realtime.RealtimeError: generate_reply timed out waiting for generation_created event" We are calling generate_reply without instructions:
session.generate_reply()
(Doing this instead works
await session.generate_reply(_instructions_=" ")
) I just discovered it works fine if we pass instructions, so maybe some bug/issue have crept in here? (example where you guys do the same) We are using Gemini realtime + Elevenlabs. This is working in 1.2.x but consistently happening in 1.3.1-1.3.5. We are passing in chat_history, so ideally we don't want to pass another instructions.
Copy code
./venv/bin/python main.py console
    Agents   Starting console mode 🚀
              
    11:43:43 DEBUG  asyncio          Using selector: KqueueSelector  
             INFO   livekit.agents   starting worker {"version": "1.3.1", "rtc-version": "1.0.19"}
             INFO   livekit.agents   initializing job runner {"tid": 51365078}
             DEBUG  asyncio          Using selector: KqueueSelector  
             INFO   livekit.agents   job runner initialized {"tid": 51365078, "elapsed_time": 0.0}
             INFO   livekit-agent    No metadata found, using test defaults  
             INFO   livekit-agent    Running in console mode, call_id: console-20251127-114343  
             DEBUG  livekit.plugins… connecting to Gemini Realtime API...  
             DEBUG  livekit.agents   using audio io: `Console` -> `AgentSession` -> `Console`  
             WARNI… livekit.agents   resume_false_interruption is enabled but audio output   {"audio_output": "Console"}
                                     does not support pause, it will be ignored                                         
             DEBUG  livekit.agents   using transcript io: `AgentSession` -> (none)  
    11:43:50 ERROR  livekit.agents   Error in _realtime_reply_task                                                      
                                     Traceback (most recent call last):                                                 
                                       File                                                                             
                                     "/Users/jensa/Development/projects/giant/livekit/livekit-agent/venv/lib/python3.1  
                                     3/site-packages/livekit/agents/utils/log.py", line 16, in async_fn_logs            
                                         return await fn(*args, **kwargs)                                               
                                                ^^^^^^^^^^^^^^^^^^^^^^^^^                                               
                                       File                                                                             
                                     "/Users/jensa/Development/projects/giant/livekit/livekit-agent/venv/lib/python3.1  
                                     3/site-packages/livekit/agents/voice/agent_activity.py", line 2058, in             
                                     _realtime_reply_task                                                               
                                         generation_ev = await self._rt_session.generate_reply(                         
                                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                         
                                             instructions=instructions or NOT_GIVEN                                     
                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                     
                                         )                                                                              
                                         ^                                                                              
                                     livekit.agents.llm.realtime.RealtimeError: generate_reply timed out waiting for    
                                     generation_created event.
âž• 1
Also, we are getting a thousand warnings like these:
Copy code
2:03:23.886 WARNI… opentelemetry.a… Attribute websocket: Invalid type      {"pid": 89065, "job_id":                
                                         ClientConnection for attribute value.  "AJ_fnLp7T9rawga", "room_id":           
                                         Expected one of ['NoneType', 'bool',   "RM_waiox5wEB3sb"}                      
                                         'bytes', 'int', 'float', 'str',                                                
                                         'Sequence', 'Mapping'] or a sequence                                           
                                         of those types                                                                 
    12:03:23.937 WARNI… opentelemetry.a… Attribute websocket: Invalid type      {"pid": 89065, "job_id":                
                                         ClientConnection for attribute value.  "AJ_fnLp7T9rawga", "room_id":           
                                         Expected one of ['NoneType', 'bool',   "RM_waiox5wEB3sb"}                      
                                         'bytes', 'int', 'float', 'str',                                                
                                         'Sequence', 'Mapping'] or a sequence                                           
                                         of those types                                                                 
    12:03:23.987 WARNI… opentelemetry.a… Attribute websocket: Invalid type      {"pid": 89065, "job_id":                
                                         ClientConnection for attribute value.  "AJ_fnLp7T9rawga", "room_id":           
                                         Expected one of ['NoneType', 'bool',   "RM_waiox5wEB3sb"}                      
                                         'bytes', 'int', 'float', 'str',                                                
                                         'Sequence', 'Mapping'] or a sequence                                           
                                         of those types
t
Hey @big-author-39928 even I'm noticing this frequently now I saw few issues related to this: https://github.com/livekit/agents/issues/2165 https://github.com/livekit/agents/issues/3560 Not sure if these are something related to what we are getting now. Team can we check on this?
I'm getting this error even in 1.2.18 version too. The catch is I'm not also simply calling generate_reply() without instructions. I am always passing generate_reply with instructions but even then getting this error. Can someone help me in this. Any help would be appreciated Source: https://github.com/hasan007-sudo/agents/blob/hasan/debug-gemini-live/examples/voice_agents/english_tutor.py Dev setup: Just add your gemini API key in addition to Livekit variables and it'll work
Copy code
livekit.agents.llm.realtime.RealtimeError: generate_reply timed out waiting for generation_created event.
2025-11-30 19:00:36,595 - ERROR asyncio - Task exception was never retrieved
future: <Task finished name='AgentActivity.realtime_reply' coro=<AgentActivity._create_speech_task.<locals>._context_aware_coro() done, defined at /Users/mohammedhasan/Github/Personal/agents/livekit-agents/livekit/agents/voice/agent_activity.py:367> exception=RealtimeError('generate_reply timed out waiting for generation_created event.')> 
Traceback (most recent call last):
  File "/Users/mohammedhasan/Github/Personal/agents/livekit-agents/livekit/agents/voice/agent_activity.py", line 371, in _context_aware_coro
    return await coro
           ^^^^^^^^^^
  File "/Users/mohammedhasan/Github/Personal/agents/livekit-agents/livekit/agents/utils/log.py", line 16, in async_fn_logs
    return await fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mohammedhasan/Github/Personal/agents/livekit-agents/livekit/agents/voice/agent_activity.py", line 1942, in _realtime_reply_task
    generation_ev = await self._rt_session.generate_reply(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        instructions=instructions or NOT_GIVEN
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
livekit.agents.llm.realtime.RealtimeError: generate_reply timed out waiting for generation_created event.
[Audio] cBook Air Microphone [-61.32 dBFS] [####--------------------------]%
b
yea looks like the same issue, try passing
" "
ie empty string with space, just empty string will get evaluated as NOT_GIVEN
t
Bro I'm always passing instructions to generate_reply but even then getting the same error that's what is phishy 😅
There's also some issue going on in gemini live https://github.com/google-gemini/live-api-web-console/issues/117 Hope this helps the team to debug further