Skip to content

gh pr edit --add-reviewer can remove reviewers assigned automatically by GitHub #14937

Open

Description

@bobvanderlinden

Describe the bug

gh pr edit --add-reviewer can remove a reviewer selected by a team's automatic review assignment.

Observed with gh 2.103.3 on github.com. After requesting a team configured for round-robin assignment, the PR timeline showed an individual reviewer being requested and then removed one second later. Only the team request remained, where-as the (round-robin picked) individual should've been assigned as well.

The command should add review requests without removing requests created concurrently by GitHub.

Steps to reproduce

  1. Configure a GitHub team with automatic review assignment enabled.

  2. Create a draft PR.

  3. Mark it ready and immediately request the team:

    gh pr ready <number> --repo <owner>/<repository>
    
    gh pr edit <number> --repo <owner>/<repository> \
      --add-reviewer <organization>/<team>
  4. Inspect the PR timeline and requested reviewers.

This appears timing-dependent. The observed timeline was:

09:02:53  Requested review from the team.
09:02:53  Requested review from an automatically selected team member.
09:02:54  Removed the individual review request.

No explicit reviewer-removal command was run.

Expected behavior

--add-reviewer adds the supplied reviewers while preserving existing and concurrently created review requests.

Actual behavior

An automatically assigned individual reviewer can be removed.

Suspected cause

The implementation reads existing review requests, merges additions locally, then replaces the server's reviewer list using union: false.

A review request created after the initial read can therefore be omitted from the replacement list. This mechanism is consistent with the observed timeline.

Possible fix

For non-interactive, add-only operations, send only the requested additions with union: true.

Changing every reviewer update to union: true would break --remove-reviewer and interactive deselection, so those paths need to retain replacement behavior or use separate removal operations.

Related issues

  • #7721: reviewer removal caused by an empty --add-reviewer argument.
  • #9604: interactions between reviewer requests and automatic code-owner assignment during PR creation.

Activity

  1. added
    needs-triage
    on Nov 4, 2026
  2. cli-triage commented on Nov 9, 2026

    @cli-triage

    Partly reproduced on 2.103.3.

    Using test data with one existing reviewer:

    $ gh pr edit 123 -R example.invalid/hello --add-reviewer example.invalid/core
    https://github.com/example.invalid/name

    Exit status: 0.

    The command sent the existing reviewer plus the new team with union: false, replacing the full server-side reviewer set. The release and source builds sent the same request. This confirms the reported race window, but the test setup cannot trigger GitHub's automatic round-robin assignment, so the final reviewer removal itself was not observed.

    Supporting reports

    Generated by issue triage.

  3. deleted a comment from cli-triage on Nov 9, 2026
  4. added
    bug
    gh-pr
    priority-3
    on Nov 9, 2026
  5. removed
    needs-triage
    on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggh-prpriority-3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions