big-controller-60015
07/22/2025, 6:54 PM2025-07-13 22:26:20.323
2025-07-13 16:56:20,322 - DEBUG livekit.agents - closing agent session due to participant disconnect {"participant": "participant_identity0i3ZgtdF15", "reason": "CLIENT_INITIATED", "pid": 3158, "job_id": "AJ_aTQRApMXoAuJ"}tall-airline-16756
07/22/2025, 6:54 PMtall-airline-16756
07/22/2025, 6:55 PMclosing agent session due to participant disconnect with reason CLIENT_INITIATED means that a LiveKit agent session is being closed automatically because the participant it was linked to has disconnected, and the disconnect was initiated by the client (for example, the participant left the room or closed their connection).
This occurs when:
• The agent session has close_on_disconnect set to True (the default)
• The linked participant disconnects from the room
• The disconnect reason is CLIENT_INITIATED, ROOM_DELETED, or USER_REJECTED
If you want to prevent the agent session from closing automatically when a participant disconnects, set RoomInputOptions.close_on_disconnect=False when configuring your agent.
This mechanism helps clean up agent resources when users intentionally leave, preventing orphaned sessions.
Sources: livekit-agents/livekit/agents/voice/agent_session.py | livekit-ffi/protocol/participant.proto