Skip to content

gh status shows unrelated repository activity that does not appear in API debug output #13795

Closed as not planned

Agent suggestions

Public preview

Description

@msuzoagu

Description

Running gh status shows PR activity from repositories that I do not recognize as repositories I am subscribed to or otherwise expect to appear in my status output.

Affected version

❯ gh version
gh version 2.91.0 (2026-04-22)
https://github.com/cli/cli/releases/tag/v2.91.0

Steps to reproduce the behavior

  1. Run gh status
  2. view output. In my example, the section of concern was:
Repository Activity
vercel/next.js#95485                         new PR
publify/publify_textfilter_code#154          new PR
publify/publify_amazon_sidebar#157           new PR
publify/publify_core#253                     new PR
chef/bento#1689                              new PR
publify/publify_core#252                     new PR
IBM/secrets-manager-management-python-sdk#2  new PR
IBM/secrets-manager-management-node-sdk#2    new PR
vercel/next.js#95483                         new PR

vercel/next.js in particular stood out because I do not know why activity from that repository is appearing here.

Initial subscription check

I first tried to inspect my repository subscription directly by running gh api repos/vercel/next.js/subscription. The result was:

  {
    "message": "Not Found",
    "documentation_url": "https://docs.github.com/rest/activity/watching#get-a-repository-subscription",
    "status": "404"
  }
  gh: Not Found (HTTP 404)
  gh: This API operation needs the "notifications" scope. To request it, run:  gh auth refresh -h github.com -s notifications

I did not add the notifications scope because I did not want to change the authentication/permission state while investigating why the repository was appearing.

API debug investigation

I then ran gh status with API debugging enabled and redirected the debug output to a file GH_DEBUG=api gh status 2> /tmp/gh-status-debug.txt and then ran the following commands one at a time:

    grep -n -C 20 'vercel/next.js' /tmp/gh-status-debug.txt
    grep -n -C 20 '95485' /tmp/gh-status-debug.txt
    grep -n -C 20 '"vercel"' /tmp/gh-status-debug.txt
    grep -n -C 20 '"next.js"' /tmp/gh-status-debug.txt

All 4 produced no output. So the complete API debug file contains none of:

  vercel/next.js
  95485
  vercel
  next.js

even though gh status rendered vercel/next.js#95485 new PR

Inspecting the debug output

I then ran head -100 /tmp/gh-status-debug.txt. This was useful because it showed the GraphQL query being made.

The query included:

  fragment issue on Issue {
    __typename
    updatedAt
    title
    number
    repository {
      nameWithOwner
    }
  }
  
  fragment pr on PullRequest {
    __typename
    updatedAt
    title
    number
    repository {
      nameWithOwner
    }
  }
  
  query AssignedSearch($searchAssigns: String!, $searchReviews: String!, $limit: Int = 25) {
    assignments: search(first: $limit, type: ISSUE, query: $searchAssigns) {
      nodes {
        ...issue
        ...pr
      }
    }
    reviewRequested: search(first: $limit, type: ISSUE, query: $searchReviews) {
      nodes {
        ...pr
      }
    }
  }

with variables:

{
  "searchAssigns": "assignee:@me state:open archived:false",
  "searchReviews": "review-requested:@me state:open archived:false"
}

Those searches appear to explain assigned issues and review requests, but they do not obviously explain the unrelated PRs rendered under Repository Activity.

I then checked how many GraphQL queries appeared in the debug trace:

grep -n 'GraphQL query:\|GraphQL variables:' /tmp/gh-status-debug.txt

The result was:

    14:GraphQL query:
    46:GraphQL variables: {
      "searchAssigns":"assignee:@me state:open archived:false",
      "searchReviews":"review-requested:@me state:open archived:false"
    }

Only one GraphQL query and one set of GraphQL variables were shown.

Other API requests made by gh status

I then listed all requests shown in the debug trace: grep -n 'Request to' /tmp/gh-status-debug.txt. The result was:

  2:* Request to https://api.github.com/graphql
  49:* Request to https://api.github.com/graphql
  98:* Request took 487.333µs
  100:* Request to https://api.github.com/notifications?all=true&participating=true&per_page=100
  111:* Request to https://api.github.com/users/<username>/received_events?per_page=100
  152:* Request took 313.1655ms
  305:* Request took 729.136166ms
  337:* Request took 1.136122292s

I also inspected the region around the received_events request: sed -n '111,220p' /tmp/gh-status-debug.txt. Nothing in that output revealed vercel, next.js, or PR 95485.

What seems unusual

I do not want to claim that either the notifications endpoint or the received-events endpoint is responsible, because the debug output collected so far does not establish that.

The important observations are:

  1. gh status renders vercel/next.js#95485 and other unexpected PRs under Repository Activity.
  2. The same invocation, with GH_DEBUG=api, still renders those entries.
  3. The complete debug output contains no occurrence of the repository owner, repository name, full repository name, or PR number.
  4. The GraphQL query shown in the debug output appears limited to assignments and review requests.
  5. The trace also shows requests to the notifications and received-events endpoints, but inspecting and searching the trace does not reveal where the rendered vercel/next.js entry came from.
  6. I deliberately did not add the notifications scope during this investigation because I did not want to change the permission state while trying to understand the existing behavior.

Question

Why is gh status showing vercel/next.js#95485 and the other expected PRs under Repository Activity, and why can none of the repository names or PR numbers used to render those rows be found anywhere in the GH_DEBUG=api output from that same gh status invocation?

Activity

  1. added
    needs-triage
    on Jul 4, 2026
  2. PatriM83 commented on Jul 4, 2026

    @PatriM83
  3. cli-triage commented on Jul 9, 2026

    @cli-triage

    This looks like a bug in gh status. There are two related anomalies worth investigating: (1) the "Repository Activity" section surfaces PRs from repositories you have no apparent subscription or watch relationship with, which may stem from how the received_events endpoint returns public activity from people/repos GitHub associates with your account; and (2) GH_DEBUG=api does not appear to log the response body from the received_events endpoint, so the data used to render those rows is invisible in the debug trace - making root-cause investigation very hard. No duplicate issues were found. Suggesting bug, gh-status, and priority-3 (unexpected/confusing output, but gh status continues to run and core workflows are unaffected).

    Generated by Issue Triage (skills-driven) · 29.9 AIC · ⌖ 8.57 AIC · ⊞ 5K · ◷

  4. hgohel commented on Jul 20, 2026

    @hgohel

    +1 for this issue. I see unrelated Repository Activity entries on Windows (Powershell) and Ubuntu under Windows Subsystem for Linux on the same computer.

    Windows: GitHub CLI versions 2.90.0 and 2.96.0
    Ubuntu (WSL): GitHub CLI version 2.95.0

  5. BagToad commented on Jul 20, 2026

    @BagToad
    Member

    Thanks for the exceptionally thorough writeup, @msuzoagu. I dug into this and I think both observations have straightforward explanations, and it isn't a bug.

    Where "Repository Activity" comes from

    That section is built entirely from your received events feed (GET users/{you}/received_events), which is the same feed that powers your github.com dashboard. It shows public activity from accounts you follow and repos/orgs you watch or belong to, not repositories you're subscribed to in the notifications sense. So vercel/next.js#95485 appearing there means someone you follow opened or participated in that PR, rather than you having any direct relationship with vercel/next.js.

    That also explains the repos/vercel/next.js/subscription 404: subscription (watching) is a different relationship from your follow feed, so checking the subscription endpoint won't reflect why the repo shows up here.

    Why it wasn't in your GH_DEBUG=api output

    received_events is a live, rolling feed, and gh status only fetches the newest ~200 events (2 pages of 100). Your debug capture was a separate, later gh status invocation, so by the time you ran it, newer activity had pushed vercel/next.js#95485 out of the fetched window. It genuinely wasn't in that second response, which is why grep found nothing. It's a different snapshot of the feed, not hidden data.

    For what it's worth, GH_DEBUG=api does log REST response bodies. I confirmed that GH_DEBUG=api gh api users/<me>/received_events prints the full JSON (repo names and all) on stderr. So if a given gh status run's feed contains an entry, it will be greppable in that same run's trace.

    Since this is working as designed, I'm closing it on the above basis. Please let us know if I've misunderstood something and we can reopen.

  6. removed
    needs-triage
    on Jul 20, 2026
  7. msuzoagu commented on Jul 21, 2026

    @msuzoagu
    Author

    @BagToad, thank you for taking the time to investigate this and provide feedback. It is much appreciated.

    I believe most GitHub CLI users run gh status expecting a summary of activity that pertains directly to their own work or requires their attention. Seeing activity from someone they merely follow is therefore unexpected, particularly when that activity concerns a repository they do not own, contribute to, subscribe to, or otherwise interact with.

    This appears to be more than a feature preference because the command is surfacing unrelated activity within a status summary intended to help the authenticated user identify relevant or actionable work. The output also provides no indication that the item appears solely because I follow that account.

    Expected behavior: gh status reports activity connected to the authenticated user—for example, repositories they own, contribute to, are mentioned in, or have subscribed to.

    Actual behavior: gh status can include unrelated repository activity from accounts the authenticated user follows.

    This produces misleading, non-actionable output and makes it harder to identify work that genuinely requires attention. It also does not appear consistent with what the command name and output communicate to users.

    Unless this behavior is explicitly documented as intentional, I believe it should be triaged as a bug rather than a feature request.

    If it is intentional, the documentation and output should clearly explain that gh status includes activity from followed accounts. In addition, the output should clearly group activity from followed accounts such that it is immediately clear to GitHub CLI users that it is "social feed".

  8. williammartin commented on Aug 28, 2026

    @williammartin
    Member

    I think @msuzoagu has a fair complaint here and I believe this is actually a behaviour change. From a product point of view, repository activity for someone degrees of separation from you is effectively useless. Furthermore, this is a change in behaviour because internally, the /received_events endpoint began being powered by a different service around 6-12 months ago, and the previous service did not include these tenuously connected events.

    I haven't decided whether to re-open this or open a new issue which directly addresses the underlying issue without the GH_API noise. There are also other problems caused by the same service: #14107 (comment).

    Thanks for creating the issue.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions