Repository navigation
Event streaming (11/11): Support check suite events and suggest them from gh run view and gh run watch - #15081
Merged
BagToad merged 2 commits intoNov 17, 2026
Conversation
Add com.github.pull_request.check_suite.status.changed.v1 to the known event types, so it shows in help, completions, and subscription view. A pull request usually has several check suites, each sending its own event with data.conclusion, so the listen help, the gh skill, and the preview doc explain reading the checks after each event to wait for CI. Co-authored-by: Copilot <[email protected]> Copilot-Session: bbce5a7f-103c-4e67-99c9-2d6dc3f6a02b
When an agent views or watches an unfinished workflow run of a github.com pull request, print a hint on stderr that suggests listening to the check suite status event instead of polling. The help text of both commands mentions the same alternative. Co-authored-by: Copilot <[email protected]> Copilot-Session: bbce5a7f-103c-4e67-99c9-2d6dc3f6a02b
babakks
requested review from
tidy-dev
and
a balanced review from Copilot
and removed request for
a team
November 17, 2026 17:11
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Pending commit statuses can cause indefinite waits, and branch-only matching can suggest events for an outdated PR; required test coverage is also missing.
6 open issues
Exclude pending commit statuses from the listener wait · New Verify the run is associated with the current PR head · New Test completion for the check-suite event type · New Test JSON hint suppression on lookup failure and unsupported hosts · New Test agent hint suppression for negative cases · New Use require.NoError for the watch error check · New
What changed in this PR
Completes the event-streaming stack tracked in #15070 by exposing check-suite completion events and helping agents discover event-driven waiting for pull request CI on github.com.
Changes:
- Adds the check-suite event to event help, shell completion, and listener examples.
- Adds agent-only hints to unfinished
gh run viewandgh run watchinvocations, sharing the existing hint layout. - Updates run help, tests, agent guidance, and preview documentation.
| File | Description |
|---|---|
skills/gh/SKILL.md |
Documents event-driven CI waiting and checking remaining suites. |
pkg/cmd/run/watch/watch.go |
Adds agent detection, waiting guidance, and a pre-watch hint. |
pkg/cmd/run/watch/watch_test.go |
Tests hint output for agent and human callers. |
pkg/cmd/run/view/view.go |
Adds waiting guidance and hints for regular and JSON output paths. |
pkg/cmd/run/view/view_test.go |
Tests hints across run states, caller types, and JSON output. |
pkg/cmd/run/view/hint.go |
Centralizes view-specific hint eligibility and printing. |
pkg/cmd/event/shared/hint.go |
Shares hint formatting and adds check-suite waiting advice. |
pkg/cmd/event/shared/help.go |
Adds the check-suite event name and description. |
pkg/cmd/event/shared/completion_test.go |
Updates the unknown-event completion fixture. |
pkg/cmd/event/listen/listen.go |
Explains check-suite events and adds a conclusion-printing example. |
docs/event-listen-preview.md |
Documents check-suite payloads and run-command hints. |
Review effort: Balanced
Comment on lines
+33
to
+35
| readNote: fmt.Sprintf("Each check suite, such as a workflow run, sends its own event with its conclusion "+ | ||
| "when it completes; after each event, read the checks with `gh pr checks %s`, and if any are still "+ | ||
| "pending, run the listener again.", pullRequestURL), |
| if opts.InvokingAgent == "" || run.Status == shared.Completed { | ||
| return | ||
| } | ||
| eventShared.PrintChecksListenHint(opts.IO.ErrOut, ghrepo.GenerateRepoURL(repo, "pull/%d", prNumber)) |
2 of 6 tasks
BagToad
approved these changes
Nov 17, 2026
This was referenced Nov 18, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Layer 11 of 11 in the stack tracked by #15070.
Description
Agents asked to wait for the CI of a pull request tend to poll
gh run watchorgh run viewuntil the workflow runs finish. The event subscriptions API now sendscom.github.pull_request.check_suite.status.changed.v1when a check suite on the head commit of a pull request completes, with itsdata.conclusion(for examplesuccessorfailure). A check suite is the group of checks from one source, such as one workflow run.This change makes that event available in
gh event listenand points agents at it:gh event listenaccepts the new event type, lists it in its help and shell completion, and has an example that waits for the next check suite and prints its conclusion. The help explains that a pull request usually has several check suites, each sending its own event, so waiting for all checks means reading them after each event.gh run vieworgh run watchon a workflow run that is not completed and belongs to a github.com pull request, the command prints a hint on stderr with the fullgh event listencommand for that pull request. It follows the existing hint printed bygh pr viewand other pull request commands, with notes adapted to checks: read them withgh pr checksafter each event, and run the listener again while any are pending.gh run watchprints it before it starts watching, so it is visible even if the watch is stopped.gh run viewprints it with--jsontoo, but not with--webor--log.gh run viewandgh run watchhelp texts gain a paragraph saying that, to wait for the workflow runs of a github.com pull request,gh event listenwith this event is the alternative to polling.ghagent skill anddocs/event-listen-preview.mddescribe the new event and the run hints.To share the hint layout,
PrintListenHintinpkg/cmd/event/shared/hint.gonow uses a private helper; its output is unchanged.How did you test this change?
I built
ghfrom this branch and recorded the session below against babakks#17, a pull request in a test repository, settingCOPILOT_CLI=1where the agent hints were exercised.gh run view --helpandgh run watch --help, I saw the new paragraphs pointing atgh event listenandcom.github.pull_request.check_suite.status.changed.v1.govulncheck.ymlworkflow on the pull request branch, when I rangh run view <run>withCOPILOT_CLI=1while the run was in progress, I saw the hint withgh event listen --resource https://github.com/babakks/cli/pull/17 --event com.github.pull_request.check_suite.status.changed.v1, followed by the usual run summary.gh run watch <run>withCOPILOT_CLI=1, I saw the same hint before the watch started, and it was still on screen after I stopped the watch with Ctrl-C.gh event listen --resource <pr> --event com.github.pull_request.check_suite.status.changed.v1 --jq .data.conclusion, I sawfailureonce the run completed, and the command exited after that first event.gh run view <run> --json conclusionthen reportedfailurefor the dispatched run.11-check-suite.mp4
Key points
--countand--followout. The number of check suites per pull request is not known in advance, so reading the checks after each event and listening again is more reliable than a fixed count.Notes for reviewers
Start with
PrintChecksListenHintinpkg/cmd/event/shared/hint.go, then the call sites inpkg/cmd/run/view/hint.go,pkg/cmd/run/view/view.go, andpkg/cmd/run/watch/watch.go, and their tests. The first commit adds the event type togh event listen; the second adds the run hints and help text.Authorship and follow-up
Who wrote this:
Who answers review comments: