Build: sped up bootstrap time of pr-merge pool agent
CI / push-validation (push) Successful in 19s
CI / build (push) Successful in 25s
CI / helm (push) Successful in 25s
CI / lint (push) Successful in 36s
CI / quality (push) Successful in 43s
CI / typecheck (push) Successful in 49s
CI / security (push) Successful in 54s
CI / e2e_tests (push) Successful in 4m25s
CI / unit_tests (push) Successful in 5m31s
CI / docker (push) Successful in 1m32s
CI / integration_tests (push) Successful in 7m18s
CI / coverage (push) Successful in 13m37s
CI / status-check (push) Successful in 1s

This commit is contained in:
CleverAgents Build Agent
2026-04-14 16:47:32 -04:00
parent d3cb534caf
commit abbb830c60
+10 -11
View File
@@ -90,21 +90,20 @@ In an infinite loop do the following each cycle:
1. **Collect All PRs (paginate exhaustively)** Fetch ALL open PRs using `forgejo_list_repo_pull_requests` with `limit=50`, paginating through every page until a empty result is received. Record for each PR: number, title, labels, `mergeable`, `merge_base`, `base.sha`, head SHA.
2. Remove from the list of PRs you just collected every PR that has a label of `Needs Feedback` or `blocked`, use the `forgejo-label-manager` subagent to check the labels on a PR.
3. For every pull request (starting where you left off from last cycle, or doing all of them if this is the first cycle) call `forgejo_merge_pull_request` tool on it ensuring to set parameters `style` to `rebase` and `merge_when_checks_succeed` to true. Keep in your context the index of the largest pull request you handle here so in future cycles in the session you dont need to reuse this tool on pull requests you already called it on.
4. Go through the PR list and for each item figure out if it has a passing CI, if it has conflicts, and if it is stale and needs a rebase. Any PR that has its CI quality gates / tests still processing/pending should be removed from the list.
5. Now sort the list into four groups:
3. Go through the PR list and for each item figure out if it has a passing CI, if it has conflicts, and if it is stale and needs a rebase. Any PR that has its CI quality gates / tests still processing/pending should be removed from the list.
4. Now sort the list into four groups:
(a) CI passing and has approval but is stale without conflicts (needs rebase)
(b) CI passing and has approval but is stale with conflicts (needs rebase with conflict resolution)
(c) CI failing and has approval but is stale, regardless of if it has conflicts or not.
(d) everything else.
6. Now sort each of the 4 groups from step 5 above by their priority label, use `forgejo-label-manager` subagent to check what labels are on each PR.
7. If group (a) from step 5 is empty, then skip this step, if it has one or more PR in it then sequentially dispatch a single `pr-merge-worker` subagent for each PR in the group and then start the cycle over at #1 (skipping the rest of the steps in this cycle)
8. If group (b) from step 5 is empty, then skip this step, if it has one or more PR in it then sequentially dispatch a single `pr-merge-worker` subagent for each PR in the group and then start the cycle over at #1 (skipping the rest of the steps in this cycle)
9. If group (c) from step 5 is empty, then skip this step, if it has one or more PR in it then sequentially dispatch a single `pr-merge-worker` subagent for each PR in the group and then start the cycle over at #1 (skipping the rest of the steps in this cycle)
10. If group (d) from step 5 is empty, then skip this step, if it has one or more PR in it then sequentially dispatch a single `pr-merge-worker` subagent for each PR in the group and then start the cycle over at #1 (skipping the rest of the steps in this cycle)
11. Sleep for 5 minutes using `bash("sleep 300", timeout=360000)`.
12. If at least 10 minutes has passed since the last time you updated your automation tracking status ticket, or if you never created/updated one, (see tracking section below) then update your tracking ticket using the `automation-tracking-manager` subagent according to the details provided in the section labeled "tracking" below.
13. Loop through the cycle indefinately by starting at step 1 above again.
5. Now sort each of the 4 groups from step 4 above by their priority label, use `forgejo-label-manager` subagent to check what labels are on each PR.
6. If group (a) from step 4 is empty, then skip this step, if it has one or more PR in it then sequentially dispatch a single `pr-merge-worker` subagent for each PR in the group and then start the cycle over at #1 (skipping the rest of the steps in this cycle)
7. If group (b) from step 4 is empty, then skip this step, if it has one or more PR in it then sequentially dispatch a single `pr-merge-worker` subagent for each PR in the group and then start the cycle over at #1 (skipping the rest of the steps in this cycle)
8. If group (c) from step 4 is empty, then skip this step, if it has one or more PR in it then sequentially dispatch a single `pr-merge-worker` subagent for each PR in the group and then start the cycle over at #1 (skipping the rest of the steps in this cycle)
9. If group (d) from step 4 is empty, then skip this step, if it has one or more PR in it then sequentially dispatch a single `pr-merge-worker` subagent for each PR in the group and then start the cycle over at #1 (skipping the rest of the steps in this cycle)
10. Sleep for 5 minutes using `bash("sleep 300", timeout=360000)`.
11. If at least 10 minutes has passed since the last time you updated your automation tracking status ticket, or if you never created/updated one, (see tracking section below) then update your tracking ticket using the `automation-tracking-manager` subagent according to the details provided in the section labeled "tracking" below.
12. Loop through the cycle indefinately by starting at step 1 above again.
## Tracking