Repository navigation
Cluster related bravebot issues into one iteration - #208
Merged
Merged
Conversation
run.sh offers a pool of related pending issues alongside the lead issue, capped by the lead's size label (size/1: 10, size/2: 6, size/3: 4, size/4 and size/5: 1). The caps are maximums. claim-companions.py claims the chosen ones under the PRD lock, and a lead's committed and pushed transitions carry to its companions. Only the bravebot profile enables it; brave-core is unchanged.
bbondy
approved these changes
Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User impact: a bravebot iteration given one issue can now also fix the related open issues in the same branch and PR, up to a cap set by the lead issue's size label.
The problem
Bravebot issues that touch the same code are each worked in their own iteration, worktree and PR. Reviewers get several small PRs that overlap, and each one repeats the same presubmit run. The loop has no way to hand an iteration a second issue.
Reproduce
./run.sha pending issue labelledsize/1while other pendingsize/1issues exist.Observed: the prompt names only the lead issue, and the other pending issues stay pending until later iterations. Expected: the prompt offers the related pending issues, up to 10 for a
size/1lead./usr/bin/python3 -m pytest tests/test_cluster.pycovers the ceilings, the pool, the claims and the status propagation.The fix
run.shnow adds a "Clustering:" paragraph to the prompt when the profile has aclusteringblock and the lead issue has a size label. It lists pending issues no larger than the lead that no other run holds, and points the agent atprojects/bravebot/docs/clustering.md, which adapts theimplement-issuesskill: screen for real relatedness, claim, one worktree, branch and PR, one commit per issue, one presubmit run.The caps are maximums, not targets:
size/110,size/26,size/34,size/4andsize/5just the lead.claim-companions.pyre-checks them under the PRD lock before claiming, so the agent cannot exceed them. Companions follow the lead's committed and pushed transitions with the same branch and PR number, and return to pending if the lead is skipped or invalid. Only the bravebot profile has the block; brave-core is unchanged.Test plan
/usr/bin/python3 -m pytest tests/test_cluster.py tests/test_scripts.py -q -k "not TestRunLocking and not TestReviewRequestQueue and not TestWaitGateStart"— 562 passed, on this branch rebased on origin/masterruff checkandruff formaton the changed Python files — cleanrun.shiteration with a real clustermake check-reviewdogscripts/check-pr-body.pyKnown gaps
TestRunLocking,TestReviewRequestQueue,TestWaitGateStart) had 9 failures in the full run. 4 reproduce on an unmodified checkout and look like macOS problems. The other 5 did not fail there, and I have not shown they are unrelated to this change.clustering.mdwas adapted by hand from theimplement-issuesskill and not diffed against it. Two lines are mine rather than the skill's: "when unsure whether two are related, they are", and "reproduce each issue onupstream/main". Remove them if they should not be there.