Make Duo Chat WebSocket stream more resilient and improve error notification UX

Overview

The current Duo Chat web client surfaces a separate error message in the chat UI for every WebSocket error event, which creates a noisy and confusing experience for users. Additionally, there is no retry strategy in place, so transient connection failures result in a broken session with no recovery path.

This issue documents the requirements to make the WebSocket streaming layer more resilient and to improve how connection errors are communicated to users.

Requirements

Unified streaming indicator for connection errors

Instead of rendering a new error message for each WebSocket error event, the UI should display a single, persistent streaming indicator that informs the user that Duo Chat is attempting to reconnect to the Duo Agent platform. This reduces noise, avoids duplicated error messages, and gives users a clear, calm signal that recovery is in progress.

Exponential back-off with short-circuit mechanism

Implement a retry strategy for failed WebSocket connections that:

  • Automatically retries the connection after a failure.
  • Increases the wait interval between each successive retry attempt (exponential back-off), reducing pressure on the server during instability.
  • Terminates the reconnection loop after a configurable maximum number of failed attempts (short-circuit), preventing indefinite retries and surfacing a final error state to the user when recovery is not possible.