Overview
Pipeline idle detection monitors activity in your pipeline and can automatically cancel tasks when no meaningful interactions are occurring. This helps prevent pipelines from running indefinitely when a conversation has naturally ended but wasn’t properly terminated.How It Works
The system monitors specific “activity frames” that indicate the bot is actively engaged in the conversation. By default, these are:BotSpeakingFrame- When the bot is speakingUserSpeakingFrame- When the user is speaking (from VAD)UserStartedSpeakingFrame- When a user turn startsInterimTranscriptionFrameandTranscriptionFrame- When the user’s speech is transcribed, for pipelines where the provider detects turns instead of VAD
Idle detection only starts after the pipeline has begun processing frames. The
idle timer resets whenever an activity frame (as specified in
idle_timeout_frames) is received.Configuration
You can configure idle detection behavior when creating aPipelineWorker:
Configuration Parameters
float | None
default:"300"
Timeout in seconds before considering the pipeline idle. Set to
None to
disable idle detection.tuple[type[Frame], ...]
Frame types that should prevent the pipeline from being considered idle.
bool
default:"True"
Whether to automatically cancel the pipeline worker when idle timeout is
reached. With the default
cancel_runner_on_idle_timeout=True, this also
cancels the WorkerRunner and every other worker in it; see
PipelineWorker.