Repository navigation
[pr-review] Raise the finding message cap and tell stage B about it - #201566
izaitsevfb wants to merge 6 commits into
Conversation
Inline findings were cut at 600 characters mid-sentence, and the stage B model was never told the limit. Raise MAX_MESSAGE to 1500 (matching MAX_SUMMARY) and ask stage B for at most 1200 characters per message.
PR Status: Approved 🚀Please fix all CI failures and trigger merge by commenting "@pytorchbot merge". ✅ AUTOMATED REVIEW - Ready for human review:
Findings (1): Reviewed commit: 🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/201566
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit ac1cac4 with merge base c2d59a3 ( 🟡 GREEN LIGHT - PR requires human review:
reason: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
…he cap A message that still overflows MAX_MESSAGE now ends in ' ...' at a word boundary, dropping trailing tokens until the result passes the publish check. A contract test keeps the stage B budget at or below 80% of MAX_MESSAGE.
…cters in the budget A message that fails the publish check whole (a blob neutralize() joins) is returned whole, so build() drops it as failed_publish_check as before, instead of the retry loop trimming it until it passes. The stage B prompt now counts each &, < and > as five characters.
A token split by the MAX_MESSAGE input slice (half a 128-hex digest) made the whole message fail the publish check and dropped the finding. Drop the split token before neutralizing, as the output cut already does.
Withdrawn: the automated review of a15dbb4 found nothing blocking.
There was a problem hiding this comment.
Automated review of ac1cac4: nothing blocking; ready for human review.
The PR raises MAX_MESSAGE from 600 to 1500 characters, makes a message that still overflows end in a ... marker at a word boundary (neutralize_message), and states a 1200-character budget in the stage B prompt, which a contract test enforces. Recommendation: Approve. The truncation logic and its tests hold up under tracing; the one performance point is low confidence and doesn't block.
⚪ 1 non-blocking finding
pytorch/scripts/pr_review/extract_verdict.py
Line 851 in ac1cac4
The worst-case sanitize time grows about 2.5x, because findings that fail the publish check don't count toward the findings cap (low confidence: estimated from the code's own measured figure, not run). sanitize_findings stops at MAX_FINDINGS only once 25 findings have been kept. A finding that reaches neutralize_message and is then dropped as failed_publish_check doesn't count toward that limit; the only bound on how many such findings can arrive is MAX_STRUCTURED_BYTES (1 MiB). neutralize is quadratic in its input (627 ms for the bad bracket shape at 1500 characters, per the com
This review is AI-generated and advisory. Each new automated review replaces the previous one.
Withdrawn: the automated review of ac1cac4 found nothing blocking.
|
✴️ iz2: merging on Ivan's behalf. |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
✴️ iz2: The automated review cut inline findings off mid-sentence at 600 characters:
extract_verdict.pycaps each finding message there, and stage B was never told about the limit. 18 of the 32 most recent bot inline comments hit the cap. Example: #201517 (comment)MAX_MESSAGEgoes from 600 to 1500, the same asMAX_SUMMARY.&,<and>as five, since escaping lengthens them....at a word boundary. The input slice and the output cut both drop the token they split.neutralize_message()then drops trailing tokens until the result passes the publish check (is_neutral_prose). If no prefix passes, it returns empty, and the existing empty-message drop applies. A message that fails the check as a whole (for example, a blob thatneutralize()joins) is not trimmed: it is still dropped asfailed_publish_check.MAX_MESSAGE, and tests cover the cut cases.At the new cap, a review with 25 findings stays well under GitHub's body limit, and
MAX_BODYstill drops whole findings and says so when needed. Dr.CI's renderer has its own findings budget (PR_REVIEW_FINDINGS_BUDGET) and reports any findings it hides.Test plan:
python3 -m unittest discover -s scripts/pr_review -p 'test_*.py'(452 tests pass).