Can the client check if the agent finished shutting down?

From the frontend I call room.disconnect() and then I call a backend service `/end to pull some data from Redis that I set in the Agent shutdown callback.

The issue is that `/end` is called too soon, way before the Agent shutdown callback is done.

What's a good way for to check if the Agent shutdown callback is done executing.

Maybe have the agent publish an event to your webhook or something when the important part of the shutdown hook completes?

1 Like

Don’t use room.disconnect() / ParticipantDisconnected as your sync point. Instead, have the agent explicitly ACK completion: after the Redis write in the shutdown logic, call a webhook/backend endpoint (e.g. /agent-finished). Then /end should wait for (or check) that “finished” flag before reading Redis. This removes the race and avoids relying on room timing.

1 Like