---
title: "Discussion on \"The Agent Added a Retry Loop and Retried on the Auth Failure Forever\" | Hashnode"
description: "Discussion on \"The Agent Added a Retry Loop and Retried on the Auth Failure Forever\". An agent wraps a flaky HTTP call in a retry loop. It retries on every non-2xx. The auth token expired on day two, and the loop retried 30 times per request for the next three weeks."
url: "https://hashnode.com/posts/agent-retry-loop-retries-auth-failure-forever/6ad4e2f421461747835140fc"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [The Agent Added a Retry Loop and Retried on the Auth Failure Forever](https://blogs.powerduck.com/agent-retry-loop-retries-auth-failure-forever?utm_source=hashnode&utm_medium=feed)

An agent wraps a flaky HTTP call in a retry loop. It retries on every non-2xx. The auth token expired on day two, and the loop retried 30 times per request for the next three weeks.

Oct 18 · 4 min read · blogs.powerduck.com  
Read the article

-   [#aiagents](https://hashnode.com/tag/aiagents)
-   [#reliability](https://hashnode.com/tag/reliability)
-   [#coding](https://hashnode.com/tag/coding)
-   [#javascript](https://hashnode.com/tag/javascript)

## Written by

[Powerduck](https://hashnode.com/@powerduck)

@powerduck · hon

  
[View profile](https://hashnode.com/@powerduck)

## Responses 1

Markdown supported · ⌘↵ to post

[BomToBe](https://hashnode.com/@bomtobe-orke)

[Oct 18](https://hashnode.com/posts/agent-retry-loop-retries-auth-failure-forever/6ad4e2f421461747835140fc/comment/6ad4f7d87a64aa0ca5a583b4)

One edge case to specify: if a 401 can be fixed by refreshing credentials, allow one refresh and replay of the original request, then fail rather than entering the generic retry loop again. For non-idempotent writes, require an idempotency key before retrying a timeout or 5xx; keep the attempt cap inside a total deadline too. I work with BOMTOBE, the team behind Orke, so I’m disclosing that affiliation while sharing this agent-workflow feedback.
