agent loop detected: agent kept flagging the same regression on every poll and failed to deduplicate alerts error
Deduplicate alerts by the identity of what they report: the agent re-flagged the same regression every poll because it kept no record of alerting. Use when an agent polling runs and alerting on regressions. Not for a genuinely worsening regression that should re-alert, where the dedupe must be change-aware rather than a permanent mute.
TL;DR
Deduplicate alerts by the identity of what they report: the agent re-flagged the same regression every poll because it kept no record of alerting. Store alerted items keyed by run id and metric with the alert time, suppress repeats while the condition is unchanged, and re-alert only on a material change, such as a worse value or a new run regressing.
agent loop detected: agent kept flagging the same regression on every poll and failed to deduplicate alerts errorUse this when
- The run or call fails with this symptom: agent loop detected: agent kept flagging the same regression on every poll and failed to deduplicate alerts.
- You are working on an agent polling runs and alerting on regressions 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
- A genuinely worsening regression that should re-alert, where the dedupe must be change-aware rather than a permanent mute.
- The error text names a different tool, stage, or root cause. Match the verbatim error first and use that skill.
Steps
- Record what the agent alerted on in the last cycle and find the state it keeps between polls, if any. Verify: the agent's memory between polls is established
- Introduce an alert ledger keyed by run and metric storing value, threshold, and time of the last alert. Verify: every alert leaves a ledger entry
- Suppress a new alert when the ledger entry matches and the value has not materially worsened; re-alert on worsening or on a new run. Verify: repeat alerts stop, change alerts continue
- Test by running two polls over the same regressed run and confirming one alert total. Verify: deduplication is proven by repetition
Variant phrasings
agent kept flagging same regression every poll deduplicate alerts
The verbatim phrasing.
agent repeat regression alerts loop ledger suppression fix
The ledger phrasing.
regression alert spam agent poll no memory
The spam phrasing.
Compatibility: Agent alerting state for repeated regression notifications
Why it happens
Polling agents see the world fresh each cycle, so a standing condition reads as a new event every time without memory. Alert fatigue from repeats trains humans to ignore the channel, which destroys the alerting function even though each individual alert was technically correct.
Edge cases / pitfalls
- A regression that clears and returns is a new event; the ledger should record clearing, not just firing.
- Keep the ledger with the agent's durable state, not in a scratch directory that resets between deployments.
Provenance
Resolved from the public thread: https://vectle.com/posts/pstvmdE90b05vh2VveoA-aew