-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Fix: Prevent cross-contamination of cache data across analysis modes #5075
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tlongwell-block
merged 1 commit into
block:main
from
wpfleger96:wpfleger/analyze-tool-cache-bug
Oct 8, 2025
Merged
Fix: Prevent cross-contamination of cache data across analysis modes #5075
tlongwell-block
merged 1 commit into
block:main
from
wpfleger96:wpfleger/analyze-tool-cache-bug
Oct 8, 2025
Conversation
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
Collaborator
Author
|
Now when I run the same test that I did in #5074, we see the complete and accurate results: |
Collaborator
|
Confirmed the bug and the fix locally |
tlongwell-block
approved these changes
Oct 8, 2025
Closed
michaelneale
added a commit
that referenced
this pull request
Oct 9, 2025
* main: (170 commits) Applied server side call to parse and save recipe (#5022) feat(prompt-library): add Code Documentation Migrator intermediate prompt (#4996) (#5051) Add Messy Column Fixer recipe (#5062) Cleanup temp files (#5081) add openmetadata recipe (#5076) Fix Hacktoberfest Leaderboard (#5080) adding brand guidelines to AGENTS.md (#4887) Fix: Prevent cross-contamination of cache data across analysis modes for `analyze` tool (#5075) fix: remove circular reference (#5018) Introduced a new prompt for content amplification that integrates multi-step workflows using official Goose extensions. Closes Issue #4998 (#5050) Add hint for focus mode when used on file paths for `analyze` tool (#5069) fix: use dynamic port allocation for OAuth server (#5019) Art vandelay: Import & Export (#5053) docs: misc updates for extensions directory (#5035) updating recipe scanner workflows for detecting recipes from forked repos (#5056) feat(prompt-library): add Smart Meeting Assistant advanced prompt (#4998) (#5031) Allow auto focus and typing while chat is initializing (#5043) docs(blog): Add blog for running Goose in containerized envs (#5052) fix: Add WINDOWS_CODESIGN_CERTIFICATE to nightly workflow (#5037) Developer `analyze` tool improvement (#5030) ...
tlongwell-block
added a commit
that referenced
this pull request
Oct 10, 2025
* origin/main: Improve Rust analysis output for `analyze` tool (#5072) Remove duplicate prepare_reply_context call (#5063) install react dev tools in development (#4979) Doc: Added powershell installation link to the guide (#5012) draft of new blog post about automating more automation (#5038) Subagent extension selection behavior fix (#5093) Add dev and alpha environment indicator (#5092) docs: add content carousel (#5086) Applied server side call to parse and save recipe (#5022) feat(prompt-library): add Code Documentation Migrator intermediate prompt (#4996) (#5051) Add Messy Column Fixer recipe (#5062) Cleanup temp files (#5081) add openmetadata recipe (#5076) Fix Hacktoberfest Leaderboard (#5080) adding brand guidelines to AGENTS.md (#4887) Fix: Prevent cross-contamination of cache data across analysis modes for `analyze` tool (#5075) fix: remove circular reference (#5018) Introduced a new prompt for content amplification that integrates multi-step workflows using official Goose extensions. Closes Issue #4998 (#5050) Add hint for focus mode when used on file paths for `analyze` tool (#5069) fix: use dynamic port allocation for OAuth server (#5019)
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.
Summary
This PR fixes a cache contamination bug where the
analyzetool's (from Developer extension) LRU cache would incorrectly return cached results from one analysis mode (e.g., Structure) when a different mode (e.g., Semantic) was requested. The root cause was that the cache key only included the file path and modification time, but not the analysis mode, allowing different modes to overwrite each other's cached data.The fix adds the
AnalysisModeenum as a third component to theCacheKeystruct, ensuring that each combination of (path, modified time, mode) creates a separate cache entry. This prevents Structure mode's lightweight directory data from contaminating Semantic mode's detailed AST analysis results, which was problematic when both modes were used sequentially in the same session and would cause the tool to return incomplete results.Type of Change
Testing
I added a unit test for validating cache separation, and I also tested this manually on a local codebase
Related Issues
Fixes #5074