Commit 048f38f
fix(workflows): make impl pipeline resilient to transient Claude failures (#5410)
## Summary
The implementation pipeline was leaving PRs and issues stuck after a
single Claude Code Action hiccup. Three fixes restore self-healing
behavior:
- **`impl-generate.yml`**: cap raised from **2 → 3** generation
attempts, aligning with the existing `impl:{lib}:failed` label
description (*"max retries exhausted (3 attempts)"*) and the repair
phase's 3-attempt budget. Failure comments now read `Attempt N/3`.
- **`impl-repair.yml`**: previously had no failure handler — when the
Claude Code Action itself crashed, the workflow ended with `ai-rejected`
already removed and re-review never fired, leaving the PR silently
stuck. Added a `Handle repair failure` step that restores `ai-rejected`
and auto-retries the same attempt **once** via a marker comment, then
falls back to manual.
- **`impl-review.yml`**: both failure paths (Claude crash → `Handle
review failure`, and score=0 from missing `quality_score.txt` →
`Validate review output`) immediately surfaced `ai-review-failed`,
requiring manual rerun. Both now auto-retry **once** via
`repository_dispatch` with a shared marker comment before giving up.
The `>=50% after 3 attempts` merge logic in `impl-review.yml` was
already correct and is unchanged — these fixes only ensure PRs reach
that gate instead of stalling earlier.
## Concrete trigger (not added to the PR but motivated it)
Issue #5365 (`area-mountain-panorama`) had **4/9 libraries hard-failed**
without ever creating a PR (transient Claude crashes during generate,
capped at 2 attempts), **1 PR stuck** with `ai-review-failed` (plotnine
#5372), and **1 PR stuck** mid-repair (altair #5370 — repair workflow
itself crashed on attempt 1). Manual recovery was triggered earlier in
the conversation.
## Test plan
- [ ] Trigger a generate that fails twice (e.g., simulate or wait for
transient flake) — should auto-retry to attempt 3 instead of stopping at
2
- [ ] Trigger a repair where Claude Code Action crashes — should restore
`ai-rejected` and auto-retry the same attempt once via marker comment
- [ ] Trigger a review where Claude crashes — should auto-retry via
`repository_dispatch` once before adding `ai-review-failed`
- [ ] Trigger a review where Claude runs but writes no
`quality_score.txt` — same auto-retry behavior
- [ ] Verify markers prevent infinite retry loops (each marker only
allows one auto-retry)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 76c2880 commit 048f38f
3 files changed
Lines changed: 137 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
755 | 755 | | |
756 | 756 | | |
757 | 757 | | |
758 | | - | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
759 | 761 | | |
760 | | - | |
761 | | - | |
| 762 | + | |
| 763 | + | |
762 | 764 | | |
763 | 765 | | |
764 | 766 | | |
765 | | - | |
766 | | - | |
767 | | - | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
768 | 774 | | |
769 | 775 | | |
770 | 776 | | |
| |||
777 | 783 | | |
778 | 784 | | |
779 | 785 | | |
780 | | - | |
| 786 | + | |
781 | 787 | | |
782 | | - | |
| 788 | + | |
783 | 789 | | |
784 | 790 | | |
785 | 791 | | |
| |||
792 | 798 | | |
793 | 799 | | |
794 | 800 | | |
795 | | - | |
| 801 | + | |
796 | 802 | | |
797 | | - | |
| 803 | + | |
798 | 804 | | |
799 | | - | |
| 805 | + | |
800 | 806 | | |
801 | 807 | | |
802 | 808 | | |
| |||
810 | 816 | | |
811 | 817 | | |
812 | 818 | | |
813 | | - | |
| 819 | + | |
814 | 820 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
175 | 177 | | |
176 | | - | |
177 | | - | |
178 | | - | |
| 178 | + | |
179 | 179 | | |
180 | | - | |
181 | | - | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
182 | 184 | | |
183 | | - | |
184 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
185 | 190 | | |
186 | | - | |
| 191 | + | |
187 | 192 | | |
188 | 193 | | |
189 | 194 | | |
190 | 195 | | |
191 | | - | |
192 | 196 | | |
193 | | - | |
194 | | - | |
| 197 | + | |
195 | 198 | | |
196 | 199 | | |
197 | 200 | | |
198 | 201 | | |
199 | 202 | | |
200 | 203 | | |
| 204 | + | |
| 205 | + | |
201 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
202 | 222 | | |
203 | 223 | | |
204 | 224 | | |
| |||
448 | 468 | | |
449 | 469 | | |
450 | 470 | | |
| 471 | + | |
| 472 | + | |
451 | 473 | | |
452 | | - | |
453 | | - | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
454 | 478 | | |
455 | | - | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
456 | 483 | | |
457 | | - | |
458 | | - | |
459 | | - | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
460 | 500 | | |
461 | 501 | | |
462 | 502 | | |
463 | 503 | | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
464 | 512 | | |
465 | 513 | | |
466 | 514 | | |
| |||
0 commit comments