---
name: "Retry limit for mergemaster and pipeline restarts"
---

# Story 139: Retry limit for mergemaster and pipeline restarts

## User Story

As a developer using huskies, I want pipeline auto-restarts to have a configurable retry limit so that failing agents don't loop infinitely consuming CPU and API credits.

## Acceptance Criteria

- [ ] Pipeline auto-restart has a configurable max_retries per agent in project.toml (default 3)
- [ ] After max retries exhausted, agent status is set to Failed and no further restarts occur
- [ ] Server logs clearly indicate attempt number and when max retries are exhausted
- [ ] Retry count resets when a human manually restarts the agent (resume_context is None)
- [ ] Retry limit applies to all pipeline stages: Coder, QA, and Mergemaster restarts

## Out of Scope

- TBD
