fix: warn when active session count exceeds threshold#672
Open
mvanhorn wants to merge 1 commit intoentireio:mainfrom
Open
fix: warn when active session count exceeds threshold#672mvanhorn wants to merge 1 commit intoentireio:mainfrom
mvanhorn wants to merge 1 commit intoentireio:mainfrom
Conversation
When the number of active session state files exceeds 10, display a one-line warning on stderr suggesting 'entire doctor' or 'entire clean'. The warning is rate-limited to once per hour via a timestamp file in the session state directory. Addresses entireio#591. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5 tasks
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.
Summary
Partially addresses #591
Adds visibility for orphaned session accumulation by warning users when the active session count exceeds 10. This is a lightweight improvement - the warning fires during PostCommit and suggests running
entire doctororentire clean.Changes
cmd/entire/cli/strategy/session_warning.go- New file withwarnIfTooManySessions()function that checks session count and rate-limits warnings to once per hourcmd/entire/cli/strategy/manual_commit_hooks.go- Single 2-line addition calling the warning check at the top of PostCommitcmd/entire/cli/strategy/session_warning_test.go- Tests for above/below threshold and rate limitingContext
Issue #591 reports a user who accumulated 76 orphaned sessions over 18 days without any warning, causing 3GB+ RAM usage and multi-minute commit times. The
entire doctorandentire cleancommands already exist to fix this, but users don't know to run them. This PR adds early visibility.This is a visibility improvement, not the full fix. The broader auto-cleanup and async hooks suggested in #591 are larger scope items.
Test plan
gofmtandgo vetcleanThis contribution was developed with AI assistance (Claude Code).