don't update LastInteraction when only git hooks were triggered#550
don't update LastInteraction when only git hooks were triggered#550
Conversation
Entire-Checkpoint: dd07617714d9
PR SummaryLow Risk Overview Tests are updated accordingly, including Written by Cursor Bugbot for commit ba20a2f. Configure here. |
There was a problem hiding this comment.
Pull request overview
This PR adjusts the session phase state machine so that git commit hooks no longer count as “user interaction” and therefore do not keep sessions alive by updating LastInteractionTime, enabling stale-session cleanup to work as intended.
Changes:
- Remove
ActionUpdateLastInteractionfromEventGitCommittransitions across IDLE/ACTIVE/ENDED phases. - Update unit tests to reflect the new transition action sets and updated expectations around
LastInteractionTime.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
cmd/entire/cli/session/phase.go |
Removes ActionUpdateLastInteraction from EventGitCommit transition results so commits don’t refresh session “activity”. |
cmd/entire/cli/session/phase_test.go |
Updates transition/apply-transition tests to match the new GitCommit behavior and expectations. |
Entire-Checkpoint: bf9a80c410b2
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Entire-Checkpoint: 8a8eb3b01307
khaong
left a comment
There was a problem hiding this comment.
LGTM. Git commit hooks only ever self-transition on phase, so removing ActionUpdateLastInteraction from EventGitCommit paths is correct and complete. Also pushed a small fix for the stale comment on LastInteractionTime in state.go.
I noticed a lot of sessions still sitting around locally. And what jumped out was that all of them were constantly updated. Turns out that the commit hooks kept looking at older sessions - which is fine - but also kept bumping
LastInteractionTimewhich made them never going to be cleaned up. Now a commit isn't really an interaction in a session, so let's not do this in this case.