Skip to content

sweep: catch the files variant of GitHub's too-large diff - #50

Merged
Octember merged 1 commit into
mainfrom
claude/stupify-406-files
Jul 25, 2026
Merged

sweep: catch the files variant of GitHub's too-large diff#50
Octember merged 1 commit into
mainfrom
claude/stupify-406-files

Conversation

@Octember

Copy link
Copy Markdown
Owner

Follow-up to #49, which fixed the retry loop for only half the affected PRs.

What #49 missed

GitHub 406s a diff on two independent limits, with different prose:

Sorry, the diff exceeded the maximum number of lines (20000)
Sorry, the diff exceeded the maximum number of files (300). Consider using 'List pull requests files' API ...

isDiffTooLarge matched only the lines wording. So after deploying #49, the live bevyl sweep split cleanly down the middle:

13:03:40  skip #8338 — couldn't read its diff from gh; will retry next sweep   <- still looping (files)
13:03:42  skip #8308 — diff over GitHub's 20000-line API limit ...             <- fixed (lines)
13:03:43  skip #8241 — couldn't read its diff from gh; will retry next sweep   <- still looping (files)
13:03:43  skip #8121 — diff over GitHub's 20000-line API limit ...             <- fixed (lines)

The fix

Match gh's stable error code, which both variants carry:

/PullRequest\.diff too_large|diff exceeded the maximum number of (lines|files)/i

The code comes first deliberately — the prose differs per limit and can be reworded, but too_large is what gh emits for both. The prose patterns stay as a fallback.

Messages now name both limits (20000-line / 300-file) rather than asserting the line cap for a PR that actually blew the file cap.

Both real payloads, copied verbatim from the live #8121 and #8338 failures, are pinned in the test.

#49 only matched "diff exceeded the maximum number of lines". GitHub
406s on TWO limits — 20000 lines and 300 files — so #8338 and #8241
(both over the file cap) stayed in the retry loop after the fix, while
#8308 and #8121 correctly dropped out.

Match gh's stable `PullRequest.diff too_large` code, which both variants
carry, and keep the prose patterns as a fallback. Both real payloads are
pinned in the test.
@Octember
Octember merged commit b493272 into main Jul 25, 2026
2 checks passed
@Octember
Octember deleted the claude/stupify-406-files branch July 25, 2026 13:06

@exe-dev-github-integration exe-dev-github-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant