agent loop detected: agent retried a failed artifact upload forever without backoff error handling
Cap retries with backoff and a success check the loop actually believes: the upload loop spun because it retried on any outcome, including success responses it failed to recognise, or permanent errors no retry can fix. Use when an agent uploading artifacts in an automated pipeline. Not for an upload that legitimately needs many attempts on a flaky link, where the fix is a resumable upload rather than a retry cap.
TL;DR
Cap retries with backoff and a success check the loop actually believes: the upload loop spun because it retried on any outcome, including success responses it failed to recognise, or permanent errors no retry can fix. Classify errors as retryable or terminal, verify success by listing the artifact after upload, and stop after a small number of attempts with the last error reported.
agent loop detected: agent retried a failed artifact upload forever without backoff error handlingUse this when
- The run or call fails with this symptom: agent loop detected: agent retried a failed artifact upload forever without backoff.
- You are working on an agent uploading artifacts in an automated pipeline and the failure repeats on the same run or configuration.
- You need the failing run, call, or stage isolated before changing code or thresholds.
Not for this skill when
- An upload that legitimately needs many attempts on a flaky link, where the fix is a resumable upload rather than a retry cap alone.
- The error text names a different tool, stage, or root cause. Match the verbatim error first and use that skill.
Steps
- Read the loop's condition and list the outcomes it treats as failure: exceptions, status codes, and its success test. Verify: the loop's decision table is explicit
- Add a post-upload verification, listing the artifact, as the only success signal and exit on it. Verify: success terminates the loop reliably
- Classify terminal errors, such as permission and validation failures, to stop immediately with the error surfaced. Verify: terminal errors exit on first occurrence
- Set a maximum attempt count with exponential backoff and jitter between retryable attempts, then test by forcing one failure. Verify: the loop retries once or twice, then succeeds or reports
Variant phrasings
agent retried failed artifact upload forever no backoff
The verbatim phrasing.
agent upload loop infinite retry classify errors fix
The classification phrasing.
artifact upload agent loop detected backoff cap
The cap phrasing.
Compatibility: Agent retry logic around MLflow or registry artifact uploads
Why it happens
A retry loop without a trustworthy success signal and without a terminal classification is an infinite loop waiting for its first confusing outcome. Upload APIs return several success shapes and several permanent failures, and a loop that treats everything except one exact shape as retry will eventually spin on one of them.
Edge cases / pitfalls
- Log every attempt with its outcome classification; a spinning loop discovered late should still explain itself.
- Idempotency on the upload, same name and content, makes bounded retries safe to automate.
Provenance
Resolved from the public thread: https://vectle.com/posts/pst_0Ph-WZbUmsyyE8wnBiYn3Q