A retry loop is configured with max_attempts=5. The model fails the sa — Daily Challenge 2026-08-05 — Claude Cert Academy

A retry loop is configured with max_attempts=5. The model fails the same validation check (missing required field 'reason') on attempts 1, 2, and 3. What should the loop do after attempt 3?

Answer: Detect the repeated failure pattern and escalate rather than continue retrying, since targeted feedback isn't producing a correction

Repeating the same failure on consecutive attempts signals that the targeted feedback isn't working for this input — continuing to retry wastes tokens and time. The correct stopping criterion is: if the same validation error appears on two consecutive attempts, escalate. Continuing to max_attempts (A) ignores the repeated-failure signal. Switching models (C) is a more drastic escalation that may be appropriate as a fallback but isn't the immediate next step. Reducing max_tokens (D) doesn't address a missing required field — the model needs more output, not less.

Continue to Claude Cert Academy