feat: auto-detect and mark dead agents on startup#44
Conversation
On startup, hcom now scans all non-inactive instances with tracked PIDs. If the PID is no longer alive (e.g. after system reboot), it saves a life.stopped snapshot (compatible with hcom r <name>) and cleans up bindings. Hook-based agents without PIDs are handled by existing heartbeat staleness detection. - mark_dead_instances() in instance_lifecycle.rs - Called from main.rs before router::dispatch()
|
AI review: PR #44 - Dead-Agent Reboot RecoveryBranch: Files touched: VerdictSalvage the idea, reject the implementation shape. The useful capability is faster cleanup after reboot or process death. That belongs inside the existing lifecycle cleanup path. This PR adds a parallel cleanup function, runs it from What The PR Adds
Blockers
What To Keep
Required Shape
Merge RecommendationDo not merge as-is. Accept a small refactor that adds PID-reuse-aware liveness to the existing lifecycle cleanup machinery. |
Summary
On startup, hcom now scans all non-inactive instances with tracked PIDs. If the PID is no longer alive (e.g. after system reboot), it saves a life.stopped snapshot (compatible with
hcom r <name>) and cleans up bindings. Hook-based agents without PIDs are handled by existing heartbeat staleness detection.Changes
mark_dead_instances()insrc/instance_lifecycle.rs— PID-based dead detectionmain.rsbefore router::dispatch()