livekit-agents@1.2.8
livekit/agentslivekit-agents@1.2.8Sep 2, 2025by theomonnom
AI Summary
Introduces `AgentSession.start()` improvements for testability, automatic handling of false interruptions, and support for LangGraph subgraphs.
Key Highlights
- AgentSession.start() returns RunResult when capture_run=True.
- Automatic resume of false interruptions after timeout.
- Support for subgraphs in LLMAdapter.
- Support for interrupting agent during long-running function tools.
- Improved handling of datastream audio output.
New Features
- RunResult capture for testing.
- Auto-resume for false interruptions.
- LangGraph subgraph support.
- Interrupt support for long-running tools.
Full Release Notes
## Features: - [AgentSession.start()](https://github.com/livekit/agents/blob/713988e3741a1498d373593c030c0fbd28262284/livekit-agents/livekit/agents/voice/agent_session.py#L401C15-L401C20) now returns a `RunResult` when called with `capture_run=True`. This makes it possible to assert the first message when the agent initiates the conversation: ```python result = await sess.start(EchoAgent(), capture_run=True) result.expect.next_event().is_agent_handoff(new_agent_type=EchoAgent) result.expect.next_event().is_message(role="assistant") ``` - Agent false interruptions are now automatically resumed after the `false_interruption_timeout`. Audio output is paused and then resumed on the same `SpeechHandle`, eliminating the need to manually call `generate_reply()` in the `agent_false_interruption` event handler—please remove this call if present from earlier versions. This behavior is enabled by default; to disable automatic resume, set `resume_false_interruption=False`. ## What's Changed * fix: start datastream audio output right after room connected by @longcw in https://github.com/livekit/agents/pull/3270 * add AudioOutput capabilities and disable pause/resume for if output not supported by @longcw in https://github.com/livekit/agents/pull/3269 * fix (11labs): fix empty text input and timeout for the first audio chunk by @longcw in https://github.com/livekit/agents/pull/3284 * chore: switch to gpt-realtime as default OAI realtime model by @davidzhao in https://github.com/livekit/agents/pull/3287 * fix(plugins:elevenlabs): fix exception in STT when serializing bool form field tag_audio_events by @mike-r-mclaughlin in https://github.com/livekit/agents/pull/3282 * primary speaker detection with STT diarization by @longcw in https://github.com/livekit/agents/pull/3186 * add capture_run for AgentSession.start by @longcw in https://github.com/livekit/agents/pull/3288 * chore: add test for empty tts streams by @davidzhao in https://github.com/livekit/agents/pull/3286 * fix say method not being captured by RunResult by @theomonnom in https://github.com/livekit/agents/pull/3291 * support interrupting agent by interim transcripts by @longcw in https://github.com/livekit/agents/pull/3278 * allow SpeechHandle to be interrupted when long-running function tools are pending by @longcw in https://github.com/livekit/agents/pull/3280 * fix: disable false interruption resume for realtime model by @longcw in https://github.com/livekit/agents/pull/3298 * feat(langgraph): support subgraphs in LLMAdapter and normalize astream outputs by @bnovik0v in https://github.com/livekit/agents/pull/3112 * feat: add more llm and stt models to mistralai plugins by @fabitokki in https://github.com/livekit/agents/pull/3300 * chore(langchain): fix types by @davidzhao in https://github.com/livekit/agents/pull/3303 ## New Contributors * @bnovik0v made their first contribution in https://github.com/livekit/agents/pull/3112 **Full Changelog**: https://github.com/livekit/agents/compare/livekit-agents@1.2.7...livekit-agents@1.2.8