Skip to content

fix: keep the PR comment under GitHub's size limit - #338

Merged
shenxianpeng merged 4 commits into
mainfrom
fix/pr-comment-size-limit
Nov 11, 2026
Merged

shenxianpeng merged 4 commits into
mainfrom
fix/pr-comment-size-limit

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

GitHub accepts at most 65,536 characters in a comment. The report quotes every failing commit's message in the diff, the agent prompt and the "All N checks" listing, so a pull request with a few dozen failing commits went past it: about 75 failing commits with a three-line body, about 20 with an eight-line one (measured with CLI 2.20.5). The API then refused the comment, the step log showed a warning, and a comment from an earlier run, possibly one that said "passed", stayed on the pull request.

The PR comment now shortens itself when it would not fit:

  1. The full report, as today, when it fits (almost always).
  2. Otherwise without the "All N checks" listing, which says "All N checks are in the job summary of this run" with a link to the run.
  3. If that is still too long, the heading and the group lines, then "The findings and how to fix them are in the job summary of this run".

The job summary is unchanged and keeps the full report. Length is counted the way GitHub counts it, in UTF-16 code units, so emoji in commit messages cannot tip it over.

Before and after

Comment size before and after

Tests

  • 60 failing commits: the comment fits, keeps the diff and "How to fix", and points to the job summary for the listing.
  • The step that drops the diff as well, with and without a job summary.
  • 342 tests pass, main.py coverage stays at 100% (lines and branches).

A pull request with a few dozen failing commits made a report longer
than the 65,536 characters GitHub accepts in a comment. The API refused
it, and an earlier comment, perhaps one that said passed, stayed up.
A report that does not fit now leaves out the listing of all checks,
then everything under the group lines, and links to the run for the
rest. The job summary keeps the full report.
@shenxianpeng
shenxianpeng requested a review from a team as a code owner November 11, 2026 15:44
@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 54 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dfd61110-548c-4e61-a447-00163a8510f6
Commits

Reviewing files that changed from the base of the PR and between d68e05b and 96535e2.

Files selected for processing: 2

  • main.py
  • main_test.py
Pre-merge checks: Passed 1 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Title check Pending This assessment has not completed. The check will be retried on the next pre-merge check run.
Passed Passed checks: 1 passed

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@shenxianpeng shenxianpeng added the bug Something isn't working label Nov 11, 2026 — with Claude
@shenxianpeng shenxianpeng self-assigned this Nov 11, 2026
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

✔ Commit Check passed

✔ Pull request: 2 passed

✔ Commits: 4 passed

✔ Author: 2 passed

✔ Branch: passed

All 9 checks
Pull request
  ✔ title        fix: keep the PR comment under GitHub's size limit
  ✔ description
Commits
  ✔ eb88506      fix: keep the PR comment under GitHub's size limit
  ✔ a4a9729      docs: add a before and after screenshot for the pull request
  ✔ d07885b      docs: remove the pull request screenshot
  ✔ 96535e2      test: build the shorter report under the same environment...
Author
  ✔ name         Xianpeng Shen
  ✔ email        3353385+shenxianpeng@users.noreply.github.com
Branch
  ✔ branch       fix/pr-comment-size-limit

Checked by Commit Check 2.20.5 · Rules · Check before you push

@github-actions github-actions Bot added the ai-assisted Written with the help of an AI tool label Nov 11, 2026
On a runner GITHUB_REPOSITORY and GITHUB_RUN_ID are set, so the report
measured outside the patched environment linked a longer run URL than
the comment did, and the limit taken from it let the comment keep its
diff.
@codecov

codecov Bot commented Nov 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (d68e05b) to head (96535e2).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #338   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines         1003      1029   +26     
=========================================
+ Hits          1003      1029   +26     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shenxianpeng
shenxianpeng merged commit 21674f1 into main Nov 11, 2026
16 of 18 checks passed
@shenxianpeng
shenxianpeng deleted the fix/pr-comment-size-limit branch November 11, 2026 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Written with the help of an AI tool bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant