fix(release-notes): retry the LLM gateway + fall back to raw commit notes#49
Merged
Conversation
…otes The Discord release-note step crashed when the gateway returned a transient Cloudflare 524 (origin timeout), losing an entire release announcement (hit on @protolabsai/ui@0.35.0). Hardening: - callLLM retries transient failures (network throws, 429, 5xx) with backoff, and truncates the error body — a 524 returns a full HTML page that floods the logs. - if every attempt fails, the caller falls back to a plain commit-subject list (buildFallbackNotes, extracted to lib/release-notes.mjs + unit-tested) so the release is still announced, un-themed rather than not at all. Empty LLM responses take the same fallback. biome lint + 69 tests green. Bumps 2.4.0. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
👀 Quinn is reviewing — verdict (PASS / WARN / FAIL) + findings to follow. |
There was a problem hiding this comment.
QA Audit — PR #49 | fix(release-notes): retry the LLM gateway + fall back to raw commit notes
VERDICT: WARN (CI still queued; non-blocking comment — formal PASS/FAIL on re-review after CI settles)
CI Status
- Lint + smoke test: ⏳ queued
Diff Review
bin/rewrite-release-notes.mjs:callLLMgains 3-attempt retry with backoff[0, 3s, 10s], transient detection (429 + 5xx → retry; other 4xx → fail fast), and truncated error bodies (300 char). The call site wrapscallLLMin try/catch and falls back tobuildFallbackNoteswhen empty or failed.lib/release-notes.mjs: New pure-logic module withbuildFallbackNotes(version, commits)— extract + unit-test pattern.- Composes cleanly with #48:
emitNotessink fires on all paths (LLM success, LLM empty, fallback), so Discord/changelog/output always receive notes.
Observations
- LOW:
.beads/tooling artifacts committed (beads.db-shm,beads.db-wal,issues.*.jsonl,.local_version,metadata.json) — these look like internal beads runtime state rather than source. Consider adding.beads/(or these specific globs) to.gitignoreto prevent future noise. - LOW (Gap):
clawpatch_reviewreturned HTTP 502 — structural review unavailable for this pass. Diff-based review is complete; no cross-file issues detected from the visible diff. - LOW (Gap):
buildFallbackNotesfull implementation truncated in diff summary — usage pattern (import → call withversionandfilteredCommits) is consistent and the function is unit-tested per the PR description.
The retry + fallback strategy is well-scoped: transient gateway failures retry gracefully, non-transient client errors fail fast, and the fallback guarantees a release announcement always lands. No correctness or safety issues identified.
— Quinn, QA Engineer
|
Submitted COMMENT review on #49. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Discord release-note step crashed when the protoLabs gateway returned a transient Cloudflare 524 (origin timeout) —
callLLMgot an HTML error page instead of JSON and threw, so the entire release announcement was lost (hit on@protolabsai/ui@0.35.0). One gateway blip = no Discord post, and a red run even though the publish itself succeeded.Fix
callLLMretries transient failures (network throws, 429, 5xx) with backoff[0, 3s, 10s](mirrors the existingpostToDiscordretry), and truncates the error body — a 524 returns a full HTML page that floods the logs.buildFallbackNotes) and still posts — un-themed, but a real announcement rather than nothing.buildFallbackNotesextracted tolib/release-notes.mjs(the repo's pure-logic-in-lib pattern) + unit-tested.Composes cleanly with #48's
emitNotessink (outputs / changelog / Discord all still fire on the fallback notes).Test
biome lintclean, 69 tests (3 new forbuildFallbackNotes), smoke green. Bumps 2.4.0 — publish via the Release workflow (workflow_dispatch) after merge so the action'snpx @latestpicks it up.Companion: protoContent's
release-packages.ymlDiscord step →continue-on-error(separate PR), so a gateway issue never reds the publish run.🤖 Generated with Claude Code