tui: auto-reconnect WebSocket with exponential backoff
...
A dropped server socket no longer leaves the TUI stranded. WsBridge now
runs a supervisor that connects, forwards events until the socket closes,
then backs off and reconnects indefinitely — the only thing that ends it is
stop(). The status panel flips to 'reconnecting…' and the next message the
user sends is held in the input queue until a fresh socket is live, so a
brief blip doesn't eat their input (send failures requeue + force a
reconnect; nothing is lost).
Backoff: 1s→2s→4s… cap 30s, reset on success; stop() cancels it promptly.
Interface preserved (start/stop/.client/.connected); an optional client=
param lets tests inject a fake client.
Co-Authored-By: Claude <noreply@anthropic.com>
Eugene Sukhodolskiy
committed
1 day ago