You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
tower reconcile: failed reconnect triggers delete + SIGTERM without verifying the shellper is dead (destroyed 53 live sessions in the #1629 incident) #1686
Split from #1629's investigation (credit: builder-bugfix-1629). Reconcile Phase 2 (tower-terminals.ts:920-937) deletes the session row and SIGTERMs the pid for any shellper whose reconnect attempt merely FAILED — without verifying the process is actually dead or the socket file gone. In the #1629 incident this is the half that did the damage: the hijacking Tower's reconnects failed (sessions were owned by the real Tower — one-client-per-shellper), and Phase 2 destroyed 53/56 live rows on that failure alone.
The exposure is broader than the second-Tower scenario: any transient reconnect failure at boot (socket hiccup, slow shellper, fd pressure — see #1685's environment) can delete a live agent's row and signal its process, on a perfectly legitimate single Tower.
Fix shape
Reconnect failure must be treated as "could not confirm", not "dead":
Before delete/SIGTERM, require positive evidence of death: pid liveness check (process.kill(pid, 0) fails) AND/OR socket file absent — the same stale test the startup log already prints for genuinely dead sessions.
A row that fails reconnect but whose pid is alive is left in place (logged WARN, retried next reconcile/adoption pass) — never signaled.
#1629's owner-lock guard (in flight for 3.3.4) prevents the second-Tower amplifier; this issue removes the destructive mechanism. Both are needed: the guard can't stop a single-Tower transient from triggering this path. Small, candidate for 3.3.4 if a lane moves fast, otherwise 3.3.5.
Activity
amrmelsayed commentedon Sep 16, 2026
On it! Working on a fix now.
Fix #1686: reconcile must confirm death before deleting/SIGTERMing a …
[Bugfix #1686] Adopt review ruling: pid-down is the sole proof of death
[Bugfix #1686] Address PR CMAP notes: stale comments, pid-dead test
Merge pull request #1693 from cluesmith/builder/bugfix-1686
[Spec 1658][Phase: phase_2] feat: shellper named-pipe transport, per-…
Fix #1877: delete a shellper row whose pid was reused, without signal…
[Spec 1658] Windows tests after the main merge: #1877 start-time help…