Fix incorrect cache hit/miss reporting for cache.get()#2418
Open
Harsh3006 wants to merge 3 commits into
Open
Conversation
Harsh3006
force-pushed
the
fix-cache-get-hit-miss
branch
2 times, most recently
from
July 15, 2026 19:50
8f05493 to
13bc758
Compare
Harsh3006
force-pushed
the
fix-cache-get-hit-miss
branch
from
July 15, 2026 19:56
13bc758 to
7af7a62
Compare
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
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.
Description
This change fixes incorrect cache hit/miss reporting in the Cache panel for
cache.get().Previously, the Cache panel determined whether a
cache.get()call was a hit or a miss solely based on whether the returned value wasNone. This resulted in two incorrect scenarios:A missing key with a supplied default (for example,
cache.get("missing", "default")) was reported as a cache hit, even though the value was not retrieved from the cache.A cached value of
Nonewas reported as a cache miss, even though the key existed in the cache.The Cache panel now correctly distinguishes between a missing cache key and a cached value equal to the caller's supplied default while preserving the existing
cache.get()behavior.Fixes #2417
Checklist:
docs/changes.rst.AI/LLM Usage