#22589: fix: trigger failover on gateway websocket connection errors
channel: msteams
agents
size: S
## Summary
- Treat gateway/websocket transport disconnects as timeout failover signals.
- Cover common transport failures such as "Connection error", "gateway not connected", websocket disconnect text, and relevant gateway close codes.
- Add regression tests to ensure these errors map to timeout failover.
## Why
Issue #22576 reports that gateway↔cloud websocket disconnects show up as connection errors but do not trigger model failover. This change routes those transport failures into the existing timeout failover path.
## Validation
- `pnpm -s vitest run -c vitest.e2e.config.ts src/agents/pi-embedded-helpers.isbillingerrormessage.e2e.test.ts`
Most Similar PRs
#19077: fix(agents): trigger model failover on connection-refused and netwo...
by ayanesakura · 2026-02-17
66.5%
#22359: fix(agents): classify overloaded service errors as timeout
by AIflow-Labs · 2026-02-21
64.6%
#21033: fix(failover): classify connection errors as timeout for model fail...
by zerone0x · 2026-02-19
63.4%
#16944: fix: retry transient WebSocket 1006 closures in callGateway + annou...
by sudobot99 · 2026-02-15
63.2%
#19252: fix(agents): continue model fallback on failover text payloads
by mahsumaktas · 2026-02-17
63.1%
#6466: fix(gateway): add handshake timeout and connection error handling
by jarvis-raven · 2026-02-01
62.9%
#23355: Gateway: fail closed on untrusted proxy headers
by bmendonca3 · 2026-02-22
62.6%
#23714: Gateway: add websocket ingress limits for DoS hardening
by bmendonca3 · 2026-02-22
62.5%
#4108: gateway: hot-reload heartbeat when agents.list changes
by jifanchn · 2026-01-29
62.4%
#21516: fix: classify connection errors as timeout for model failover (#20931)
by echoVic · 2026-02-20
62.1%