Repository navigation
feat(review): surface files excluded from review coverage - #2589
Conversation
|
Exactly the shape I meant. Two notes. Keep the The gap: Minor: |
|
@IsmaelMartinez Thanks for the detailed feedback. I’ve addressed both points:
I kept the existing The focused test suite passes ( Another look whenever convenient would be appreciated. |
PR Summary by QodoSurface omitted files in /review output when token budget clips the diff
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
1. Review coverage lacks file counts
|
| "\n\n---\n\n" | ||
| "⚠️ **Review coverage:** The following files were not included in this review " | ||
| "because of the token budget:\n" |
There was a problem hiding this comment.
1. review coverage lacks file counts 📎 Requirement gap ◔ Observability
When diff compression occurs, the footer only lists excluded files and omits the required coverage summary counts (total changed files and full/partial/skipped breakdown). This can mislead users about how much of the PR was actually reviewed.
Agent Prompt
## Issue description
The review output footer added for token-budget compression does not include the required coverage summary counts: total number of changed files and a breakdown of reviewed-in-full, reviewed-partially, and skipped files.
## Issue Context
Compliance requires an explicit coverage summary when the PR diff is compressed so reviewers do not assume the entire PR was reviewed.
## Fix Focus Areas
- pr_agent/tools/pr_reviewer.py[298-309]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
IsmaelMartinez
left a comment
There was a problem hiding this comment.
Both points addressed and the coverage list is complete now. Full unit suite passes on the branch (1574).
The bot's MAX_REVIEW_COVERAGE_FILES complaint doesn't hold — /describe hardcodes the same 50 (MAX_EXTRA_FILES_TO_PROMPT, pr_description.py:289). Two small notes inline.
| # Hard Stop, no more tokens | ||
| if total_tokens > max_tokens_model - OUTPUT_BUFFER_TOKENS_HARD_THRESHOLD: | ||
| get_logger().warning(f"File was fully skipped, no more tokens: {filename}.") | ||
| remaining_files_list_new.append(filename) |
There was a problem hiding this comment.
This also changes /describe. With large_pr_handling=true (pr_description.py:218), pr_generate_compressed_diff feeds remaining_files_list back into the next generate_full_patch iteration, so hard-stopped files now get retried in a later patch and show up in the "Additional unprocessed files" list. I think that's the right behaviour, but it's a cross-tool change with no test on that path — worth a line in the description.
There was a problem hiding this comment.
This also changes
/describe. Withlarge_pr_handling=true(pr_description.py:218),pr_generate_compressed_difffeedsremaining_files_listback into the nextgenerate_full_patchiteration, so hard-stopped files now get retried in a later patch and show up in the "Additional unprocessed files" list. I think that's the right behaviour, but it's a cross-tool change with no test on that path — worth a line in the description.
Added a note to the PR description documenting the /describe behavior when large_pr_handling=true.
| # Add custom labels from the review prediction (effort, security) | ||
| self.set_review_labels(data) | ||
|
|
||
| if self.remaining_files_list: |
There was a problem hiding this comment.
The footer is appended after the help text and show_relevant_configurations, so it renders below the collapsed "Tool usage guide". Moving it above the help-text block keeps the warning next to the review.
There was a problem hiding this comment.
The footer is appended after the help text and
show_relevant_configurations, so it renders below the collapsed "Tool usage guide". Moving it above the help-text block keeps the warning next to the review.
Moved the coverage footer above the help-text block and added a regression test to keep the warning next to the main review output.
|
Code review by qodo was updated up to the latest commit fdba934 |
|
Thanks for turning that around so quickly. Both fixes verified, suite green here. Two things left, and apologies for not catching the first one on my previous pass. The footer needs a new config option in the The other is that the hard-stop fix quietly changes Nit: |
|
Code review by qodo was updated up to the latest commit 29d7b93 |
Thanks for catching these. I added I also added a deterministic regression test for the large-PR The focused tests pass with 44 tests, and the full unit suite passes with 1577 passed, 1 skipped, and 1 xfailed. Pre-commit and #2565 remains open, and this PR continues to partially address it. Thanks again for the detailed review. |
|
LGTM, thanks @yefuyou, you rock 🔥 |
…ocker test image The three `_prepare_prediction` tests added in The-PR-Agent#2589 rely on `asyncio_mode = "auto"` from pyproject.toml, but the docker `test` target never copies that file (it adds only requirements-dev.txt, pr_agent, tests and docker/mosaico). Inside the image pytest therefore falls back to strict mode and fails all three with "async def functions are not natively supported", turning main's build-and-test job red for every open PR. Add the explicit `@pytest.mark.asyncio` marker the rest of the suite already uses. Verified by running the suite with `-o asyncio_mode=strict`, which reproduces the CI failure exactly before the change and is fully green after it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Background
get_pr_diffalready returnsremaining_files_listwhen the token budget excludes files, but/reviewdiscarded it. Reviewers therefore could not see which files were omitted.Implementation
/reviewnow callsget_pr_diff(..., return_remaining_files=True).remaining_files_listis stored while preserving compatibility with both tuple returns and the legacy full-diff string return.remaining_files_list.enable_review_coverage_footerin the[pr_reviewer]section and is enabled by default.docs/docs/tools/review.md.... and N morewhen additional files are omitted.<hr>to match the existing help-text formatting and remains positioned before the help-text block.generate_full_patchis shared by/reviewand/describe. Whenlarge_pr_handling=true,pr_generate_compressed_diffcarriesremaining_files_listinto subsequent large-PR processing iterations, so files retained after a hard token stop can be retried later and may ultimately appear in/describe's “Additional unprocessed files” list.Tests
git diff --checkpassed.Scope
This first cut does not implement
reviewed partiallytracking orlarge_patch_policy="clip"truncation tracking. It also does not add coverage percentages, thresholds, exclusion-reason categories, or unrelated refactoring.Partially addresses #2565