Hey LiveKit team — we’re seeing a failure mode wit...
# telephony
i
Hey LiveKit team — we’re seeing a failure mode with outbound voice agents (Python, LiveKit Agents + Telnyx). If the agent has a config bug during startup (e.g., invalid Deepgram model), the agent crashes right after AgentSession.start is kicked off, but the SIP leg still gets placed, so the callee lands in an empty room that never tears down. Looking for guidance/best practices on: 1. How to gate placing the SIP call until STT/LLM/TTS are actually ready, and 2. How to cleanly abort/close the room when initialization fails so the user isn’t left hanging. Any recommended pattern or API hooks to synchronize “agent ready” before dialing, or to force room cleanup on init errors? Thanks ahead of time
l
Interesting, most of the error handling logic assumes something goes wrong at runtime rather than during setup. I think in this case, the best thing to avoid having some issue with the model configuration would be to specify a fallback adapter to catch issues and fallback to a working configuration: https://docs.livekit.io/agents/build/events/#fallbackadapter There is an error handler, and an example here that you may have seen, https://github.com/livekit/agents/blob/main/examples/voice_agents/error_callback.py, but that error handler will not be called if there was an error during initialisation,.
i
Thanks for the follow-up. We ended up going with a small "pre-flight" check that pumps a frame through our configured STT/TTS providers and throws an error if it fails. Its not super ideal but it pretty decent right now. I'll checkout the fallback adapter as well. That could some solid redundancy across the board.