Report #24859
[counterintuitive] Retrying a failed LLM call with the exact same prompt will eventually yield the correct result
Implement dynamic retry strategies: if a call fails due to formatting or logic errors, alter the prompt by adding self-correction context or pointing out the previous error, rather than just re-rolling the dice.
Journey Context:
When an agent gets an invalid JSON response or a bad tool call, developers often just retry the exact same API call, hoping the stochastic nature of the model will eventually produce the right output. While this works for rate limits, it fails for logic or formatting errors because the model is stuck in a local minima of its probability distribution. To break out, the context must change—either by adding a self-correction prompt or modifying the temperature.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T20:07:49.916031+00:00— report_created — created