GPT-5 finding
isTransientError always returns true; non-retryable errors (e.g., 4xx other than 429) are incorrectly treated as transient
highbughigh
- apps/web/lib/review-worker.ts:361-369
- apps/web/lib/review-worker.ts:370-384
- apps/web/lib/review-worker.ts:385-391
The function’s comment states most 4xx (other than 429) and likely code bugs should NOT be retried, but the implementation returns true unconditionally, marking every error as transient. In runReviewWorker this sets retryable=true, causing up to MAX_PROCESSING_ATTEMPTS wasted retries for non-retryable failures (e.g., 400/401/403/404), delaying terminal failure and increasing load/cost.
Recommendation
Tighten isTransientError to return false for non-retryable cases. Example: return true for 429 and 5xx and network/timeout signals; return false for 4xx other than 429 and for messages indicating validation/logic errors. Remove the unconditional final return true.