Skip to content

fix(sessions): a resume restarts the interactive lifetime clock (v0.456.2) - #861

Merged
vikasprogrammer merged 1 commit into
mainfrom
feat/lifetime-resume
Oct 8, 2026
Merged

vikasprogrammer merged 1 commit into
mainfrom
feat/lifetime-resume

Conversation

@vikasprogrammer

Copy link
Copy Markdown
Owner

Problem

instawp ses_b0c1c60670dedbac (agent qa, interactive, created 2026-09-25) was reaped with reason: max-lifetime five times in two days — 1–30 min after each resume by its owner, once mid-turn. The lifetime ceiling (interactiveMaxHours, 168h) measured from created_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

  • New term_sessions.opened_at, stamped on a deliberate re-open: markResumed (attach resume), unpause, and restoreResurrectedCrashes when a human is attached (not on agent activity alone).
  • Lifetime ceiling measures COALESCE(opened_at, created_at). Never-re-opened zombies age out unchanged.
  • session.reaped on a lifetime reap records lifetimeHours + openedAt (it printed the 72h idleHours, pointing at the wrong knob).
  • Console copy for the setting mentions the reset.

Tests

scripts/idle-reaper-test.cjs 73/73 (3 new), full npm run test:governance green.

🤖 Generated with Claude Code

…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>
@vikasprogrammer
vikasprogrammer merged commit 5e04e16 into main Oct 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant