fix(cicd): release notes never reach Claude — E2BIG on the prompt, then denied tool permissions - #37361
Conversation
Three defects kept the release-notes phase from ever writing notes once PR resolution started returning the *complete* PR set: 1. The assembled prompt (253 KB for a full release) was passed through GITHUB_ENV. Linux caps a single env var at MAX_ARG_STRLEN (128 KiB), so every later step died with E2BIG. Hand Claude a file instead. 2. claude_args carried no Read permission for that file, so all tool calls were denied and Claude exited "successfully" having written nothing (permission_denials_count: 6). 3. `bash -e` aborted the gather step before it could cat the script's stderr, so failures showed up as a bare "exit code 1". Also cap PR bodies at 1 KB — they were ~90% of the payload and the changelog only needs the lede. Full release prompt: 253 KB -> 71 KB. Closes: #37201 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
allow_failure: true is correct — an empty release description should never block a software release — but it also meant four releases shipped with empty bodies and a green pipeline. Post to #dot-releases on failure, matching the changelog-site-publish phase's pattern. The notice is opt-in via SLACK_BOT_TOKEN, so the backfill workflow (where an operator is already watching a red run) stays quiet. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Claude finished @sfreudenthaler's task in 3m 1s —— View job Code ReviewI traced all four files and the surrounding job (checkout, working-directories, the
New Issues
Notes (non-blocking)
No blocking issues — the 🟡 items are worth addressing but don't gate merge. |
Backfill verified — all four empty releases now have notesRan the backfill workflow off this branch, oldest first (auto-detected
Every range chains to the one backfilled before it — no gaps, no double-counted PRs. Zero Largest prompt is 71 KB against the 131,072-byte The 1 KB body cap did not cost anything in output quality: v26.08.28-01 came back with correctly categorized sections, issue links, and a deprecation notice for the removed Runs: v26.08.28-01 · v26.08.31-01 · v26.08.31-02 · v26.09.02-01 |
sfreudenthaler
left a comment
There was a problem hiding this comment.
backfill worked, ready for human review
Closes: #37201
The problem
Release notes generation has been failing for every release since v26.08.28-01. Four releases shipped with empty descriptions and a green pipeline:
#37213 correctly replaced the
(#N)squash-subject regex with the commits→PRs API. That made PR resolution complete for the first time — and complete is roughly twice as big. The payload crossed a limit nobody was watching.Three defects, none of them AI-side
1 — E2BIG was a Linux limit, not a context limit. The prompt was passed through
GITHUB_ENV. Linux caps a single env var or argv entry atMAX_ARG_STRLEN(128 KiB); a full release's prompt is 253 KB. Before #37213 the regex silently dropped about half the PRs, which kept it under the ceiling by accident.2 — The workaround dropped the tool allowlist. Switching to "read the prompt from a file" without restoring
--allowedToolsmeantReadwas denied. From run 33705418470:num_turns: 7,permission_denials_count: 6,is_error: false. It wasn't running out of turns — it was being denied and giving up politely, then the next step failed on a missing file.3 — The real error was unreachable.
bash -ekills the gather step the instantnodeexits non-zero, so thecat /tmp/gather-stderr.logtwo lines down never ran.The fix
GITHUB_ENVor argv.--allowedTools Read,Writerestored,--max-turns 20. (Turns were never the constraint — the failing run used 7 and cost $0.22.)::error::before the step exits.Full release prompt: 253 KB → 71 KB, verified end-to-end against
v26.09.02-01.Keeping
allow_failure: true, adding a smoke alarmAn empty release description should never block a software release, so the flag stays. But it's also why this went unnoticed for four releases — so on failure the phase now posts to #dot-releases, matching the pattern
changelog-site-publishalready uses. Success posts nothing. The notice is opt-in viaSLACK_BOT_TOKEN, so the backfill workflow (where an operator is already staring at a red run) stays quiet.Testing
gather-release-datarun end-to-end againstv26.09.02-01(485 commits → 51 PRs) andv26.08.28-01(228 commits → 29 PRs); both clean, no 404s.v26.08.28-01on this branch before merge.Not in this PR
Moving commit→PR resolution to GraphQL would collapse 485 REST calls into one query. That's a real win for speed and rate-limit headroom, but it fixes neither failure here, so it belongs in its own issue.
🤖 Generated with Claude Code
This PR fixes: #37201