A system can look healthy while quietly failing for days, because AI assistants default to retry logic that treats every error as temporary. That default is correct for flaky networks. It is dangerous for expired credentials, and most teams never notice the gap until the damage has already piled up.
The Details:
AI models reach for retries and backoff because that pattern wins most often across generic failure scenarios. But a 401 from a dead token and a 503 from a busy server land in the same except block and look identical at the HTTP layer, so generic handling retries both for hours while the real problem, a credential that will never come back on its own, goes unreported.
Failures split into three buckets that need different code paths: temporary ones worth retrying, permanent ones needing a human, and a third kind that gets worse with every retry, like a billing call that charges per attempt or a webhook that duplicates records. Sorting happens at the catch boundary, the exact line where an external call surfaces an error, not somewhere downstream.
Alert design has to match the bucket, not the component. Temporary failures can wait for a threshold, say five occurrences in an hour, while permanent failures should escalate on the first hit because a second occurrence just means more damage done waiting. A useful filter: if the alert does not tell someone what to do in the next fifteen minutes, it is a log entry, not an alert.
A two-sentence prompt comment, naming which calls carry permanent-failure risk, changes the generated code completely. It forces the failure model to be explicit before the integration gets written, instead of letting the assistant fall back on its generic retry-first instinct.
Bottom Line: Silent retries buy comfort now and debt later; naming your failure types before you write the handling code is what keeps the system honest when it actually breaks.
Enjoy this article?
Listen to the Claude Code Conversations radio show or join the community.