fix(orb): break to the fallback model on a rate limit in e2e-test-gen - #8718
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
runWorkersE2eTestGen's per-model retry catch had no rate-limit check, so a 429 burned all 3 attempts against the same rate-limited model (half the total call budget) before reaching the fallback model — despite the doc comment claiming it "mirrors runWorkersSlopOpinion's exact shape", which does break on a 429. Adds the same isRateLimitError(error) break the sibling loops use. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8718 +/- ##
==========================================
- Coverage 93.79% 90.59% -3.20%
==========================================
Files 797 97 -700
Lines 79477 22572 -56905
Branches 24078 3921 -20157
==========================================
- Hits 74542 20449 -54093
+ Misses 3563 1945 -1618
+ Partials 1372 178 -1194
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-26 00:46:59 UTC
Review summary Nits — 2 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
Fixes #8672
Root cause
runWorkersE2eTestGen's per-model retry loop (src/services/ai-e2e-test-gen.ts) had a barecatch { /* retry / fall through */ }with no rate-limit check —isRateLimitErrorwas never imported in the file. So when the default provider 429s, it burned all 3E2E_TEST_GEN_ATTEMPTS_PER_MODELretries against the same rate-limited model (half the total 6-call budget) before ever reaching the fallback model.That directly contradicts the function's own doc comment ("Mirrors
runWorkersSlopOpinion's exact shape") — the slop sibling (ai-slop.ts:169-174),planner.ts,issue-plan-draft.ts, andlinked-issue-satisfaction-run.tsallbreakon a 429, andisRateLimitError's doc explicitly says retrying a live 429 has "near-zero chance of success."Fix
Imported
isRateLimitErrorfrom./ai-review(where the other loops get it) and addedif (isRateLimitError(error)) break;to the catch — the identical guard the siblings use. A non-rate-limit error still retries/falls through exactly as before.Tests (both in the existing
ai-e2e-test-gen.test.ts, both arms of the new branch)Validation
ai-e2e-test-gen.test.ts: 47 passed, rebased onto currentmainisRateLimitErrorguard are coverednpm run typecheckclean;oxlintclean on the changed lines (the one warning at line 257 is pre-existing, present on cleanmain, outside this diff);git diff --checkclean