Files
hermes-agent/apps
kshitijk4poor 3f87a8090c fix(desktop): fold the stale-RPC guard into runtime-gone and refund heal budget on rebind
The salvaged #95647 commits predate runtime-gone.ts and shipped their own
gone-latch (session-rpc-guard.ts) beside the one main already had. Fold
them: one latch, one classifier, one clear seam.

- session-gone-latch.ts is a dependency-free leaf holding the latch, the
  4001 classifier (now also rejecting "mentions session not found" tool
  strings and unwrapping IPC bridge prefixes), and the rebind seam. It
  exists because session-request-router — imported by every store — must
  clear the latch after a successful session.resume/activate without
  pulling the session/tile stores into its import graph.
- runtime-gone.ts re-exports the leaf and keeps the heal logic.
- A successful rebind now also refunds the stored session's heal budget.
  markRuntimeGone caps consecutive heals at 3 per stored id and only a
  successful process.list refunded it, so a backend that reaps a detached
  runtime a few times left the view stuck on a phantom id with every
  poller latched and the socket-reconnect global clear (removed by the
  salvaged commit) re-arming the storm. #100639: 1,230 approval.pending
  4001s on one runtime id in 42 minutes, zero recovery.

Refs #100639
2026-09-02 12:31:33 +05:30
..