agents icon indicating copy to clipboard operation
agents copied to clipboard

agent_name field in WorkerOptions does not work

Open aman-think41 opened this issue 4 months ago • 0 comments

When I don't add a name in the worker options, the agent joins in the room with no problems. But if I add the agent_name in the WorkerOptions, then the agent does not join, and there are no logs for any error.

I tried debugging the issue, the worker is getting registered fine. But when the web socket connection is established it is not able to receive any request. But, with no agent_name it works fine

I also tried a workaround using request_fnc, doing this to change the name:

async def request_fnc(req: JobRequest):
    await req.accept(
        name = "AskMe"
    )

But with this I have to add a sleep of 1 second in the entrypoint function to make things work, which is not a good solution. Reason for this sleep is that if I don't add it, then in this logic fails:

lkapi = api.LiveKitAPI()
        
        response = await lkapi.room.list_rooms(api.ListRoomsRequest(names=[room_name]))
        usecase_id = response.rooms[0].metadata

with an error saying rooms array is empty, so it takes some time for the room to get registered in the backend (I think). Hence added the sleep, which is working for now.

Any resolutions for this problem, or is it coming on my system only?

aman-think41 avatar Oct 23 '24 04:10 aman-think41