Repository navigation
fix(sessions): a resume restarts the interactive lifetime clock (v0.456.2) - #861
Merged
Merged
Conversation
…56.2) The 168h lifetime ceiling measured age from created_at, so any session older than a week was reaped on the next sweep after every resume. Stamp term_sessions.opened_at on a deliberate re-open and measure from it; the lifetime reap audit now records lifetimeHours instead of idleHours. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
instawp
ses_b0c1c60670dedbac(agentqa, interactive, created 2026-09-25) was reaped withreason: max-lifetimefive times in two days — 1–30 min after each resume by its owner, once mid-turn. The lifetime ceiling (interactiveMaxHours, 168h) measured fromcreated_at, and nothing reset it, so a >7-day-old session could never stay up past the next sweep unless a browser terminal happened to be attached at that instant.Fix
term_sessions.opened_at, stamped on a deliberate re-open:markResumed(attach resume), unpause, andrestoreResurrectedCrasheswhen a human is attached (not on agent activity alone).COALESCE(opened_at, created_at). Never-re-opened zombies age out unchanged.session.reapedon a lifetime reap recordslifetimeHours+openedAt(it printed the 72hidleHours, pointing at the wrong knob).Tests
scripts/idle-reaper-test.cjs73/73 (3 new), fullnpm run test:governancegreen.🤖 Generated with Claude Code