Files
hermes-agent/apps/shared
Teknium 0eb58f214c fix(desktop): a card answered over a dropped socket stays open and says so
A server request's `respond` sent its frame with `this.transport?.send(...)`
and latched itself answered first, so with the socket gone (detached
transport, or a closing WebSocket whose `send` drops frames silently) the
answer went nowhere while `respondToServerRequest` deleted the request and
returned true. The sudo card closed as if the password had been sent, and
the backend kept waiting for a reply that never came.

- `ServerRequest.respond`/`fail` return `false` when nothing was sent; the
  channel only settles a request once a frame reached a bound transport, and
  the WebSocket transport throws instead of dropping frames on a non-open
  socket. The canonical prompt route returns `false` likewise.
- `respondToServerRequest` keeps an unsent request open, so
  `hasOpenServerRequest` tells "already closed" from "not sent".
- The sudo, secret and vault (unlock / save-login / code) cards answer
  through one helper that raises the existing "Hermes is offline right now"
  error when the request is still open, so the card stays up to answer again
  once reconnected. Approval cards fall back to `approval.respond`, which
  rejects while disconnected; setup-beat and theme-pick cards already stay up
  on `false`.
2026-12-01 17:02:25 -08:00
..