Repository navigation
fix(client): evict expired cache entries and bound cache size with LRU - #35
Open
techkayacodes wants to merge 1 commit into
Open
techkayacodes wants to merge 1 commit into
techkayacodes wants to merge 1 commit into
Conversation
techkayacodes
requested review from
guptadevik2003,
iamDyeus and
sujal-maheshwari2004
as code owners
December 2, 2026 00:43
|
Thanks for the pull request, @techkayacodes! Before a maintainer reviews it, please check the contribution process:
Pull requests that do not follow the process may be closed. |
3 tasks
This branch has not been deployed
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.
Evicts expired cache entries and bounds client cache size with LRU eviction in
PromptClient.Changes
PromptClient._cacheto anOrderedDictguarded by_cache_lockand add an optionalcache_max_entries=1024parameter (rejecting non-positive values)._cache_get()and_cache_set()shared byget()andlist():move_to_end(), and inserts exceedingcache_max_entriesevict any remaining expired entries first, then the least recently used entry.tests/test_client.pycovering expiredget()/list()cleanup, deletion on lookup when a refetch fails, LRU eviction withcache_max_entries, and validation of non-positive limits.Verification
get()calls, 100 expiringlist()calls, LRU eviction, and invalid limit rejection.Closes #26