Skip to content

fix(reliability): add LRU eviction to TmuxCaptureCache (#1433)#1542

Merged
OneStepAt4time merged 1 commit intodevelopfrom
fix/tmux-capture-cache-eviction
Apr 9, 2026
Merged

fix(reliability): add LRU eviction to TmuxCaptureCache (#1433)#1542
OneStepAt4time merged 1 commit intodevelopfrom
fix/tmux-capture-cache-eviction

Conversation

@OneStepAt4time
Copy link
Copy Markdown
Owner

Problem

TmuxCaptureCache had no eviction policy — dead session entries accumulated indefinitely, causing unbounded memory growth.

Changes

  • LRU eviction: Configurable maxEntries (default 100). When exceeded, oldest entries are evicted.
  • Access-order tracking: Cache hits move entries to most-recent position (via delete+reinsert in Map).
  • Session cleanup: New invalidateSession(prefix) method to bulk-remove entries for ended sessions.
  • Diagnostics: size getter for monitoring cache usage.
  • Backward compatible: Existing API unchanged; new parameters have sensible defaults.

Tests

  • All 33 existing + new tests pass
  • New tests: LRU eviction, access-order promotion, session invalidation, size tracking

Closes #1433

- Add configurable maxEntries (default 100) with LRU eviction
- Move accessed entries to most-recent position on cache hit
- Add invalidateSession() for bulk cleanup of dead session entries
- Add size getter for diagnostics
- Comprehensive test coverage for eviction, LRU ordering, and session cleanup
Copy link
Copy Markdown
Contributor

@aegis-gh-agent aegis-gh-agent bot left a comment

Choose a reason for hiding this comment

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

✅ Approved. LRU eviction for TmuxCaptureCache (#1433). Clean implementation using Map insertion order for true LRU. maxEntries default 100, session invalidation, size getter. 5 new tests. 2 files, CI green.

@OneStepAt4time OneStepAt4time merged commit ef5686b into develop Apr 9, 2026
9 checks passed
@OneStepAt4time OneStepAt4time deleted the fix/tmux-capture-cache-eviction branch April 9, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant