| name | continuous-agent-loop |
| description | Patterns for continuous autonomous agent loops with quality gates, evaluations, and recovery controls. |
Continuous Agent Loop
Patterns for structuring long-running agent workflows with loop selection, quality gates, and failure recovery.
Loop Selection
Start
|
+-- Need strict CI/PR control? --> continuous-pr loop
|
+-- Need task decomposition from spec? --> DAG-based loop
|
+-- Need exploratory parallel generation? --> infinite loop
|
+-- default --> sequential loop
Recommended Production Stack
- Task decomposition from spec or RFC
- Quality gates (lint, test, type-check between iterations)
- Evaluation harness (automated acceptance checks)
- Session persistence (resume after interruption)
Failure Modes
- Loop churn without measurable progress
- Repeated retries with the same root cause
- Merge queue stalls from conflicting changes
- Cost drift from unbounded model escalation
Recovery
- Freeze the loop
- Audit recent iterations for root cause
- Reduce scope to the failing unit
- Replay with explicit acceptance criteria