Reduce MCP review latency via shared changed-file resolution and safe cache invalidation#552
Open
Bakul2006 wants to merge 3 commits into
Open
Reduce MCP review latency via shared changed-file resolution and safe cache invalidation#552Bakul2006 wants to merge 3 commits into
Bakul2006 wants to merge 3 commits into
Conversation
6 tasks
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.
Pull Request
Addressed Review Feedback
Thanks for the detailed review. I've updated this PR to address the concerns raised while preserving the original optimization intent of reducing repeated changed-file detection across MCP review workflows.
What changed
Added validation for Git refs before subprocess invocation using the existing safe ref checks.
Routed changed-file resolution through VCS detection to preserve SVN compatibility.
Avoided caching timeout/empty detection results to prevent cache poisoning across subsequent calls.
Revisited untracked file handling so newly added files are included in review workflows.
Resolved merge conflicts against the latest
main.Added focused unit tests covering:
Original intent preserved
This optimization is still designed specifically for short-lived MCP review orchestration bursts where multiple tools execute against effectively identical repository state.
The goal remains to avoid repeated changed-file detection during multi-tool review flows while failing fast when automatic detection is slow.
Validation
main.Thanks again for the review and guidance. I'd appreciate another pass whenever you have time.
Linked issue
#457
Closes #457
What & why
How it was tested
Checklist
uv run pytest tests/ --tb=short -quv run ruff check code_review_graph/uv run mypy code_review_graph/ --ignore-missing-imports --no-strict-optionaldocs/, docstrings)