better-gigabyte-88039
07/31/2025, 1:56 PMtall-airline-16756
07/31/2025, 1:56 PMtall-airline-16756
07/31/2025, 1:57 PMCLIENT_INITIATED, ROOM_DELETED, or USER_REJECTED. This is controlled by the close_on_disconnect option in RoomInputOptions, which is set to True by default. You can disable this by setting RoomInputOptions.close_on_disconnect=False.
• Auto-Disconnect Configuration: When accepting job requests, you can use the auto_disconnect parameter to configure automatic disconnection behavior. For example: await job_request.accept(
TextStreamingAgent.create,
identity="text-streaming-agent",
name="Text Streaming Agent",
auto_disconnect=agents.AutoDisconnect.DEFAULT,
)
• Room-Level Automatic Closure: The room will automatically close when the last non-agent participant leaves, and any remaining agents will be disconnected. This ensures agents do not remain in empty rooms.
These features help manage agent sessions efficiently and ensure proper cleanup when participants leave.
Sources: livekit-agents/livekit/agents/voice/room_io/room_io.py | server/agent.py | Anatomy of an Agent | LiveKit Docs | Anatomy of an Agent | LiveKit Docs | Anatomy of an Agent | LiveKit Docsbetter-gigabyte-88039
07/31/2025, 1:59 PM2025-07-31 10:52:34,380 - DEBUG livekit.agents - stream closed {"participant": "participant_session_1753218125818120_2025-07-31T10:52:18.545638", "source": "SOURCE_MICROPHONE", "pid": 4802, "job_id": "AJ_yZoEeF5myT2x"}
2025-07-31 10:52:58,120 - WARNING livekit - livekit::rtc_engine:453:livekit::rtc_engine - received session close: "signal client closed: \"stream closed\"" UnknownReason Resume {"pid": 4802, "job_id": "AJ_yZoEeF5myT2x"}
2025-07-31 10:52:58,123 - INFO livekit.agents - process exiting {"reason": "", "pid": 4802, "job_id": "AJ_yZoEeF5myT2x"}tall-airline-16756
07/31/2025, 2:00 PMdeparture_timeout setting, which is usually set to 20 seconds by default.
• If no one comes back during that time, the room closes and the agents get disconnected.
Because of this, you might see some extra connection minutes being counted since the room stays open during that timeout. If you’d rather skip that, you can always delete the room manually when the call ends instead of waiting for the automatic timeout.
If you want, I’m here to help you figure out how to set this up or manage the departure timeout settings—just let me know!
Sources: pkg/rtc/room.go | packages/livekit-server-sdk/src/RoomServiceClient.ts | livekit-rtc/livekit/rtc/room.py | livekit-protocol/src/livekit.rs | protobufs/livekit_room.proto