steep-balloon-41261
05/28/2026, 6:03 AMtall-airline-16756
05/28/2026, 6:03 AMtall-airline-16756
05/28/2026, 6:03 AMawait session.start() guarantees the OpenAI Realtime websocket is fully connected and ready for immediate update_chat_ctx() / generate_reply() calls.
Short answer: No.
Reason: The startup flow creates the realtime session and schedules its _main_task() (which runs _create_ws_conn() and starts `_send_task`/`_recv_task`) with asyncio.create_task(...) but does not await it. The docs do not state that session.start() waits for the websocket handshake or for send/recv tasks to be running, so a message sent immediately after session.start() can race with the connection and risk timeouts like the 5s update_chat_ctx() window.
If you want, I can suggest safe patterns to ensure readiness (e.g., an explicit ready event or polling strategy). Which would you prefer?
Sources: Agent session | LiveKit Documentation | Realtime models overview | LiveKit Documentation, with interactive elementsfamous-match-9235
05/28/2026, 6:04 AMtall-airline-16756
05/28/2026, 6:05 AM