Skip to content

InsightsDevOps

GitHub Event Streams is in preview, so agents and scripts can stop polling pull requests

On 17 November 2026 GitHub announced Event Streams, a preview that delivers pull request events over a Server-Sent Events connection, with no public webhook endpoint. How subscriptions, delivery and the new gh event listen command work, and the limits to design around.

Published November 23, 20262 min read

On 17 November 2026 GitHub announced Event Streams, a preview feature that pushes pull request activity to a client over a persistent connection. The stated aim is that an agent or script no longer has to poll the API to find out whether a review arrived or a check finished, which also saves rate limit. On 18 November GitHub added a gh event listen command for the same purpose.

It is a preview with a waitlist, so this article is about what to evaluate now rather than what to migrate. Everything below comes from the changelog entries and the Event Streams documentation.

What it is, and what it is not

Event Streams covers pull requests only, and only on GitHub.com, not GHE.com. Access is granted per account from a waitlist form. GitHub says the API, event types and limits may change at short notice.

It differs from webhooks in one practical way: the client opens the connection, so nothing needs a public endpoint. A laptop, a CI job or an agent sandbox can receive events without ingress. The protocol is Server-Sent Events (SSE), with each message carrying an event ID, an event type and the full event as single-line JSON in CloudEvents format.

It is not a general event bus. One subscription covers one pull request, and comments on the pull request's conversation tab produce no events (review comments do).

How a subscription works

You create a subscription with POST /event-subscriptions, naming one pull request and the event types you want, then read from the events_url it returns:

subscribe.sh
EVENTS_URL=$(gh api -X POST /event-subscriptions \
  -f resource_url=https://github.com/OWNER/REPO/pull/NUMBER \
  -f 'event_types[]=com.github.pull_request.review.submitted.v1' \
  -f 'event_types[]=com.github.pull_request.state.changed.v1' \
  --jq .events_url)
 
curl -sS -N -H 'Accept: text/event-stream' \
  -H @<(printf 'Authorization: Bearer %s' "$(gh auth token --hostname github.com)") \
  "$EVENTS_URL"

The documentation says to use a streaming client such as curl -N, because gh api buffers the whole response and will not print events as they arrive. Repeating the request for the same pull request and event types returns the existing subscription.

The five event types are:

Event typeSent when
com.github.pull_request.review.submitted.v1A review is submitted, and for each review comment and reply
com.github.pull_request.head.changed.v1The head commit changes, for example after a push
com.github.pull_request.check_suite.status.changed.v1A check suite on the head commit completes, whatever its conclusion
com.github.pull_request.merge_conflict.v1A merge conflict is detected
com.github.pull_request.state.changed.v1The pull request is merged, closed, reopened, marked ready or converted to draft

Most events say that something changed, not what. Each carries an api_url, and you fetch that for the current state.

Delivery is at-most-once in practice

This is the part that decides how you write the consumer. The documentation is explicit:

  • No replay. Events that happen before the stream opens, in the short window right after subscribing, or while you are disconnected are never delivered.
  • Duplicates and reordering are possible. Do not rely on order. For review and check suite events, deduplicate on api_url.
  • Merge conflict events can be late, because detection runs only after someone views or requests the pull request.

So the safe pattern is: open the stream, create the subscription, then fetch the pull request once to catch up, and after that treat every event as a prompt to re-read state rather than as the state itself. A consumer that applies events as a log will be wrong the first time the connection drops.

Connections end, and subscriptions expire

Plan for three endings:

  • Graceful end. The last message is github.stream.end, with an outcome. Act on outcome, not on the optional reason, because new reasons may appear. subscription_ended means the subscription expired or access to the pull request was lost, so stop or create a new one. reconnect means reopen the stream on the same subscription, with jittered backoff.
  • Unexpected disconnect, with no github.stream.end. Reconnect.
  • Expiry. Subscriptions expire 24 hours after creation, so a long-running watcher has to recreate them.

Heartbeats arrive as SSE comment lines starting with : within 15 seconds of the last message, so a client that sees nothing for noticeably longer can treat the connection as dead and reconnect.

Tokens matter here too. GitHub App installation tokens expire after one hour, and a stream opened with one ends at the first access check after that. Create a fresh token before reconnecting. The GITHUB_TOKEN in GitHub Actions cannot be renewed, so the documentation tells you to delete the subscriptions it created before the job finishes.

The CLI route

For scripts, gh event listen (GitHub CLI 2.105.0 or later, also in preview) hides most of the above:

wait-for-review.sh
gh event listen \
  --resource https://github.com/OWNER/REPO/pull/NUMBER \
  --event com.github.pull_request.review.submitted.v1,com.github.pull_request.state.changed.v1 \
  --timeout 30m

It creates or reuses a subscription, opens the stream, prints each event as one line of JSON, reconnects after drops and recreates an expired subscription. By default it exits after the first event, so it fits into a script or an agent loop. --count N waits for several events, --follow listens until stopped, and --jq or --template extract fields. When --timeout expires it exits with status 8, which a script can tell apart from success.

Two details to keep in mind. The command prints Listening for events. to stderr once the stream is open, and events before that line are not reported, so read the pull request's current state after seeing it. And it does not delete its subscription on exit, so clean up with gh event subscription list and gh event subscription delete if you create many.

Access and limits

ItemDocumented behaviour
EnablementPer account. User tokens need the user enabled. App installation tokens, including GITHUB_TOKEN, need the installing user, organization or enterprise enabled.
Accepted tokensPersonal access token, OAuth token, GitHub App user access token, GitHub App installation access token. Apps authenticating as themselves are not supported.
PermissionRead access to the pull request
Active subscriptionsUp to 100 per user, app or installation token. More returns 422.
Not enabled403 with "Event subscriptions are not enabled for this account"

There is also no "all checks completed" event. Each check suite produces its own event, so deciding that a pull request is green means fetching its check suites after every event. Commit statuses created through the REST API are not covered by check suite events either and must be fetched separately.

What to do now

  • Join the waitlist if you run PR-driven automation. Agents that wait for review, bots that rebase on conflict and scripts that block on checks are the use cases GitHub describes. If nothing of that kind polls today, there is little to gain yet.
  • Inventory your polling. Look for loops around gh pr view, gh run watch or repeated gh api calls. Those are the candidates, and their rate limit use is the baseline to compare against.
  • Write the consumer as a state reader. Subscribe, catch up, then re-fetch on every event, deduplicate on api_url, and handle github.stream.end by its outcome.
  • Keep a polling fallback. A preview with no replay and a 24-hour expiry should not be the only thing standing between a pull request and a stuck pipeline. A slow periodic check costs little.
  • Check the token model before giving it to an agent. Enablement follows the account behind the token, and a stream is bound to that token's access. The controls in letting AI agents act on production safely, such as scoped permissions and an audit trail, apply here as well.

The announcement does not say when the feature will be generally available, and it does not describe pricing. Treat both as unknown until GitHub publishes them.