narrow-hairdresser-82835
10/31/2025, 5:01 AMtall-airline-16756
10/31/2025, 5:01 AMtall-airline-16756
10/31/2025, 5:01 AMctx.add_shutdown_callback(), the agent can gracefully wrap up things like closing connections or freeing resources before the job fully stops.
So, to sum it up: room_finished is your external heads-up that a room has completed, while the shutdown callback helps with local cleanup inside the agent. I hope this helps clear things up! If you have any more questions, feel free to ask—we’re here to support you.
Sources: Webhooks | LiveKit Docs | Server-Side SDKs & Authentication | livekit/livekit_composite | DeepWiki | livekit-agents/livekit/agents/voice/room_io/room_io.py | Operational Guidance & Best Practices | livekit/livekit_composite | DeepWik... | agents/src/job.ts