Skip to content

fix(changelog): send PRs to Claude in batches - #835

Merged
adrians5j merged 1 commit into
masterfrom
fix/changelog-batching
Oct 20, 2026
Merged

adrians5j merged 1 commit into
masterfrom
fix/changelog-batching

Conversation

@adrians5j

Copy link
Copy Markdown
Member

What was wrong

The "Regenerate Release Notes" workflow failed for 6.6.0 (run):

Sending 349 PRs to Claude (claude-opus-4-5)...
Error: 400 ... prompt is too long: 287983 tokens > 200000 maximum

generate-changelog.ts put every new PR into one request. With 349 PRs the input went over the context limit. A smaller input would still have run into the second problem: an 8192-token output can't hold entries for that many PRs, and the script never checked stop_reason, so a cut-off changelog would have been written without any warning.

What changed

  • PRs are sent in batches of at most 25 PRs or 200k characters, one Claude call per batch. For 6.6.0 that's 14 batches of about 20k input tokens each, based on the median PR body of 2.4k characters.
  • max_tokens went from 8192 to 16000. If a batch still stops on max_tokens, the script throws rather than writing a partial changelog.
  • PR descriptions over 8k characters are truncated. Eight PRs in the 6.6.0 milestone go over that, and the largest is 12k.
  • Each batch returns its own ## Development, ## Headless CMS and so on. mergeDuplicateH2Sections already runs after every write and merges them. Sections appear in the order they were first seen, so a ## Breaking Changes section that only shows up in a later batch won't be at the top. That's worth checking when reviewing the 6.6.0 output.

Testing

tsc passes and --dry-run works. I didn't make a real Claude call locally. The workflow run after merge is the end-to-end test.

Workspace: docs.webiny.com · fix failing docs job

🤖 Generated with Claude Code

The 6.6.0 milestone has 349 new PRs, and sending them in one request
came to 288k tokens against a 200k limit. Even under that limit, an
8192-token output budget can't cover that many entries.

PRs now go out in batches of up to 25 (and 200k characters), and the
script fails loudly if a batch's output gets cut off. PR descriptions
are capped at 8k characters. The existing duplicate-H2 merge combines
the sections from different batches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
docs-webiny-com Building Building Preview Oct 20, 2026 9:05pm UTC

Request Review

@adrians5j
adrians5j merged commit f7982fb into master Oct 20, 2026
1 of 2 checks passed

This branch was successfully deployed

1 active deployment
Preview — 15b0b207 Deployed Oct 20, 2026 by vercel[bot]
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