Skip to content

fix(cache): preserve disk cache entries on lookup - #2423

Open
remote-controlled-man wants to merge 2 commits into
abetlen:mainfrom
remote-controlled-man:codex/prflow-1e211cc0daf9
Open

remote-controlled-man wants to merge 2 commits into
abetlen:mainfrom
remote-controlled-man:codex/prflow-1e211cc0daf9

Conversation

@remote-controlled-man

Copy link
Copy Markdown

LlamaDiskCache removes a matching state when reading it, so a later query or reopened cache cannot reuse that prefix. Read the saved state without consuming the entry.

Add SQLite-backed regression tests for repeated exact, longer, shorter and divergent-prefix lookups, cache misses, and reopening after a hit, with RAM-cache controls. Keep existing capacity and eviction behavior.

Related historical discussion: #1737 and closed, unmerged #2025. This is a focused fix for destructive reads; no static-cache API or capacity-policy change.

Validation on macOS arm64, Python 3.12.14, using the existing native build and cached model fixtures:

  • Original lookup: 5 new regressions fail; 8 controls pass.
  • Fixed lookup: all 13 new cases pass.
  • Full make test: 39 passed, including the upstream real-model fixtures and all 13 new cache cases.
  • Full make lint: Ruff checks pass and all 30 Python files pass the format check.

Copilot AI balanced review requested due to automatic review settings November 19, 2026 04:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

This branch has not been deployed

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

2 participants