Files
hermes-agent/agent
unsupportedpastels 85b85f1367 fix(cli): reconnect the classic CLI after a gateway restart
After `hermes gateway restart` (or an idle exit or crash), the interactive
classic CLI never re-attached. GatewayConnection kept its finished loop thread,
so start() returned early and every later call raised "Gateway disconnected",
even once another client had started a new gateway. The CLI then reported
each prompt as "The model request failed. Run /model to switch...".

- GatewayConnection dials again on the next call once the gateway has hung
  up. connect_gateway starts a gateway when none is running. The redial
  resumes every session the viewer had open before it counts as ready, so no
  frame of the new connection is missed. A failed redial is retried on the
  next call; close() and a failed first connect stay final.
- Each connect bumps `epoch`, and a connection's loss is tagged with it. A
  turn ignores a loss from an earlier epoch (lost_before), so a prompt that
  reconnected and was accepted is never reported as "outcome unknown". That
  report would invite the user to resend accepted work. A turn that was
  running when the gateway went away is still reported as unknown and is
  never resent.
- A lost gateway is the `gateway_connection` site failure: the CLI shows the
  transport error as written instead of the model-failure copy, and the
  error surface puts it on the gateway layer (no "Switch provider").
- `chat -q` whose turn a restart drain interrupted still exits 130, but now
  says so on stderr with the drain's reason instead of exiting silently.

Refs #134889
2026-10-14 20:05:34 -04:00
..
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 19:28:23 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 19:28:23 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
…
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 19:54:07 +02:00
2026-10-08 19:54:07 +02:00
2026-10-08 21:35:58 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 19:54:07 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 21:29:48 +02:00
2026-10-09 17:34:38 +02:00
2026-10-08 21:29:48 +02:00
2026-10-08 19:54:07 +02:00
2026-10-09 17:34:38 +02:00
2026-10-09 17:34:36 +02:00
2026-10-09 17:34:36 +02:00
2026-10-08 21:29:48 +02:00