Repository navigation
Description
Target: v6.
Found in the v6 serialized merge lane live exercise (#7563, step 4). Code cited at
44534cd40.
Executive summary
In a repository using the serialized merge lane, one pull request at a time sits at the "front" and is the only one allowed to merge. If someone puts the hold label on that front PR, the lane is supposed to drop it from the front right away ("a hold label is present") and promote the next PR. It doesn't. The sweep sees the label and skips the PR before it ever reaches the lane, so the lane never learns about the hold. The held PR keeps the front, and every other PR waits until the front timeout (60 minutes by default). The fix: when a hive-serialized repo's sweep skips a queued PR for a label, it should still hand the PR to the lane front-only, as it already does for its other rejections.
Evidence
On a self-hosted v6 hive at dd406b3, in repo Danathar/hive-lane-sandbox (merge_strategy: hive-serialized, required check test, strict):
- 01:13:36Z: PR C (docs: add brew formula and Helm chart freshness checks to reviewer scope #7)
front-enter; 01:13:39Zbranch-update. - 01:13:40Z: PR D (docs: update supervisor CLAUDE.md with EXECUTOR MODE and dispatcher protocol #6)
deferred: not at the front of the lane. - 01:13:59Z:
holdadded to C. - From 01:13:59Z to 02:15:33Z, every queued sweep (about every 2 minutes) logged the same pair:
- C:
automerge sweep skipped PR … reason=label:hold - D:
automerge sweep: serialized lane did not merge PR … reason=deferred: not at the front of the lane
- C:
- 02:15:33Z: C
front-exit"front timeout after 1h0m0s: the head after the branch update was never evaluated". Only then was D promoted.
C's check had finished green at about 01:24Z. The lane still showed C as updating, because the lane never evaluated it again.
Root cause
src/pkg/github/automerge/automerge_sweep.go at 44534cd40:
:943, inSweepQueuedAutoMerges's per-issue loop:if reason := c.prefilterQueuedIssue(issue, label); reason != "" { … continue }.prefilterQueuedIssue(:2189) callslabelBlockReason(:2130). That returnslabel:holdfor a held PR (alsolabel:needs-human,label:do-not-merge*,label:needs-rebaseandsentinel).- Because of the
continue,trySweepQueuedPR(:2586) is never called. That is the function whose own rejections go throughrejectBeforeLane(:1964, called at:2602).rejectBeforeLaneasks the lane, front-only, to re-evaluate the PR, and the lane then leaves the front withdefaultBlocked's reason, "a hold label is present" (src/pkg/mergelane/lane.go:488-495).
The self-authored sweep has the same shape: a held PR continues at :1105 before trySweepSelfAuthoredPR (:1640, rejectBeforeLane at :1659). Fix both.
Wanted behavior
In a hive-serialized repo, when a queued (or self-authored) PR is skipped by a label prefilter, it still gets the front-only lane evaluation that rejectBeforeLane performs. A front PR with hold (or any label defaultBlocked/the lane's Blocked option refuses) leaves the front on the next sweep with the lane's reason, and the next waiting PR is promoted in the same transaction. Once the label is removed, the PR rejoins at the back (this part already works).
Acceptance criteria
- On a
hive-serializedrepo, a queued PR at the front that gainsholdleaves the front on the next queued sweep. Thefront-exitreason is "a hold label is present", and the next waiting PR getsfront-enter. - Same for the self-authored sweep path.
- A held PR that is not at the front is still skipped without being admitted to the lane.
rejectBeforeLaneusesFrontOnly: true, so it must not add the PR towaiting. -
directrepos behave exactly as today: no lane call. - The prefilter stays cheap. Do not add a
PullRequests.Getfor every held PR on non-serialized repos. Only make the extra call when the repo is serialized (c.serializedLane(displayRepo)).
Test plan
src/pkg/github/automerge/automerge_lane_test.go: addTestLaneSweep_HeldQueuedFrontLeavesTheLane, modeled onTestLaneSweep_RejectedPRIsHandedToTheLaneFrontOnly(:262). Queue a PR, label ithold, and assert that the fake gate receives aFrontOnlyrequest for it and that the sweep result is a skip.- Add the equivalent for the self-authored path.
- Add a negative case: a
directrepo with a held PR makes no gate call. - Run
cd src && go test ./pkg/github/automerge/ ./pkg/mergelane/. Use a short checkout path;pkg/agenttests overflowsun_pathfrom deep paths.
Out of scope / do not change
- Do not weaken the hold. A held PR must never merge. The lane's own
policyProblemcheck must stay. - Do not change
labelBlockReason's set of labels. - Do not change the front timeout or its extensions.
Activity
hivecommons-hive commentedon Oct 28, 2026
🔒 Claimed by @thatguywob (contributor on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 30m0s without activity and renews while the work continues. Reply
/unclaimto release, or/claimto take it over if you outrank the holder.hivecommons-hive commentedon Oct 28, 2026
🔓 Claim by @thatguywob released (lease revoked).
🐛 fix: release label-blocked serialized lane fronts during sweeps
📖 docs(v6): behind fork leaves the lane front at once; serialized lan…
🐛 fix: release label-blocked serialized lane fronts during sweeps
hivecommons-hive commentedon Oct 28, 2026
Verified on v6: fixed by #14945. Queued sweep now calls
rejectPrefilteredBeforeLaneon every prefilter rejection (src/pkg/github/automerge/automerge_sweep.go:990); self-authored sweep does so for held PRs (:1169, reasonlabel:hold) and other prefilter rejections (:1192). The helper (:2014-2020) returns early for non-serialized repos (no extraPullRequests.Get/lane call), fetches the PR only on the queued path, and callsrejectBeforeLanefront-only, so a held front leaves with the lane's reason and the next PR is promoted, while a held non-front PR is never admitted. Covered byTestLaneSweep_HeldQueuedFrontLeavesTheLane(queued/self-authored, serialized/direct). All acceptance criteria met.🐝 Hive Agent:
scanner| Instance:hosted-available-oke-11-placeholder-r05x| SHA:unknown— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88
github-actions commentedon Oct 28, 2026
@Danathar this issue was closed by @hivecommons-hive[bot] as completed.
If this was closed by a merged PR, the fix only takes effect once it ships in a tagged release and your deployment updates to it — check your running version against the fix before concluding the fix failed.
If you are still seeing the problem, comment
/reopenand it will be reopened for you — you do not need write access. Please add what you are still observing (running version, logs, steps) so it is not closed the same way again.