-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Problem
The orchestrator dispatches the quality gate (step 4) BEFORE rebasing the PR (rebase step). Both happen in the same run. This creates a race condition:
Current sequence (single orchestrator run)
- Check CI ✅, check threads ✅, check Copilot review ✅
- Dispatch quality gate — quality gate agent starts (takes 2-4 minutes)
- Rebase —
git push --force-with-leasecompletes in seconds
The race
The quality gate agent was dispatched at step 2 but takes minutes to clone, evaluate, and approve. Meanwhile the rebase at step 3 pushes a new commit in seconds.
- If quality gate checks out AFTER rebase lands (common case): It evaluates the rebased code and approves the rebased commit. Works by coincidence.
- If quality gate checks out BEFORE rebase lands (possible): It evaluates pre-rebase code, approves the old commit. Then rebase pushes →
dismiss_stale_reviewsdismisses the approval. PR stuck until next orchestrator cycle re-dispatches.
Observed on PR #200 (2026-03-21)
- 14:49:00 — Quality gate dispatched
- 14:49:03 — Rebase pushed
- 14:53:33 — Quality gate approved (happened to evaluate rebased code)
- 14:53:35 — Auto-merged
Worked by coincidence — quality gate was slow enough to see rebased code.
Fix
Move rebase BEFORE the quality gate dispatch. If a rebase is needed, do it and continue — let the next orchestrator cycle (triggered by CI/Copilot workflow_run completing) handle the quality gate dispatch after all checks pass on the rebased commit.
Correct sequence
- Orchestrator cycle 1: Rebase needed → rebase →
continue - CI runs on rebased commit, Copilot reviews rebased commit
- Orchestrator cycle 2 (triggered by CI/Copilot completing): CI ✅, threads ✅, Copilot review ✅ → dispatch quality gate
- Quality gate approves → auto-merge
No race — quality gate only runs after the final commit is settled.
Related
- bug: quality gate dispatched before Copilot review completes #178 — quality gate timing (partially fixed in PR fix: quality gate waits for Copilot review and checks actual approval state #202)
- fix: quality gate waits for Copilot review and checks actual approval state #202 — added Copilot review check before quality gate
- fix: pipe gh output to jq for Copilot review check #206 — added Copilot code review to workflow_run triggers
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working