feat(cli): add 'session cleanup' to purge dead, stale sessions#1602
feat(cli): add 'session cleanup' to purge dead, stale sessions#1602DoozyX wants to merge 3 commits into
Conversation
Adds `session cleanup` to purge sessions whose tmux pane is gone and that have been untouched past a threshold, and routes the existing bulk deletes through the same single implementation so they can't drift apart. Liveness is probed per socket via ListSessionNamesOnSocket: a flat name-keyed probe built from one socket reports sessions living on an isolated socket as missing, which for a delete path means purging live work. If a socket's probe fails, every session on it is treated as alive and never purged — the safe direction for an irreversible operation.
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
What
session cleanuppurges sessions whose tmux pane is gone and that have been untouched past a threshold. It also routes the existing bulk deletes (session remove --all-erroredand friends) through the same single implementation, so the delete paths can't drift apart — previously each had its own notion of what was safe to remove.Why the liveness probe is per-socket
This is the part worth reviewing carefully, because it's a delete path.
Liveness is probed per socket via
ListSessionNamesOnSocket. A flat, name-keyed probe built from a single socket reports sessions living on an isolated socket as missing — and in a delete path, "missing" means purging live work. That's a data-loss bug, not a cosmetic one.Two safety properties:
Tests
cmd/agent-deckpasses with-race, including new coverage insession_cleanup_cmd_test.goand extendedsession_remove_kill_test.go.