Skip to content

Commit aa1f525

Browse files
committed
feat: add 3-attempt circuit breaker to fix-renovate-tests agentic workflow
1 parent 80aec72 commit aa1f525

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

.github/workflows/fix-renovate-tests.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,21 @@ then push those fixes back to the PR branch.
5656

5757
## Step-by-step instructions
5858

59+
### 0. Circuit breaker — check attempt count
60+
61+
Before doing anything else, count how many `[copilot-fix]` commits are already
62+
on this branch:
63+
64+
```bash
65+
git log --oneline | grep -c '\[copilot-fix\]' || true
66+
```
67+
68+
If the count is **3 or more**, the maximum number of automated fix attempts has
69+
been reached. Call `noop` immediately with the message:
70+
"Max fix attempts (3) reached. Human review required."
71+
72+
Do NOT attempt any further fixes.
73+
5974
### 1. Identify the failing CI run
6075

6176
Use the `agentic-workflows` tools to find the most recent failed workflow run
@@ -97,17 +112,21 @@ Use `cat`, `grep`, and `find` to explore the repository before editing.
97112
### 5. Push your fixes
98113

99114
After making all edits, push them to the PR branch using
100-
`push-to-pull-request-branch`.
115+
`push-to-pull-request-branch`. Use a commit message that includes `[copilot-fix]`
116+
so the circuit breaker in step 0 can count previous attempts, e.g.:
117+
`fix: update call sites for marshmallow 3.26.2 API change [copilot-fix]`
101118

102119
Then remove the `renovate-fix-needed` label from the PR using `remove-labels`
103120
to signal that the fix has been applied. A separate workflow will detect the
104121
label removal and push an empty commit to re-trigger CI.
105122

106123
### 6. If no action is needed
107124

108-
If the CI run is already green (the label was applied redundantly), or if you
109-
cannot determine a safe fix, call `noop` with a clear explanation.
125+
Call `noop` with a clear explanation if:
126+
- The CI run is already green (label applied redundantly)
127+
- You cannot determine a safe fix
128+
- The max attempt count was reached (step 0)
110129

111130
**Never** guess at a fix or make changes you are not confident about.
112-
If you are unsure, call `noop` and leave a comment explaining what you found.
131+
If you are unsure, call `noop` and describe exactly what you found in the logs.
113132

0 commit comments

Comments
 (0)