hermes-agent/web/src
Austin Pickett 2382f50f53
fix(dashboard): bound WS ticket minting on the events + PTY sockets (supersedes #81931) (#81978)
* fix(dashboard): retry stalled events feed reconnects

* fix(dashboard): bound the PTY ticket request before the socket exists

ChatPage's connect awaits a single-use ticket from `api.buildWsUrl()`
before `new WebSocket()`. That request produces no socket, so a
rejection or a hang emits no `close` event and never arms
PTY_CONNECTING_TIMEOUT_MS (set after the socket is constructed). The
tab stranded on "connecting" with `connectInFlightRef` stuck true,
which also suppresses the page-resume reconnect path.

Give the ticket phase its own deadline and route both failure modes
into the existing backoff. A `ticketSuperseded` flag invalidates a late
ticket result so a timed-out attempt cannot open a socket behind the
replacement it scheduled, and cleanup clears the timer on unmount.

`scheduleReconnect` now takes `number | null` so an attempt that died
before any socket existed omits the "(code N)" banner suffix instead of
inventing one.

Same bug class as the events-feed fix in the preceding commit, on the
main chat surface.

Co-authored-by: Gille <4317663+helix4u@users.noreply.github.com>

* test(dashboard): cover the PTY ticket connect deadline

Mirrors the events-feed cases in ChatSidebar.test.tsx: a rejected ticket
retries, a stalled ticket times out and its late resolution cannot open
a superseded socket, and a settled ticket disarms the deadline so
PTY_CONNECTING_TIMEOUT_MS remains the only guard on a wedged handshake
(NS-591 regression).

Both failure cases fail against ChatPage.tsx without the preceding fix.

Co-authored-by: Gille <4317663+helix4u@users.noreply.github.com>

---------

Co-authored-by: Gille <4317663+helix4u@users.noreply.github.com>
2026-08-08 16:01:02 -04:00
..
components fix(dashboard): bound WS ticket minting on the events + PTY sockets (supersedes #81931) (#81978) 2026-08-08 16:01:02 -04:00
contexts fix(sec): update npm deps to resolve `npm audit` warnings 2026-07-31 13:42:03 -04:00
hooks Merge remote-tracking branch 'origin/main' into refactor/use-ds-primitives 2026-05-28 14:20:49 -04:00
i18n salvage(#51128): translate new session-filter strings across 17 locales; expose public get_session_rich_row for search hydration 2026-07-28 22:41:56 -07:00
lib fix(dashboard): bound WS ticket minting on the events + PTY sockets (supersedes #81931) (#81978) 2026-08-08 16:01:02 -04:00
pages fix(dashboard): bound WS ticket minting on the events + PTY sockets (supersedes #81931) (#81978) 2026-08-08 16:01:02 -04:00
plugins fix(plugins): keep loading gate when cached manifests include a /chat override 2026-08-03 18:48:04 +05:30
themes fix(web): theme terminal foreground and restore backdrop plugin slot 2026-06-29 12:30:24 -07:00
App.tsx fix(sec): update npm deps to resolve `npm audit` warnings 2026-07-31 13:42:03 -04:00
index.css feat(web): add Arabic (ar) locale with RTL support 2026-07-24 12:10:00 -05:00
main.tsx fix(sec): update npm deps to resolve `npm audit` warnings 2026-07-31 13:42:03 -04:00