fix(scan): align preview selection with scan execution - #1041
Open
Wsp030914 wants to merge 2 commits into
Open
Conversation
Preview skipped the runtime token-limit check, so it could report oversized files as reviewable.\n\nRefs alibaba#1040
Contributor
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 5 selected item(s). |
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.
Description
ocr scan --previewapplied only static file filters, while a real scan also dropped files exceeding 80% of the resolvedmax_tokensvalue. This could make preview report a file as reviewable even though execution would skip it.This change:
max_tokensusing the same precedence as a real scan:CLI > saved config > template default;too_largeexclusion reason;Type of Change
How Has This Been Tested?
make testpasses locallyAdditional verification:
make checkmake coverage— 91.0%make buildocr review --audience agent— 0 findings across 5 selected production filesmax_tokensaffects scan previewChecklist
go fmt,go vet)Scope
This PR only aligns deterministic scan file selection.
It does not attempt to predict:
--max-tokens-budgetexhaustion;Related Issues
Closes #1040.
Related: #782 and #801 cover the corresponding diff-review preview behavior.
AI/LLM Disclosure
OpenAI Codex (GPT-5) assisted with implementation, test refinement, and drafting this PR description. OpenCodeReview using DeepSeek
deepseek-v4-properformed the final automated review. I manually reviewed and understand the complete final diff and take responsibility for the submitted changes.