When creating a token, I set empty_timeout to 40 s...
# ask-ai
b
When creating a token, I set empty_timeout to 40 seconds, dispatched the agent, and then wait for the user to join. However, when the token is created and the user does not join, I found that it waits up to 300 seconds before timing out. Why is this happening?
t
Thanks for reaching out, 최윤지. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks for sharing what you’re seeing with the
empty_timeout
parameter! I’d love to help clarify what might be happening with how LiveKit handles room creation and configuration: • Token-Based Configuration: The
empty_timeout
value in the token only kicks in if the participant using that token is the very first to join and create the room. If the room already exists, the token’s settings for lifecycle options like
empty_timeout
won’t be applied. • Server Defaults: LiveKit servers come with default room configurations (for example,
empty_timeout: 300
) that take effect unless you specifically override them when creating the room through the RoomServiceClient. • Explicit Room Creation: To make sure the
empty_timeout
is set exactly how you want, it’s best to specify it directly when you create the room using the RoomServiceClient API. Here are a few steps you might consider to get this sorted: 1. Check whether the room is being auto-created through the token or if it’s explicitly created via the API. 2. Review your server’s default settings for
empty_timeout
. 3. Try using the RoomServiceClient to explicitly set
empty_timeout
when creating the room. If you’d like, I’m here to help walk you through verifying your setup or even creating a test scenario to see how this behaves. Just let me know! Sources: protobufs/livekit_room.proto | src/main/kotlin/io/livekit/server/AccessToken.kt | livekit-api/livekit/api/access_token.py | config-sample.yaml | packages/livekit-server-sdk/src/RoomServiceClient.ts