Skip to content

don't update LastInteraction when only git hooks were triggered#550

Merged
khaong merged 4 commits intomainfrom
soph/stale-session-fixes
Mar 2, 2026
Merged

don't update LastInteraction when only git hooks were triggered#550
khaong merged 4 commits intomainfrom
soph/stale-session-fixes

Conversation

@Soph
Copy link
Collaborator

@Soph Soph commented Feb 27, 2026

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 LastInteractionTime which 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.

Copilot AI review requested due to automatic review settings February 27, 2026 20:30
@Soph Soph requested a review from a team as a code owner February 27, 2026 20:30
@cursor
Copy link

cursor bot commented Feb 27, 2026

PR Summary

Low Risk
Low risk: restricts LastInteractionTime updates to explicit session lifecycle/turn events, but could affect any logic that relied on commits keeping sessions “active” for cleanup or UX purposes.

Overview
Git commit (EventGitCommit) transitions no longer include the ActionUpdateLastInteraction side effect in PhaseIdle, PhaseActive, or PhaseEnded, so post-commit hooks won’t bump LastInteractionTime.

Tests are updated accordingly, including ApplyTransition coverage (condense/discard actions no longer imply a last-interaction update, and the handler-error test now only asserts the phase is still applied).

Written by Cursor Bugbot for commit ba20a2f. Configure here.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ActionUpdateLastInteraction from EventGitCommit transitions 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.

Soph and others added 3 commits March 1, 2026 21:56
Entire-Checkpoint: bf9a80c410b2
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 8a8eb3b01307
@khaong khaong enabled auto-merge March 2, 2026 00:00
Copy link
Contributor

@khaong khaong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@khaong khaong merged commit d2a4b03 into main Mar 2, 2026
3 checks passed
@khaong khaong deleted the soph/stale-session-fixes branch March 2, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants