fix: ghost session detection + kill/prune for stale entries (#93)#94
fix: ghost session detection + kill/prune for stale entries (#93)#94c-h- wants to merge 2 commits into
Conversation
When a session's real ID can't be resolved during launch, use `pending-<PID>` format so unresolved entries are identifiable. In the session tracker's poll cycle, reap stale entries: - Remove pending-* entries when a resolved session shares the same PID - Mark "running" sessions as stopped when their PID is dead Add PID-based dedup in listSessions() as a safety net so pending-* entries never appear alongside their resolved counterpart. Fixes #22 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
c-h-
left a comment
There was a problem hiding this comment.
Solid fix for #93 — ghost session reaping, PID reuse detection, kill/prune commands, and great test coverage (305 new test lines).
Code looks correct: the adapter PID map is the source of truth, pending-* dedup is clean, and the isProcessAlive/getProcessCommand DI makes everything testable.
One gap: README needs updating with the new kill and prune commands in the Quick Start / command reference section. Docs must stay current per our merge requirements. Happy to ship a follow-up commit if you want, or you can add it here.
Otherwise LGTM — will approve + merge once CI passes and docs are covered.
01cdf73 to
b3be1f7
Compare
|
Closing this PR — the underlying ghost session bug was addressed by the major architectural refactoring that landed on main. The new stateless daemon model means adapters own session truth. On every Additionally, The PR branch is based on v1.0.1 (before the refactor) and diverges from main by ~16K lines. Not worth rebasing — the fix is structurally already there. |
Pull request was closed
PID reuse detection, kill removes stopped sessions, prune has age threshold, force kill always works. Closes #93.