Improvement to graceful teardown

We saw an issue in production whereby we were losing transcripts as part of not waiting long enough during graceful shutdown for them to be properly emitted (2 second timeout is current hardcoded default). I made this PR to try and mitigate this risk by making it a user configurable timeout: Feature - Configurable session close transcript timeout by bml1g12 · Pull Request #5328 · livekit/agents · GitHub

Would be grateful for review when the livekit team get the chance :clinking_beer_mugs:

Hi Benjamin, thanks for the contribution, the team just approved this with a minor comment

Thanks @darryncampbell I have made that change

A little off topic, but I don’t suppose you could check if anyone has time to review Update STT metrics to include token usage and emit gpt-realtime transcription STT token counts by bml1g12 · Pull Request #5029 · livekit/agents · GitHub too

Got it… If I were to guess, perhaps that got missed amongst all the release activity around 1.5 - I have pinged the team to ask.