Repository navigation
π fix(automerge): time-box adopted-PR rebase attempts and re-home when exhausted - #16028
Conversation
β¦n exhausted Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com> Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. hive/awaiting-ci: CI pending β sweep will merge when green. π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 Evidence bundle `#160281a69ac2` sha256:62757360ead1dfb96f9d32c7d289950fa2b86af96349b269655b526356cf2cb4 β download from the dashboard or `hivectl review evidence #16028`. |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
The new governor.labels.stage.adoption.rebase_attempt_timeout key made TestAgentRuntimeConfigGolden report the field as unexpected; pin its empty default in the golden JSON. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Read the diff against the tree at 1a69ac2; this looks correct to me.
What I verified:
src/pkg/rebasemerge/attempts.goβCount()=len(Heads)+StalledandExhausted()derive from it, so a timed-out attempt is indistinguishable from a dirty push for the cap.Dispatchreturnsfirst=falsewhileDispatchedAttempt == Count(), and bothExpire(viaStalled++) andObserve(new head) advanceCount(), which re-armsDispatched()for the next attempt β so each attempt is routed/logged exactly once, andExpireis a no-op on an attempt that was never dispatched or already pushed.src/cmd/hive/merge_eligibility.go:1258-1265βprevis captured beforeExpire, sotimedOut.Waiting(rebaseNow)reports the stalled attempt's wait, not the new one's.src/cmd/hive/main.go:2222buildsautomerge.RebaseEpisode.Exhaustedfroma.Exhausted(), so the newinPlaceRebaseExhaustedinautomerge_contributor_adopt.go:1158sees timed-out attempts too;inPlaceRehomeReasonstill requiresneeds-rebase/conflict reason and the same guards (AdoptedInPlace, head match, no DCO-red, not blocked) beforerebaseExhaustedshort-circuitsadoptionStale.TestWriteMergeEligible_AdoptedRebaseAttemptTimesOutWithoutPushwalks dispatch β in-window re-sweep (no re-route) β timeout β attempt 2 β exhausted, and fails on the base code (whereCount()never moves without a push).
One consequence worth being aware of, not a defect: a fixer that pushes a still-dirty head after its 15m deadline lands at Heads=2, Stalled=1 β exhausted immediately, so a slow-but-working fixer gets one shot, not two. That matches the issue's "timeout = failed attempt" framing and the default is tunable via rebase_attempt_timeout.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Closes #16023
Why
An adopted conflicting PR could sit on Rebasing Β· attempt 1/2 forever when the fallback fixer was busy:
rebasemerge.Attempts) only advanced when it saw a new dirty head. If the fixer never pushed, the episode never left attempt 1, soExhausted()never fired and nothing escalated.writeMergeEligiblere-listed and re-logged "PR routed to fixer for rebase" every sweep, with no record that the attempt had already been dispatched or how long it had waited, so the stall looked like progress.rebase-rehome) waited for the 074 dwell (3h) viaadoptionStale, so a conflict the fixer never picked up stalled silently for hours.Approach
ci-failing.jsonso the kick overlay still sees it, but they don't re-route it or log it again.rebase-rehome) on that sweep instead of waiting out the 3h dwell.The deadline is a new, additive key
governor.labels.stage.adoption.rebase_attempt_timeout(default15m, matching the other adoption waits). No existing key, id or public name changes. Episodes already on disk load unchanged: the new fields are optional and start empty. Hive-authored PRs routed to their own lane are not time-boxed, so their behaviour does not change.Out of scope, per the issue: routing attempt 2 to a different fixer than attempt 1 (the alternate fixer is still hard-coded) and an in-process git rebase.
β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 requested_by=@clubanderson