when does this come up ```2025-07-13 22:26:20.323...
# ask-ai
b
when does this come up
Copy code
2025-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"}
t
Thanks for reaching out, Mohammed. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
The log message
closing 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