Skip to content

gh pr create reports a generic permissions error when the repository’s open-PR limit is reached #14874

Open

Description

@will-lynas

Describe the bug

When a repository's concurrent open pull request limit prevents submission, gh pr create returns a generic permissions error without identifying the limit.

The GitHub website explains the same failure explicitly:

You've reached the open pull request limit for this repository.
Users without write access can have up to 5 pull requests open at a time.

This makes the CLI failure look like an authentication or token-permissions problem rather than a repository contribution limit.

Affected version

gh version 2.86.0 (2026-01-21)
https://github.com/cli/cli/releases/tag/v2.86.0

Steps to reproduce the behavior

  1. Use an account without write access to a repository that has a concurrent open-PR limit.
  2. Reach or exceed that limit.
  3. Push a new branch to an account-owned fork.
  4. Attempt to open a non-draft PR using gh pr create.
  5. Compare the error with the repository's web PR-creation page.

Expected vs actual behavior

Expected: an error explaining that the repository's open-PR limit has been reached, rather than implying that authentication or token permissions are incorrect. Include the configured limit if available.

Actual:

pull request create failed: GraphQL: will-lynas does not have the correct permissions to execute `CreatePullRequest` (createPullRequest)

The website explicitly identifies the five-open-PR limit.

Logs

Command used:

gh pr create \
  --repo NousResearch/hermes-agent \
  --base main \
  --head will-lynas:feat/catalog-model-presets \
  --title 'feat(catalog): add model-presets plugin' \
  --body-file <description-file>

Authentication succeeded, pushing to the fork succeeded, and GitHub's compare endpoint resolved the branch correctly. No PR was created.

A separate REST API attempt to create the same PR returned HTTP 404 with {"message":"Not Found"}. This suggests that the underlying API also obscures the reason; a clearer diagnostic may require an API-side change.

Related report documenting the same failure:
NousResearch/hermes-agent#131859

🤖 Generated with AI

Activity

  1. will-lynas commented on Oct 30, 2026

    @will-lynas
    Author

    Additional reports from the affected repository:

    GitHub documents the cap and contributor exemptions here:
    https://docs.github.com/en/communities/moderating-comments-and-conversations/limiting-interactions-in-your-repository#limiting-concurrent-open-pull-requests-for-users-without-write-access

    These are related contributor reports, not evidence that every permissions error has this cause. In my own case, the web PR-creation page explicitly confirmed the repository's five-open-PR limit. The issue here is the CLI/API diagnostic, not a request to bypass the repository's policy.

    🤖 Generated with AI

  2. added
    platform
    on Oct 30, 2026
  3. cli-triage commented on Oct 30, 2026

    @cli-triage

    Thanks for the detailed report and investigation. I did not find an existing issue reporting this specific failure mode, so this looks like a new report rather than a duplicate.

    Looking at the code, gh pr create wraps whatever GraphQL error createPullRequest returns with a generic "pull request create failed: %w" prefix and otherwise passes the raw GraphQL message through unchanged (see create.go lines 1137-1146 at 8553724d157cd73dd42c937c79c51787f86e814a). There's no special-casing that inspects the GraphQL error type/message to detect the open-pull-request-limit case and produce a clearer message — so the misleading "does not have the correct permissions" text is exactly what GitHub's GraphQL API returned, re-surfaced as-is. This is consistent with the reporter's hypothesis that the underlying API itself doesn't distinguish this failure reason in its error payload (the REST 404 response supports that too), which would mean a real fix likely needs a clearer signal from the GraphQL/REST API before the CLI can special-case and surface a better message.

    Given that, I'm suggesting bug (the CLI's error message is misleading relative to the actual cause, even if root-caused upstream) and gh-pr as the affected command area, plus a tentative priority-3 since a workaround exists (checking the PR-creation page on github.com) and it affects a specific scenario rather than core functionality broadly. A maintainer may want to confirm with GitHub's API team whether the GraphQL error can be made more specific before deciding how (or whether) the CLI can reliably detect and special-case this.

    Generated by Issue Triage (skills-driven) for #14874 · copilot · auto · 83.1 AIC · ⊞ 4.5K · ◷

  4. added
    enhancement
    gh-pr
    on Oct 30, 2026
  5. removed
    needs-triage
    on Oct 30, 2026
  6. github-actions commented on Oct 30, 2026

    @github-actions
    Contributor

    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 wanted Contributions 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.

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

    blockedenhancementgh-prplatform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions