wooden-librarian-60399
12/02/2025, 8:42 PMtall-airline-16756
12/02/2025, 8:42 PMtall-airline-16756
12/02/2025, 8:42 PMRoomConfiguration.agents, or SIP dispatch rules.
You can A/B test by implementing the split in your own backend before calling LiveKit:
• Use your backend to randomly (or via experiment IDs) choose Agent A or B per room with your desired distribution.
• Call the Agent Dispatch API (or set RoomConfiguration.agents in the room token) with the chosen agent name to create the room/dispatch.
If you’d like, I can:
• Give a short code example in your preferred language showing a 50/50 dispatch decision and the corresponding API call, or
• Suggest ways to log/measure which agent handled each room for experiment analysis.
Which would you prefer?
Sources: Agent dispatch | LiveKit docs | SIP dispatch rule | LiveKit docsmodern-winter-66316
12/02/2025, 8:49 PMtall-airline-16756
12/02/2025, 8:49 PMwindow.LiveKit. Update your script tag to:
<script src="https://cdn.jsdelivr.net/npm/livekit-client@1.15.0/dist/livekit-client.umd.min.js"></script>
• Verify:
console.log(window.LiveKit); // should be defined
const { Room } = window.LiveKit;
1. Capture the disconnect reason
• Add a listener to see why the client disconnected:
room.on('disconnected', (reason) => {
console.error('Disconnected:', reason);
});
Common reasons: duplicate identity, join failure, room deleted, or an explicit room.disconnect() call.
1. Check for accidental disconnect calls or identity conflicts
• Search your frontend/backend for any room.disconnect() calls or logic that might end the session after connect.
• Make sure each participant identity is unique (duplicate identities cause immediate disconnect).
1. Ensure your agent dispatch flow runs after a stable join
• Agent dispatch relies on a stable participant. If your client disconnects right away, the agent won’t be created.
• If you dispatch via backend, call the Agent Dispatch API after confirming the participant has fully joined (or use server-side logic tied to your connect endpoint).
If you want, I can:
• Provide a short code example (Node/Python) that does a 50/50 backend A/B dispatch and calls the Agent Dispatch API, or
• Help interpret any disconnect reason you get from step 2 — paste the exact value and I’ll explain next steps.
Which would you like me to do next?
Sources: Agent dispatch | LiveKit docs | SIP dispatch rule | LiveKit docs | Connecting to LiveKit | LiveKit docstall-airline-16756
12/02/2025, 8:50 PM