Merge pull request #4201 from pipecat-ai/mb/handle-recurring-disconnects

Fix WebsocketService infinite reconnection loop
This commit is contained in:
Filipi da Silva Fuchter
2026-04-07 11:02:24 -03:00
committed by GitHub
4 changed files with 317 additions and 4 deletions

View File

@@ -0,0 +1 @@
- `WebsocketService` reconnection errors are now non-fatal. When a websocket service exhausts its reconnection attempts (either via exponential backoff or quick failure detection), it emits a non-fatal `ErrorFrame` instead of a fatal one. This allows application-level failover (e.g. `ServiceSwitcher`) to handle the failure instead of killing the entire pipeline.

1
changelog/4201.fixed.md Normal file
View File

@@ -0,0 +1 @@
- Fixed `WebsocketService` entering an infinite reconnection loop when a server accepts the WebSocket handshake but immediately closes the connection (e.g. invalid API key, close code 1008). The service now detects connections that fail repeatedly within seconds of being established and stops retrying after 3 consecutive quick failures.