-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
pipecat version
0.0.100
Python version
No response
Operating System
No response
what we have tried:
As a workaround, we subclassed PipelineTask and overrode the entire _heartbeat_monitor_handler method to add our custom logic. It works, but it's fragile since we're duplicating the entire method implementation and it could break with future updates.
Question
Hey!
We just started using heartbeats in our pipeline - really helpful feature for detecting blocked pipelines.
One thing we noticed: when a timeout occurs (no heartbeat frame received within 10 seconds), the only feedback is a warning log. There's no way for consumers to react programmatically - for example, to emit metrics, trigger alerts, or cancel the pipeline.
Other timeout scenarios like idle detection have an on_idle_timeout event handler that consumers can subscribe to. It would be great to have the same pattern for heartbeat timeouts.
Proposal
- Add an
on_heartbeat_timeoutevent handler that fires when a heartbeat frame is not received within the expected time window - Make the heartbeat monitor timeout configurable (currently hardcoded to 10x the heartbeat interval via
HEARTBEAT_MONITOR_SECS)
The changes are minimal but definitely impactful.
Happy to create a PR for this if the approach sounds good!
Context
No response