Is agent dispatch via api (say for agent name: “te...
# ask-ai
r
Is agent dispatch via api (say for agent name: “test-agent”) idempotent? i.e. is there a change multiple agent named
test-agent
would join the room if there is a double dispatch?
t
Thanks for reaching out, Goku. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Just a heads-up: when you dispatch an agent via the LiveKit API, it’s not automatically idempotent. So, if you send the same agent name (like "test-agent") more than once, you might end up with multiple dispatches—and that means the same agent could join the room multiple times if dispatched twice by accident. To avoid this, it’s a good idea to add your own idempotency checks on the client side. That way, you can make sure duplicate dispatches don’t sneak in. Sources: Dispatching agents | LiveKit Docs | Agent dispatch | LiveKit Docs | examples/agent-dispatch/index.ts | src/main/kotlin/io/livekit/server/AgentDispatchServiceClient.kt | livekit-api/livekit/api/agent_dispatch_service.py