9 min read - GitHub Event Streams: Wake the Agent, Then Reconcile State
Developer Platforms & Agent Operations
Published November 18, 2026 · Author Exceev Consulting
Polling GitHub is easy to prototype. An agent asks whether a pull request changed, waits, asks again and eventually reacts. The loop becomes expensive or slow as the number of pull requests grows: frequent checks spend API budget while infrequent checks leave reviews and failed builds unattended.
GitHub announced Event Streams in public preview on 17 November 2026. The service holds a Server-Sent Events connection open and notifies a client about selected pull-request changes. It removes the need for a public webhook receiver, which makes it attractive for coding agents running on a developer's laptop or a short-lived worker.
But a stream is not a queue. GitHub's preview documentation says events can be missed, repeated or delivered out of order, with no replay. An agent that treats each event as an instruction will eventually act on stale state or repeat a write.
The buyer question is not “can we stop polling?” It is: can an event wake the agent without becoming authority to act?
Use the event as a doorbell
The safest mental model is a doorbell. It tells the agent to look; it does not say who is outside or what to do next.
Event Streams currently supports pull requests. A subscription can report a submitted
review, a changed head commit, a merge conflict, a pull-request state change or the
completion of a check suite. Most events carry an api_url that points to the resource
whose current state the client should fetch. The event normally says that something
changed, rather than describing the full change.
That shape leads to a simple boundary:
- Receive and record the event.
- Fetch the current pull request, review or check-suite state from GitHub.
- Evaluate that state against a versioned policy.
- Claim a unique action key before making any write.
- Recheck the relevant state, act, then record the outcome.
Suppose a review event arrives and the agent is allowed to prepare a fix after a human requests changes. It should fetch the review and current pull-request head, confirm that the review still requests changes, and bind its work to that head SHA. If a newer commit already addressed the comment, the correct response may be no action.
This is a state-reconciliation loop, not an event-processing pipeline. The difference sounds small until two events arrive in reverse order.
Design for the gaps GitHub documents
The preview imposes several limits that belong in the architecture decision, not in a footnote:
- A subscription covers one pull request, expires after 24 hours and belongs to the user or installation that created it.
- Each user, app or installation token can hold at most 100 active subscriptions.
- The stream delivers only events that occur while the connection is open. GitHub also documents a short gap immediately after subscription creation.
- Reconnection does not replay missed events. The client must fetch current state after subscribing and after a gap.
- Conversation-tab comments do not produce events yet. Check suites produce separate completion events, not one “all checks finished” event.
These facts rule out a few tempting designs. Do not keep the only copy of workflow state in process memory. Do not infer that silence means nothing changed. Do not wait for one final check event that the service does not emit. And do not treat 100 subscriptions as capacity for 100 repositories; the limit applies to active pull requests covered by a token.
Persist a small cursor record for each watched pull request: subscription identifier, expiry, connection status, last reconciliation time, current head SHA and the last policy decision. When the stream opens, reconnects or ends unexpectedly, fetch the pull request and its checks before resuming normal work. A low-frequency reconciliation job can cover long disconnects and unsupported comment types without restoring the old high-frequency polling loop.
The preview is available on GitHub.com to approved waitlist accounts and is subject to breaking changes. GitHub's documentation says it is not available on GHE.com at the time of review. A team with GitHub Enterprise Cloud with data residency or mixed hosting therefore needs to confirm where each repository lives before making the stream its only wake-up path.
Deduplicate the action as well as the receipt
Event deduplication prevents one failure mode, but it does not make the business action
safe. GitHub uses CloudEvents inside the stream. The
CNCF CloudEvents specification
requires the combination of source and id to identify a distinct event and allows
consumers to treat a repeated pair as a duplicate.
Store that pair so the same delivery does not trigger two reconciliations. Then add a second key for the action itself. Several different events may lead to the same desired action, and one current state can be observed after every reconnect.
For an agent that prepares a patch, an action key could contain:
repository + pull request + head SHA + review ID + policy version + action type
Claim the key transactionally before starting work. A retry can then read the earlier outcome instead of creating another branch or posting another comment. If the head SHA changes, the key changes too, but the agent must decide whether the old work is still usable before beginning again.
The policy version matters. A changed rule may produce a different answer from the same repository state; without the version, the audit trail cannot explain why an action ran yesterday but is blocked today.
Separate listening authority from writing authority
GitHub requires the token behind a subscription to have read access to the pull request. That does not mean the same credential should be able to push code, approve a review or merge.
Use the stream consumer to observe and schedule work. Give the worker a separate, short-lived credential scoped to the exact repository and operation it needs. A policy service should decide which event types may lead to which actions, while repository rules and required reviews remain the final enforcement layer.
For example, a check failure can authorize log collection and a proposed patch. It should not authorize a merge. A human change request can authorize analysis of the named finding; it does not grant permission to modify unrelated files. A merge-conflict event can open a task, but the worker should stop if resolving it changes behavior it cannot test.
Our guide to write boundaries for live-web agents applies the same distinction to evaluation systems: observing live state and writing to it need different controls. Event-driven operation makes that separation more important because the agent can wake without a person present.
Budget for reconciliation, not raw event volume
Replacing polling can lower empty requests and reaction time, but those savings do not justify unlimited agent work. One push can complete several check suites; a review thread can generate several review events; reconnects can expose the same state again.
Measure the funnel from wake-up to accepted outcome:
| Stage | Evidence to retain |
|---|---|
| Event received | Source, ID, type, time and subscription |
| State reconciled | API resource, head SHA, fetched time and policy version |
| Decision made | Allowed action, stop reason or human escalation |
| Work completed | Action key, changed files, tests and write credential |
| Outcome accepted | Human decision, merged SHA or recorded rejection |
Useful operating measures include events per reconciliation, reconciliations that produce no work, duplicate action claims, time from human review to agent response, and accepted changes per unit of compute. A lower poll count can coexist with higher agent spend if every minor event launches a long coding session.
Keep stop conditions explicit. Pause automated work when the stream has been offline beyond a set window, the head changes during execution, the policy service is unavailable, required checks cannot be enumerated or the proposed change exceeds the approved file boundary.
Run a bounded adoption test
Do not replace an established webhook or polling service across every repository on the first day of a public preview. Select a small group of pull requests where delayed response is visible and agent actions are reversible.
For two weeks, run Event Streams beside the current mechanism. Record which changes each path observes, including connection gaps, unsupported conversation comments and subscription renewals. Inject a disconnect, deliver two copies of one event, change the head while work is running and let a subscription expire. The worker should converge on current state without duplicating a write.
At the decision point, compare four results: missed wake-ups, duplicate actions, response time and total operating cost. Continue only if the team can explain every write from the fetched state, policy version and action key. Otherwise retain the existing mechanism and fix the reconciliation design before expanding coverage.
GitHub Event Streams removes a polling problem. It does not remove distributed-systems work. Teams that make the event a wake-up signal gain faster agents without granting a transient notification the power of a command.
Sources and limitations
We opened and reviewed every source below on 18 November 2026.
- GitHub's 17 November announcement establishes the public-preview date, pull-request focus, no-webhook design, waitlist access and stated availability across GitHub plans. It is a vendor announcement, not independent evidence of cost savings or production reliability.
- GitHub's Event Streams documentation supplies the event types, token requirements, 24-hour expiry, 100-subscription limit, gap and reconnect behavior, duplicate and ordering warnings, lack of replay, and known limitations. The API is in preview and GitHub warns that interfaces, limits and event types may change with short notice.
- The independent CNCF
CloudEvents specification
defines the
sourceandiduniqueness rule used here for event deduplication. It standardizes event metadata; it does not supply GitHub delivery guarantees or make an agent action idempotent.
We did not receive waitlist access, run the preview or measure its cost and latency. The architecture and adoption test are recommendations derived from the documented delivery semantics, not claims about a deployed Exceev or client system. Teams must verify current documentation, account eligibility, permissions and repository rules before implementation.
Thinking about AI for your team?
We help companies move from prototype to production — with architecture that lasts and costs that make sense.