Summary
mcp__sdlc-server__pr_merge returned {ok: true, enrolled: true, merged: false, pr_state: "OPEN"} for an MR that was actually merged on the GitLab side moments later. The eager-return-before-merge-complete behavior surfaces as a stale state to the caller and breaks downstream logic that branches on merged.
Environment
- Where observed: /wavemachine Wave 1 Flight 1 post-flight merge of !69 (
feature/76-foundation-pgvector-deps → kahuna/74-pluggable-vector-stores) on analogicdev/internal/tools/wellofsouls, 2026-05-06
- Project: GitLab,
merge_trains_enabled: false, merge_method: merge
Steps to Reproduce
- Open MR with green CI on a GitLab project where
merge_method: merge.
- Call
mcp__sdlc-server__pr_merge({number: <iid>}).
- Observe response shape:
{"ok": true, "number": 69, "enrolled": true, "merged": false, "merge_method": "direct_squash", "queue": {"enabled": false, "position": null, "enforced": false}, "pr_state": "OPEN", "url": "...", "warnings": [], "queue_fallback": false}
- Query MR state via
glab api projects/:id/merge_requests/69 immediately after — state: "merged". The merge had already completed by the time the next API call landed.
Expected Behavior
For a merge-queue-disabled GitLab repo (no enrollment delay), pr_merge should block until the merge actually completes and return {merged: true, pr_state: "MERGED"}. Or, if the eager-return shape is intentional (e.g. for queue-enabled paths), the caller needs a clear way to distinguish "queued, not yet merged" from "merge in flight, will land".
The same call shape on !68 (the parallel MR in the same flight, merged moments earlier) correctly returned merged: true with a merge_commit_sha. So the eager-false is non-deterministic — likely a race between the merge call and GitLab's state-update propagation.
Actual Behavior
merged: false returned despite GitLab side completing the merge.
- Caller sees
pr_state: "OPEN" and may incorrectly treat the merge as failed/pending.
- A subsequent
glab api query confirms the merge actually happened.
Severity
severity::moderate — /nextwave's post-flight Prime branches on the response. In my run it correctly handled !69 because I cross-checked via glab api and saw the merged state. Without that cross-check, the orchestrator would have hung waiting for a "second" merge that already happened.
Workaround
After pr_merge, query glab api projects/:id/merge_requests/<iid> | jq .state to verify actual state. If state: "merged", treat as success regardless of the response's merged field.
Acceptance Criteria
Dependencies
Summary
mcp__sdlc-server__pr_mergereturned{ok: true, enrolled: true, merged: false, pr_state: "OPEN"}for an MR that was actually merged on the GitLab side moments later. The eager-return-before-merge-complete behavior surfaces as a stale state to the caller and breaks downstream logic that branches onmerged.Environment
feature/76-foundation-pgvector-deps→kahuna/74-pluggable-vector-stores) onanalogicdev/internal/tools/wellofsouls, 2026-05-06merge_trains_enabled: false,merge_method: mergeSteps to Reproduce
merge_method: merge.mcp__sdlc-server__pr_merge({number: <iid>}).{"ok": true, "number": 69, "enrolled": true, "merged": false, "merge_method": "direct_squash", "queue": {"enabled": false, "position": null, "enforced": false}, "pr_state": "OPEN", "url": "...", "warnings": [], "queue_fallback": false}glab api projects/:id/merge_requests/69immediately after —state: "merged". The merge had already completed by the time the next API call landed.Expected Behavior
For a merge-queue-disabled GitLab repo (no enrollment delay),
pr_mergeshould block until the merge actually completes and return{merged: true, pr_state: "MERGED"}. Or, if the eager-return shape is intentional (e.g. for queue-enabled paths), the caller needs a clear way to distinguish "queued, not yet merged" from "merge in flight, will land".The same call shape on !68 (the parallel MR in the same flight, merged moments earlier) correctly returned
merged: truewith amerge_commit_sha. So the eager-falseis non-deterministic — likely a race between the merge call and GitLab's state-update propagation.Actual Behavior
merged: falsereturned despite GitLab side completing the merge.pr_state: "OPEN"and may incorrectly treat the merge as failed/pending.glab apiquery confirms the merge actually happened.Severity
severity::moderate—/nextwave's post-flight Prime branches on the response. In my run it correctly handled !69 because I cross-checked viaglab apiand saw the merged state. Without that cross-check, the orchestrator would have hung waiting for a "second" merge that already happened.Workaround
After
pr_merge, queryglab api projects/:id/merge_requests/<iid> | jq .stateto verify actual state. Ifstate: "merged", treat as success regardless of the response'smergedfield.Acceptance Criteria
pr_mergeblocks until merge completes (or until a sane timeout). Response is deterministic —merged: true+merge_commit_shapopulated, ORmerged: falsewith a clearenrolled-but-not-yet-landedstate distinguishable fromfailed-to-merge.pr_mergereturnsmerged: true.Dependencies