Files
t3code/apps/server
Ben DavisandClaude Fable 5 d22d5ac00f fix: reconnect no longer cancels interactions a live plugin still holds
`resumeSessionAfterReconnect` cancelled pending approvals/user-input before
asking whether the plugin survived. A bare socket drop leaves the plugin
process alive with its request dicts intact and the turn genuinely blocked
on an answer — cancelling wiped the request from the UI while Hermes kept
waiting for a response that could no longer be given, hanging the thread.

Cancellation now keys off the resume outcome: a session.ready carrying an
activeTurnId means the process (and its dicts) survived, so the requests
stay on screen and remain answerable over the replacement socket; no
activeTurnId or a failed resume means they died with the process, and they
are cancelled exactly as before. The stopped-mid-flight early return also
no longer cancels on a context that stopped routing events.

The existing cancellation test modelled a restart but reported the turn as
surviving — the exact combination that cannot occur (dicts are per-process)
and the one the old code got wrong. It now reports no active turn, and a
sibling test pins the surviving-turn case to zero resolved/warning events.

Flagged by Macroscope on #4678 (discussion_r3660942051).

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-27 14:24:06 -07:00
..