Reduce MCP review latency via shared changed-file resolution + bounded auto-detection#457
Open
Bakul2006 wants to merge 1 commit into
Open
Reduce MCP review latency via shared changed-file resolution + bounded auto-detection#457Bakul2006 wants to merge 1 commit into
Bakul2006 wants to merge 1 commit into
Conversation
Contributor
Author
|
Hey @tirth8205 Just tried adding the Cache memory In the MCP Calls To improve the latency please review if the approach is correct or I should think of another way . Core idea is to make the MCP calls Stateful in some way. |
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.
Issue #262
What Changed
New shared resolver
Added:
in:
This centralizes changed-file resolution for all review-oriented tools.
Resolution order:
changed_filesThe resolver returns both resolved files and metadata:
Bounded auto-detection
Auto-detection is now intentionally bounded.
Default timeout:
(configurable)
Instead of allowing long-running internal detection paths to stall MCP workflows, the resolver now fails fast and returns structured guidance.
This prevents multi-minute hangs during agent execution.
Short-lived shared cache
Added a thread-safe changed-file cache with configurable TTL.
Default TTL:
(configurable)
This allows consecutive MCP tool calls in the same review workflow to reuse resolved changed files instead of repeatedly invoking git detection logic.
This is especially beneficial for agent orchestration patterns where multiple tools are called back-to-back.
Wired Into Review Tools
The shared resolver is now used by:
detect_changes_func()get_review_context()get_affected_flows_func()get_impact_radius()get_minimal_context()This keeps behavior consistent across review flows.
User-Facing Behavior
When automatic changed-file detection exceeds the configured timeout and no files are resolved, tools now return explicit guidance indicating that callers should provide
changed_filesdirectly for fast execution.This replaces previous silent stalls / timeout-heavy behavior.
Configuration
New environment variables:
These can be tuned per environment / deployment.
Performance Impact
Expected improvements: