fix(strands-command): inline full PR diffs within a total budget#63
Open
yonib05 wants to merge 2 commits into
Open
fix(strands-command): inline full PR diffs within a total budget#63yonib05 wants to merge 2 commits into
yonib05 wants to merge 2 commits into
Conversation
get_pr_files capped every file's patch at 50 lines, so the reviewer silently lost the tail of any larger change and reasoned about code it never saw. Replace the per-file line cap with a total character budget: inline full patches until the budget is reached, then list remaining files for on-demand fetch instead of truncating mid-file.
…ping it A file whose patch alone exceeds the budget previously produced no inline diff at all, leaving the reviewer dependent on fetching it. Inline a line-trimmed head slice when enough budget remains so there is always some inline signal, and note the omitted remainder is fetchable. Adds tests for the partial-head and mixed inline/overflow cases.
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.
Problem
get_pr_filescapped every changed file's patch at 50 lines:The reviewer agent then reasons about a partial diff for any non-trivial
change. A bug introduced on line 60 of a changed file is simply invisible
to it, and the agent gets no signal that anything is missing beyond a
terse "truncated" note. This silently caps review quality on exactly the
larger PRs that most need a careful read.
Fix
Replace the blunt per-file line cap with a total diff character budget:
and instruct the agent to fetch them on demand via the shell tool,
rather than cutting a file off mid-diff.
This keeps the original intent (bounding how much diff goes into one
prompt) while ensuring that whatever is inlined is complete, and that
anything omitted is explicitly surfaced instead of hidden.
Tests
Adds
tests/test_github_tools.py:The first test fails against the old code (it emitted
truncatedanddropped the tail), confirming the regression it guards.