GitHub CLI Can Wait on PRs. It Won’t Replay the Event You Missed.
On November 18, GitHub announced Event Streams support in GitHub CLI 2.105.0: a command can wait for a pull request event instead of repeatedly asking whether anything changed. There is an easy startup mistake here. Read a PR, then start listening, and a review submitted between those steps can leave your automation waiting for something that already happened.
AI disclosure: This article was generated with AI assistance using Keith Azodeh’s public project documentation and the linked primary sources. It has not been reviewed by Keith before publication.
The commands and underlying service are in preview, with Event Streams access granted through a waitlist on GitHub.com. Upgrading the CLI alone does not grant access. That availability distinction matters before replacing a working integration with this design.
The gap fits between two ordinary steps
Imagine a proposed website-editing assistant. It prepares a change, asks for review, and waits until the workflow can continue.
At 10:00:00, it reads the pull request: review is still pending. At 10:00:01, the reviewer submits their decision. At 10:00:02, the event stream opens.
Nothing has malfunctioned. The assistant simply arrived late.
GitHub’s Event Streams documentation says delivery happens while the stream is open, with no replay. Gaps include the period before connection, a short window after subscription creation, and disconnections. Creating a subscription is therefore too early to treat the listener as ready.
For the person using the editor, this can look absurd: the review is visible on GitHub, but the assistant keeps saying it is waiting. Another request for review adds noise without resolving the missed observation.
Why this belongs in an editing workflow
The public Okeike Web Editor case study describes recoverable drafts, AI-proposed patch plans, and source-version fingerprints. Publishing creates a GitHub commit and follows the existing deployment pipeline to the appropriate Firebase Hosting target. Its documented status is a working editor under ongoing development.
That gives this discussion a concrete boundary: a content edit has an identity and a version, and several systems participate in moving it toward publication.
The case study does not describe an Event Streams integration or a PR-based publication gate. The assistant in this article is a proposed extension. Its job would be to carry the correct draft through the existing delivery path without confusing a quiet connection with unfinished human work.
A live stream can make that assistant more responsive. It cannot establish what happened before it connected.
Listen first, then establish where things stand
GitHub’s CLI manual identifies a useful readiness signal: the status message emitted when the stream attaches. Status goes to stderr; event JSON goes to stdout. The manual explicitly tells clients to read current PR state after that message, even if they read it earlier.
For a supervising process, the sequence would be:
- Start a continuing listener for the relevant PR events.
- Wait for the stream’s attachment signal.
- Fetch current PR state and evaluate the condition the workflow actually needs.
- Process arriving events as reasons to fetch and evaluate again.
- Repeat the state read when the stream attaches after reconnecting.
That requires supervision, rather than a shell script that blocks on the listening command and only reads state after it exits. The listener and state reader need to operate concurrently.
In the example, the read at step three finds the submitted review. No second review event is necessary.
An event may also arrive while that read is in progress. Queue it, then reconcile again. The extra read is preferable to treating the notification and snapshot as one atomic operation when they are separate observations.
Decide what “finished waiting” means
The CLI defaults to exiting after one event. Its continuing mode is --follow; --timeout bounds the wait, and reaching that timeout first returns exit status 8. These are listening controls, not the website editor’s publication conditions.
A submitted review can approve, request changes, or comment. GitHub documents that review events identify the changed resource; the client fetches it to learn the decision. Events may also repeat or arrive out of order. Resolve the current PR workflow state rather than advancing a local approval counter from arrival order.
For the proposed editor, a timeout should produce a bounded waiting result with a link to the PR and the last observed state. It should not quietly relabel the draft “approved” or ask the model to guess why nobody answered.
Likewise, ending a listener should not produce “website published.” The delivery workflow still needs its own evidence.
Rehearse the quiet cases
Before adopting this pattern, use a disposable PR to exercise four timings: the review exists before startup; it arrives during connection setup; it arrives while connected; and it arrives during an intentional disconnect.
The desired result is the same current-state decision after reconciliation. Record when attachment was observed, which state was fetched, and why the workflow continued or stayed waiting. These are proposed acceptance checks, not results from an Okeike deployment.
This approach trades a small amount of supervision and targeted reading for less repetitive polling. It also has a limit: recovering the current state cannot reconstruct every intermediate transition lost during a gap. If that history matters, design a separate record of decisions and evidence.
For an editing assistant, the immediate payoff is modest and useful: the reviewer can finish once, and the software can recognize it without demanding another notification.