Skip to content

fix: warn when active session count exceeds threshold#672

Open
mvanhorn wants to merge 1 commit intoentireio:mainfrom
mvanhorn:osc/591-fix-orphaned-session-warning
Open

fix: warn when active session count exceeds threshold#672
mvanhorn wants to merge 1 commit intoentireio:mainfrom
mvanhorn:osc/591-fix-orphaned-session-warning

Conversation

@mvanhorn
Copy link
Contributor

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 doctor or entire clean.

Changes

  • cmd/entire/cli/strategy/session_warning.go - New file with warnIfTooManySessions() function that checks session count and rate-limits warnings to once per hour
  • cmd/entire/cli/strategy/manual_commit_hooks.go - Single 2-line addition calling the warning check at the top of PostCommit
  • cmd/entire/cli/strategy/session_warning_test.go - Tests for above/below threshold and rate limiting

Context

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 doctor and entire clean commands 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

  • Warning fires when session count > 10
  • No warning at or below threshold
  • Warning rate-limited to once per hour
  • gofmt and go vet clean

This contribution was developed with AI assistance (Claude Code).

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

1 participant