feat(review): surface review failures as a PR comment#5
Conversation
Mimir review — 🟢 No blocking issuesWell-structured PR adding a post-review failure notification mechanism. Findings: 0 critical · 0 major · 2 minor · 0 nit 💰 Review cost: $0.0136 — primary |
There was a problem hiding this comment.
Code Review
This pull request introduces error handling and failure reporting for the PR review workflow. It adds a postReviewFailure function to surface failures (such as model context-size overflows) as PR comments, and wraps the main workflow execution in a try-catch block to prevent silent failures. The review feedback is highly constructive and suggests cleaning up stale failure comments upon a successful run, sanitizing error messages to prevent markdown formatting issues, and rethrowing the caught error so the workflow platform can accurately track execution failures.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
A review that throws before posting (e.g. a model context-size overflow) died silently after the webhook's 200, leaving nothing on the PR. Wrap the run so any failure posts an idempotent notice with the reason, stored under a separate key/marker so it never clobbers a prior good review.
… comment Address PR review feedback: - On a successful review, retract any lingering "review failed" comment from an earlier failed run (best-effort delete) so the PR never shows a good review beside a stale failure notice. - Sanitize triple backticks in the error reason so a message can't prematurely close the fenced code block in the comment. - Document why the run returns (not re-throws) on failure: the pass already exhausted transient retries, so a throw would make Flue re-run the whole review up to its max-attempts for a deterministic failure. - Add tests for postReviewFailure (create/update/404-fallback/non-Error/sanitize) and the success-path retract.
e41f06c to
eefda92
Compare
What
A review that throws before it can post (e.g. a model context-size overflow on a large PR) previously died silently after the webhook's 200 — nothing appeared on the PR, and the only trace was in the worker logs. The primary/escalation pass can fail non-retryably, and the run terminated before
postReviewwith no feedback.This wraps the review run so any failure posts a
⚠️ Mimir review failedcomment carrying the error reason. The notice is:…#<n>::failedkey, so a re-run updates one notice instead of stacking;<!-- mimir-review-failed -->marker keeps it distinct from the summary comment, so a failed run never clobbers a prior good review.A structured
review failedevent is also logged forwrangler tail.Why
Turning a silent no-op into an actionable, re-runnable notice: when a review fails, the maintainer sees why on the PR and can
/reviewagain, instead of assuming the bot is broken or the PR was skipped.Changes
lib/post-review.ts: newpostReviewFailure()(update-or-create on a::failedkey).workflows/review-pr.ts: thinrunwrapper around the review body that catches, logs, and posts the failure notice; re-resolving the (cached) installation client to post.Test
typecheck,lint, and the existing suite (91 tests) pass.