lively-terabyte-73999
07/22/2025, 5:15 AMtall-airline-16756
07/22/2025, 5:16 AMtall-airline-16756
07/22/2025, 5:17 AMerror property if the closure was due to an error.
• Disconnected Event: This event is emitted when any participant (including agents) is disconnected from the room. It provides a reason for the disconnection, such as participant removal or room deletion.
• participant_disconnected Event: This handler is called when any participant, including agents, leaves the room.
For agent-specific logic, subscribing to the CloseEvent is recommended. For general participant tracking, use the Disconnected or participant_disconnected events.
Agents can also end their participation programmatically using ctx.shutdown(reason="Session ended"), which will trigger these events.
Sources: Connecting to LiveKit | LiveKit Docs | agent/game_host.py | Inside a session | LiveKit Docs | Anatomy of an Agent | LiveKit Docs | Events and error handling | LiveKit Docs