You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature: gh pr merge remove from merge queue #14593
Thanks for the report! I'm suggesting enhancement and gh-pr, since this is a request for new functionality on gh pr merge rather than a confirmed bug.
Looking at the current code, --disable-auto calls disableAutoMerge, which only invokes the disablePullRequestAutoMerge GraphQL mutation. That mutation disables auto-merge but has no effect on merge-queue membership, which is governed separately (see shouldAddToMergeQueue and the enqueuePullRequest-based flow in merge()). This matches the reporter's observation that --disable-auto doesn't remove a PR already in the queue, and explains why a --remove-from-queue-style option (likely needing a new dequeuePullRequest mutation call) isn't currently exposed. I did not find an existing issue specifically requesting this capability, so I'm not flagging it as a duplicate. On the separate point about exit codes, I'd treat that as part of the same feature discussion rather than a distinct bug, since --disable-auto is documented/intended to act on auto-merge only, not merge-queue status — a maintainer should confirm the intended semantics before deciding on exit-code behavior.
I do not think this should expand the behavior of --disable-auto for several reasons:
Automatic merge and merge queue membership are separate states backed by separate mutations.
Before a pull request enters the queue, --disable-auto cancels the pending transition into the queue and leaves the pull request open. After the pull request has entered the queue, that transition is complete and the queue controls what happens next.
A pull request can be added directly to the queue through the web interface, the API, or another integration without auto merge being involved. Using --disable-auto to remove such an entry would not match how it was created.
Making --disable-auto also remove an active queue entry could unexpectedly cancel a merge when the user only intended to disable auto merge.
Successfully disabling auto merge should continue to exit with status 0 even when the pull request remains queued. Changing that established exit status would risk breaking scripts that rely on the current behavior.
However, I agree that adding a --dequeue option to gh pr merge makes sense. --dequeue matches the GraphQL API terminology and clearly describes the operation. The usual pull request resolution should remain unchanged, including selecting the pull request associated with the current branch when no argument is provided. --dequeue should be a narrowly isolated action. It should not be combined with --auto, --disable-auto, --admin, a merge strategy, or any other option that controls how a pull request is merged. If another merge option is provided alongside --dequeue, the command should reject the combination rather than attempt to infer the user's intent.
The --dequeue operation should follow the API result:
Exit with status 0 only when the mutation successfully removes a pull request from the queue.
If the branch has no merge queue, surface the API error and exit with status 1.
If the pull request is not queued or was already dequeued, surface the API error and exit with status 1.
We confirmed that the API returns an UNPROCESSABLE error both when no merge queue exists and when the pull request has no queue entry. The exact messages differ, but the CLI should not inspect error text to reinterpret either response as success.
The CLI could technically query the queue state before attempting the mutation, but that would introduce an additional request and a race between checking and removing the entry. I think the clearest contract is that success means the dequeue mutation was effective, while an API rejection remains a failure.
For triage, I am marking this as an
enhancementa request to improve CLI
and will also add the
coreThis issue is not accepting PRs from outside contributors
because we are not yet ready to accept contributions for this and the team needs to discuss the design further.
Thank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.
Unless you see the
help wantedContributions welcome
label, we are not currently looking for external contributions for this feature.
If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.
Activity
cli-triage commentedon Oct 4, 2026
Thanks for the report! I'm suggesting
enhancementandgh-pr, since this is a request for new functionality ongh pr mergerather than a confirmed bug.Looking at the current code,
--disable-autocallsdisableAutoMerge, which only invokes thedisablePullRequestAutoMergeGraphQL mutation. That mutation disables auto-merge but has no effect on merge-queue membership, which is governed separately (seeshouldAddToMergeQueueand theenqueuePullRequest-based flow inmerge()). This matches the reporter's observation that--disable-autodoesn't remove a PR already in the queue, and explains why a--remove-from-queue-style option (likely needing a newdequeuePullRequestmutation call) isn't currently exposed. I did not find an existing issue specifically requesting this capability, so I'm not flagging it as a duplicate. On the separate point about exit codes, I'd treat that as part of the same feature discussion rather than a distinct bug, since--disable-autois documented/intended to act on auto-merge only, not merge-queue status — a maintainer should confirm the intended semantics before deciding on exit-code behavior.nightingale-develop commentedon Oct 4, 2026
Hi @A4-Tacks ! I'd like to work on this if the proposed direction is acceptable. Could you please assign this issue to me?
A4-Tacks commentedon Oct 4, 2026
I have no objection.
I don't have the permissions to assign
babakks commentedon Oct 5, 2026
Thanks for the suggestion, @A4-Tacks! 🍻 And thanks for your interest in contributing, @nightingale-develop! 🙏
I do not think this should expand the behavior of
--disable-autofor several reasons:--disable-autocancels the pending transition into the queue and leaves the pull request open. After the pull request has entered the queue, that transition is complete and the queue controls what happens next.--disable-autoto remove such an entry would not match how it was created.--disable-autoalso remove an active queue entry could unexpectedly cancel a merge when the user only intended to disable auto merge.However, I agree that adding a
--dequeueoption togh pr mergemakes sense.--dequeuematches the GraphQL API terminology and clearly describes the operation. The usual pull request resolution should remain unchanged, including selecting the pull request associated with the current branch when no argument is provided.--dequeueshould be a narrowly isolated action. It should not be combined with--auto,--disable-auto,--admin, a merge strategy, or any other option that controls how a pull request is merged. If another merge option is provided alongside--dequeue, the command should reject the combination rather than attempt to infer the user's intent.The
--dequeueoperation should follow the API result:We confirmed that the API returns an
UNPROCESSABLEerror both when no merge queue exists and when the pull request has no queue entry. The exact messages differ, but the CLI should not inspect error text to reinterpret either response as success.The CLI could technically query the queue state before attempting the mutation, but that would introduce an additional request and a race between checking and removing the entry. I think the clearest contract is that success means the dequeue mutation was effective, while an API rejection remains a failure.
For triage, I am marking this as an enhancementa request to improve CLI
and will also add the
core
This issue is not accepting PRs from outside contributors
because we are not yet ready to accept contributions for this and the team needs to discuss the design further.
github-actions commentedon Oct 5, 2026
Thank you for your issue! We have categorized it as an enhancement (feature or improvement) request, and it has been added to our backlog. In doing so, we are not committing to implementing this feature at this time, but, we will consider it for future releases based on community feedback and our own product roadmap.
Unless you see the help wantedContributions welcome
label, we are not currently looking for external contributions for this feature.
If you come across this issue and would like to see it implemented, please add a thumbs up! This will help us prioritize the feature. Please only comment if you have additional information or viewpoints to contribute.
nightingale-develop commentedon Oct 5, 2026
@babakks Thank you for a reply. I will wait until the design discussion is complete and I will be glad to help if needed