unstick_queue — auto-unwedge merge-queue stalls
Purpose
GitHub merge queues require ALL statusCheckRollup entries to complete — not just the repo's required checks on main. Third-party bot check-runs, flaky runners and dropped webhooks can hang IN_PROGRESS indefinitely, pinning the queue head AWAITING_CHECKS forever and blocking every downstream PR from merging.
This skill detects that specific condition and recovers by dequeuing + re-enqueuing the head PR. It is deliberately scoped to avoid admin-bypass of genuine failures: a PR with a failed required check is classified BROKEN and left alone.
Scope
The skill's scope is defined as follows:
- Probe
repository.mergeQueue.entriesfor every repo in scope. - For each entry at
position == 1withstate == AWAITING_CHECKSlonger thanawaiting-minutes(default 30):- Fetch
statusCheckRollupvia GraphQL. - Run
plugins/onex/hooks/lib/queue_stall_classifier.classify_queue_entry.
- Fetch
- Act on the verdict:
STALL— dequeue viadequeuePullRequest, sleep briefly, re-enqueue viaenqueuePullRequest. Record the event under$ONEX_STATE_DIR/queue-unstick/<repo>/pr-<N>.json.BROKEN— skip (real failure; not our problem).ESCALATE— same PR was unstuck ≥ 3 times within the past hour; stop auto-healing and emit friction via/onex:record_frictionso the deeper cause is surfaced.HEALTHY— no action.
Non-goals
- Do NOT admin-bypass check-runs (mark complete, skip).
- Do NOT edit branch-protection required contexts.
- Do NOT close/reopen PRs.
Invocation
Tick path (preferred): ai.omninode.unstick-queue.plist runs every 10 minutes via scripts/cron-unstick-queue.sh.
Interactive: /onex:unstick_queue --dry-run --repos omnibase_infra,omniclaude for manual inspection.
Files
plugins/onex/hooks/lib/queue_stall_classifier.py— pure classifier + persistence (tested).scripts/lib/run-unstick-queue.py— the runner the cron wrapper invokes.scripts/cron-unstick-queue.sh— headless wrapper + lock + circuit breaker.scripts/launchd/ai.omninode.unstick-queue.plist— launchd agent (600s interval).
See Also
- Sibling:
_queue_healincron-merge-sweep.sh(handles method-mismatch silent drops — this skill handles check-rollup stalls)