fix: reset completed session on resume to prevent age limit false positives

When Claude Code resumes after mac sleep without proper SessionEnd hook,
createSDKSession was reusing the old completed row with stale started_at_epoch,
causing all observations and summaries to be blocked by the 4h wall-clock limit.

Now detects completed sessions on resume and resets started_at_epoch to now.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
JOUNGWOOK KWON
2026-04-16 19:24:21 +09:00
parent 70a150db74
commit 79170f007a
5 changed files with 327 additions and 296 deletions
File diff suppressed because one or more lines are too long