feat: add output pagination to impact radius#39
Closed
n24q02m wants to merge 1 commit intotirth8205:mainfrom
Closed
feat: add output pagination to impact radius#39n24q02m wants to merge 1 commit intotirth8205:mainfrom
n24q02m wants to merge 1 commit intotirth8205:mainfrom
Conversation
Add truncation metadata to get_impact_radius results and expose max_results parameter in the tools layer. On large codebases, impact radius can return thousands of nodes, producing 500K+ character MCP responses that blow up context windows. Now results are capped at max_results (default 500) with truncated flag and total_impacted count so the caller knows when results are incomplete. Changes: - graph.py: get_impact_radius returns truncated/total_impacted - tools.py: get_impact_radius adds max_results parameter, passes to graph layer, includes truncation info in summary Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
tirth8205
added a commit
that referenced
this pull request
Mar 20, 2026
- Multi-word AND search logic for search_nodes (#37 by n24q02m) - Resolve same-file bare call targets to qualified names (#38 by n24q02m) - Output pagination with truncation flag for impact radius (#39 by n24q02m) - Update tests to handle qualified call targets from _resolve_call_targets Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
|
Integrated into main via a344eaf. Thanks for the contribution! Impact radius pagination with truncation flag is now live. |
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.
Summary
On large codebases,
get_impact_radiuscan return thousands of nodes, producing 500K+ character MCP responses that blow up context windows and cause timeouts.This PR adds output pagination with truncation metadata:
max_resultsparameter (default: 500) caps impacted nodes returnedtruncatedboolean flag indicates when results are incompletetotal_impactedinteger shows the full count before truncationThe BFS traversal itself already had a
max_nodesparameter ingraph.pybut it was not exposed to the tools layer, and the results lacked truncation metadata.Changes
code_review_graph/graph.py:get_impact_radius()now returnstruncatedandtotal_impactedin results dictcode_review_graph/tools.py:get_impact_radius()addsmax_resultsparameter, passes to graph layer, includes truncation info in summary and responseTest plan
max_results=10returns exactly 10 nodes withtruncated=Truetruncated=Falsemax_results=500does not change behavior for small codebases