fix(disposition): hold loudly on an unstable mergeable state instead of approving into a silent stall - #8783
Merged
Conversation
…of approving into a silent stall (#8758) PR #8711 exposed the seam: a non-required third-party check concluded action_required, GitHub reported mergeable_state "unstable", and ORB's four surfaces disagreed — the unified comment said Manual Review, approve fired ("gate satisfied and CI is green"), the ready-to-merge label landed, the merge silently self-suppressed (mergeableClean requires "clean"), and the only record of why lived in an internal audit_events row. A human had to notice. - heldForManualReview gains a mergeableState === "unstable" term: no approve, no ready-to-merge label, manual-review label + comment naming the culprit non-required check(s) (threaded via the CI aggregate's nonRequiredFailingDetails; generic wording when unitemized). - New 1f fallback mirrors 1d so the hold stays visible on repos where review_state_label autonomy isn't acting but merge is. - The executor live-rechecks mergeable_state before posting an approve (denied on live dirty/unstable, fails open on ambiguous reads), the same #3863-shaped guard merge-adjacent actions already had. - dirty/behind/blocked semantics deliberately unchanged: dirty stays the close path, behind stays the rebase rail's, blocked stays approvable (the approval itself can be the unblocking act).
Contributor
Logic backtestReplayed 0 historical case(s) for Backtest comparison:
|
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
loopover-ui | 9ce0851 | Commit Preview URL Branch Preview URL |
Jul 26 2026, 05:36 AM |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8783 +/- ##
==========================================
- Coverage 93.80% 92.25% -1.55%
==========================================
Files 797 797
Lines 79517 79529 +12
Branches 24097 24103 +6
==========================================
- Hits 74593 73372 -1221
- Misses 3556 5090 +1534
+ Partials 1368 1067 -301
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Summary
The #8711 incident fix (adversarial-audit epic #8757). A non-required third-party check concluded
action_required, GitHub reportedmergeable_state: unstable, and ORB's four decision surfaces disagreed: the unified comment said "Manual Review", the planner posted an APPROVE review claiming "gate satisfied and CI is green", the review-state label resolved to ready-to-merge, the merge silently self-suppressed (mergeableCleanrequires"clean"), and the only record of why lived in an internalaudit_eventsrow. A human had to notice and merge manually.Changes
src/settings/agent-actions.ts—heldForManualReviewgains amergeableState === "unstable"term: no approve, no ready-to-merge label; the review-state label resolves to manual-review with a reason + comment naming the culprit non-required check(s). A new 1f fallback (mirroring 1d) keeps the hold visible on repos wherereview_state_labelautonomy isn't acting butmergeis. NewmergeUnstableHoldReason/mergeUnstableHoldCommentbuilders follow theadvisoryHoldReason/advisoryHoldComment(feat(gate): configurable advisory check-runs so a non-resolving external status never blocks or stalls the gate forever #4372) pattern, generic wording when the CI aggregate couldn't itemize the source.src/queue/processors.ts— threads the CI aggregate'snonRequiredFailingDetailsinto the planner input so the hold names the actual check.src/services/agent-action-executor.ts— approve now live-rechecks mergeable state right before posting (the same Review latency can create a merge-conflict close window an author didn't cause #3863-shaped guard merge-adjacent actions already had): denied on livedirty/unstable, fails open on ambiguous reads so a transient fetch hiccup never strands approval-required repos.Deliberately unchanged:
dirtystays the close path,behindstays the rebase rail's,blockedstays approvable (the approval itself can be the unblocking act — requiringcleanfor approve would deadlock approval-required repos). Tightening-only: no path that previously withheld an approve/merge now grants one. Close semantics untouched (explicit regression test: a red-CI contributor PR still closes when also unstable).Test plan
npm run typecheck— cleanunstable): no approve, no merge, manual-review label + comment naming the check; generic-wording arm; idempotency; blocked/behind still approvable; close never softenedunstable/dirty, fails open on ambiguousCloses #8758