Skip to content

fix(release-notes): retry the LLM gateway + fall back to raw commit notes#49

Merged
mabry1985 merged 1 commit into
mainfrom
fix/llm-retry-fallback
Jun 14, 2026
Merged

fix(release-notes): retry the LLM gateway + fall back to raw commit notes#49
mabry1985 merged 1 commit into
mainfrom
fix/llm-retry-fallback

Conversation

@mabry1985

Copy link
Copy Markdown
Contributor

Problem

The Discord release-note step crashed when the protoLabs gateway returned a transient Cloudflare 524 (origin timeout)callLLM got 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

  • callLLM retries transient failures (network throws, 429, 5xx) with backoff [0, 3s, 10s] (mirrors the existing postToDiscord retry), and truncates the error body — a 524 returns a full HTML page that floods the logs.
  • Fallback: if every attempt fails (or the response is empty), the caller falls back to plain commit-subject notes (buildFallbackNotes) and still posts — un-themed, but a real announcement rather than nothing.
  • buildFallbackNotes extracted to lib/release-notes.mjs (the repo's pure-logic-in-lib pattern) + unit-tested.

Composes cleanly with #48's emitNotes sink (outputs / changelog / Discord all still fire on the fallback notes).

Test

biome lint clean, 69 tests (3 new for buildFallbackNotes), smoke green. Bumps 2.4.0 — publish via the Release workflow (workflow_dispatch) after merge so the action's npx @latest picks it up.

Companion: protoContent's release-packages.yml Discord step → continue-on-error (separate PR), so a gateway issue never reds the publish run.

🤖 Generated with Claude Code

…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>
@protoquinn

protoquinn Bot commented Jun 14, 2026

Copy link
Copy Markdown

👀 Quinn is reviewing — verdict (PASS / WARN / FAIL) + findings to follow.

@protoquinn protoquinn 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.

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: callLLM gains 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 wraps callLLM in try/catch and falls back to buildFallbackNotes when empty or failed.
  • lib/release-notes.mjs: New pure-logic module with buildFallbackNotes(version, commits) — extract + unit-test pattern.
  • Composes cleanly with #48: emitNotes sink 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 .gitignore to prevent future noise.
  • LOW (Gap): clawpatch_review returned HTTP 502 — structural review unavailable for this pass. Diff-based review is complete; no cross-file issues detected from the visible diff.
  • LOW (Gap): buildFallbackNotes full implementation truncated in diff summary — usage pattern (import → call with version and filteredCommits) 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

@protoquinn

protoquinn Bot commented Jun 14, 2026

Copy link
Copy Markdown

Submitted COMMENT review on #49.

@mabry1985 mabry1985 merged commit 32a25e7 into main Jun 14, 2026
1 check passed
@mabry1985 mabry1985 deleted the fix/llm-retry-fallback branch June 14, 2026 19:16
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