GitHub Event Streams: letting agents wait for pull requests without polling
GitHub's Event Streams preview lets an agent sleep until a pull request changes. How it works, its limits, and what it changes for agent cost and safety.
Coding agents spend a surprising share of their time waiting: for checks to finish, for a reviewer to comment, for a merge. Until now, an agent without a public webhook receiver had to ask GitHub over and over whether anything had changed. On 17 November 2026 GitHub put Event Streams into preview: an agent subscribes to a pull request, holds a connection open, and is told when something happens. A day later the GitHub CLI gained a gh event listen command built on it. It is a small change with consequences for cost, reliability and what agents react to.
How Event Streams works
The Event Streams documentation describes three steps. Create a subscription for one pull request with the event types you want. Open its event stream, delivered as Server-Sent Events, so no public endpoint is needed and it works from a laptop. When an event arrives, fetch the current state from the API URL it carries.
Five event types are supported today:
| Event | Sent when |
|---|---|
| Check suite status changed | A check suite on the head commit completes, whatever the result |
| Head changed | The pull request's head commit changes, for example after a push |
| Merge conflict | GitHub finds a merge conflict |
| Review submitted | Someone submits a review, including a single review comment or reply |
| State changed | Merged, closed, reopened, marked ready or converted to draft |
Events say that something changed, not what. A review event doesn't include the review's state, and a state event doesn't say whether the pull request was merged or closed. The exception is check suite events, which always carry the conclusion, so an agent can tell pass from fail without another call.
The CLI version
The CLI changelog post introduces gh event listen in gh 2.105.0. It creates or reuses the subscription, opens the stream, reconnects when it drops, and by default exits after the first event, which suits agents that wait for a command to finish. --count, --follow and --timeout change that. GitHub also says that gh pr view, gh run watch and similar commands now suggest gh event listen when they detect an agent calling them, so agents will find it without being told.
Limits worth knowing before you build on it
The preview is narrower than the announcement's first line suggests:
- Access is by waitlist. The changelog says it is available on all plans once approved. The documentation adds that it works on GitHub.com only, not GHE.com yet.
- One pull request per subscription, expiring after 24 hours, with up to 100 active subscriptions per token.
- No replay. Events are delivered only while a stream is open. Anything that happens before it opens, just after the subscription is created, or during a disconnect is lost. The documentation's advice is to fetch the pull request once after subscribing.
- Duplicates and disorder. The same event may arrive twice, and events can arrive out of order. Always fetch the current state rather than trusting the sequence.
- No "all checks done" event, one event per check suite instead, and no events for conversation-tab comments or for commit statuses created through the REST API.
- Breaking changes are possible during the preview, at short notice.
The two GitHub sources also describe the check events slightly differently. The changelog lists both a change to "your pull request's check suites" and a check suite status change; the documentation has a single event type, sent when a check suite on the head commit completes. Build against the documentation.
Analysis: cheaper waiting, and a new trigger
Cost. Polling has a direct price in API rate limits and, for agents, an indirect one in tokens: every "check again" turn re-sends context to a model. GitHub's announcement makes exactly this case, citing "fewer wasted tokens and less rate-limit burn". An agent that sleeps on gh event listen and wakes once spends neither. For teams running many agents against many pull requests, this is a straightforward saving.
Reliability. The no-replay design moves work to the client. An agent that subscribes, then opens the stream a few seconds later, can miss the event it was waiting for. The safe pattern in the documentation, subscribe, open the stream, then read the current state once, has to be followed every time, or agents will occasionally wait for something that already happened. The --timeout option is a sensible backstop.
Safety. Event Streams makes it easy to build an agent that acts as soon as a review lands. In many repositories, people outside the team can comment on pull requests, and the documentation counts every single review comment, and every reply to one, as a review. An agent that wakes on review events and then reads and follows the comment text is acting on input from whoever wrote it. Earlier articles on hidden prompt injection in GitHub content and on instruction files in unmerged pull requests describe what that input can contain. The event itself is harmless; what matters is what the agent is allowed to do with the text it then fetches.
Who is enabled. Access is granted per account. For GitHub App installation tokens, enabling an organisation covers every app installed there, including the GITHUB_TOKEN in Actions, but not members' own user tokens. That is worth knowing when you work out which automation can open streams.
What it means for engineering and security leaders
For platform teams running agents at scale, Event Streams is worth joining the waitlist for: it reduces wasted model calls and API load with little work. Treat it as a preview: keep polling as a fallback, and wrap it in the subscribe-then-read pattern.
For security teams, the question is not the stream but the reaction. Decide which events an agent may act on without a person, and whose reviews count. A sensible default is that review events from people outside the repository's maintainers wake the agent only to report, not to change code.
Practical takeaways
- Join the waitlist if your agents poll pull requests, and try
gh event listeningh2.105.0 or later. - Always read current state after subscribing and after each event; never rely on event order or completeness.
- Set
--timeouton agent waits, and handle the timeout as "go and check". - Filter review events by author before an agent acts on review text, especially in public repositories.
- Delete subscriptions created with a
GITHUB_TOKENbefore the job ends, as the documentation advises, since that token can't be renewed.