Repository navigation
ai: enforce response cache TTL on lookup - #747
Draft
OllieinCanada wants to merge 1 commit into
Draft
OllieinCanada wants to merge 1 commit into
OllieinCanada wants to merge 1 commit into
Conversation
The daemon reuses its cached provider across reviews. Startup cleanup alone lets that provider replay responses after their configured TTL. Retain the TTL and check creation time on every lookup. Expired responses follow the existing miss path and are replaced after a successful refresh. Saturate duration arithmetic so large accepted TTL values cannot wrap and cause startup cleanup to delete fresh entries. Add offline regressions for expiry without reopening and large TTLs. Check fresh hits, token accounting and persistence after refresh, and document validity checks separately from physical cleanup. Fixes: 7ff827d ("ai: add local response cache provider") Signed-off-by: Ollie Slapinski <oliverslapinski@hotmail.com>
OllieinCanada
marked this pull request as draft
October 26, 2026 00:58
Sashiko review✓ No issues found across 1 commit. |
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.
A running daemon can replay responses older than response_cache_ttl_days because expiration is checked only when the cache opens.
Retain the TTL and filter expired responses on every lookup. Preserve existing cache keys and schema. Safe duration conversion also prevents very large accepted TTLs from deleting fresh entries.
Two offline regressions fail before the fix and pass afterward. All seven cache tests pass. Rust 1.90.0: make check-pr passed with 1150 tests passed, two ignored, formatting and three Clippy profiles. The inherited RUST_LOG override was unset.
DRAFT: required local model self-review remains incomplete because provider authentication failed. No clean local review is claimed. Keep as draft until required review completes.
Base: d7c69ae
Head: 4139008