salmon-application-59042
11/17/2025, 10:54 PMconst roomService = new RoomServiceClient(
process.env.LIVEKIT_URL!,
process.env.LIVEKIT_API_KEY!,
process.env.LIVEKIT_API_SECRET!
);
const roomOpts: CreateOptions = {
name: roomName,
emptyTimeout: 60, //1 minute timeout
metadata: JSON.stringify(voiceAgentConfig), // pass metadata to configure the agent
};
const room = await roomService.createRoom(roomOpts);
the agent joins the room successfully. But I tried to read the room metadata via _ctx_.room.metadata in the entrypoint() function, and it was not set. Why would this happen?tall-airline-16756
11/17/2025, 10:55 PMtall-airline-16756
11/17/2025, 10:55 PMctx.room.metadata inside the entrypoint() function:
• First, room metadata needs to be explicitly set when the room is created or updated afterward. So, please double-check that the metadata was correctly included in the CreateRoom request or updated using UpdateRoomMetadata.
• Also, if you're working within an agent implementation, keep in mind that ctx.room.metadata becomes available only after the agent successfully connects to the room using await ctx.connect(). If you try to access it before the connection, it might not show up yet.
If your goal was to pass configuration or initialization data to the agent, these steps are key to verify. And if you’re dealing with job-specific information, a great alternative is to use job metadata, which you can access via ctx.job.metadata.
I hope this helps clarify things! If you have any more questions or need further assistance, feel free to ask. We're here to support you every step of the way!
Sources: Room metadata | LiveKit Docs | Job lifecycle | LiveKit Docs | livekit/livekit_room.pb.go