Repository navigation
Event streaming (8/11): Add agent evals for event-driven waiting, the gh skill section, and preview docs - #15078
Merged
Merged
Conversation
Add a preview section on waiting for pull request changes with gh event listen and managing subscriptions, so agents block on events instead of polling. Co-authored-by: Copilot <[email protected]> Copilot-Session: bbce5a7f-103c-4e67-99c9-2d6dc3f6a02b
Add a local harness that runs Copilot agent trials against a supplied gh binary and skill with Vally, in isolated sandboxes with live GitHub fixtures and a second actor. A generic core (sandbox, actor driver, observer, session, evidence, executor, and graders) runs suites behind a Suite contract. The events suite evaluates whether agents wait for pull request changes with gh event listen instead of polling, across six scenarios, with deterministic task, route, and polling graders plus a semantic review. evals/replay re-grades saved evidence offline, and evals/smoke checks the live protocol without a model. Co-authored-by: Copilot <[email protected]> Copilot-Session: bbce5a7f-103c-4e67-99c9-2d6dc3f6a02b
Co-authored-by: Copilot <[email protected]> Copilot-Session: bbce5a7f-103c-4e67-99c9-2d6dc3f6a02b
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
Unresolved defects can conflate GraphQL targets, apply incompatible replay graders, misclassify rejected listener attempts, and use the wrong credentials for cleanup retries.
4 open issues
1 file not reviewed
evals/package-lock.json: Generated file
What changed in this PR
Adds the evaluation and documentation layer of the event-streaming stack tracked by #15070. The local, opt-in Vally package measures whether agents complete pull request tasks using event-driven waiting rather than polling, independently of the Go build.
Changes:
- Adds isolated agent trials, command recording, scripted actors, resource journals, and cleanup.
- Defines six event scenarios with task, routing, polling, and semantic graders, plus offline replay and live smoke tools.
- Documents event waiting in the shipped
ghskill and adds evaluation runbooks and preview guidance.
| File | Description |
|---|---|
skills/gh/SKILL.md |
Teaches event waiting and subscription management. |
run-evals |
Validates credentials and launches live evaluations. |
evals/tsconfig.json |
Configures strict TypeScript compilation. |
evals/testdata/replays/persistent-review-loop.json |
Supplies sanitized review-loop replay evidence. |
evals/suites/events/review-loop/eval.yml |
Defines successive-review evaluation variants. |
evals/suites/events/pull-after-merge/eval.yml |
Defines merge-then-pull evaluation variants. |
evals/suites/events/pull-after-close/eval.yml |
Defines close-without-merge evaluation variants. |
evals/suites/events/notify-review/eval.yml |
Defines review-notification evaluation variants. |
evals/suites/events/listen-at-limit/eval.yml |
Defines subscription-limit recovery variants. |
evals/suites/events/full-delegation/eval.yml |
Defines creation-through-merge evaluation variants. |
evals/src/suites/index.ts |
Registers available evaluation suites. |
evals/src/suites/events/suite.ts |
Connects fixtures, actors, snapshots, and cleanup. |
evals/src/suites/events/smoke-protocol.ts |
Implements model-free review and subscription checks. |
evals/src/suites/events/scenarios/review-loop.ts |
Specifies two review rounds and outcome checks. |
evals/src/suites/events/scenarios/pull-after-merge.ts |
Checks local integration after scripted merging. |
evals/src/suites/events/scenarios/pull-after-close.ts |
Checks unchanged local state after closing. |
evals/src/suites/events/scenarios/notify-review.ts |
Specifies and verifies a submitted review. |
evals/src/suites/events/scenarios/listen-at-limit.ts |
Specifies seeded subscription-limit fixtures. |
evals/src/suites/events/scenarios/full-delegation.ts |
Checks reviewed fixes and the merged head. |
evals/src/suites/events/scenarios/definition.ts |
Defines typed scenario and actor contracts. |
evals/src/suites/events/scenarios.ts |
Registers event scenarios and prompt placeholders. |
evals/src/suites/events/limit.ts |
Detects subscription-limit contamination. |
evals/src/suites/events/grading/task.ts |
Grades independently recorded task outcomes. |
evals/src/suites/events/grading/route.ts |
Grades dedicated event-command observations. |
evals/src/suites/events/grading/polling.ts |
Grades repeated status reads. |
evals/src/suites/events/grading/observations.ts |
Matches command output to scripted changes. |
evals/src/suites/events/grading/index.ts |
Registers deterministic event graders. |
evals/src/suites/events/grading/evidence.ts |
Validates and loads versioned replay evidence. |
evals/src/suites/events/grading/analysis.ts |
Derives shared routing and polling facts. |
evals/src/suites/events/github.ts |
Adds subscription API operations and retries. |
evals/src/suites/events/fixtures.ts |
Provisions and cleans event-specific fixtures. |
evals/src/suites/events/domain.ts |
Defines event fixtures and evidence schemas. |
evals/src/suites/events/commands.ts |
Recognizes listeners, readiness, and status reads. |
evals/src/suites/events/actor.ts |
Performs scripted reviews, merges, and closes. |
evals/src/smoke.ts |
Runs the live model-free smoke check. |
evals/src/smoke.test.ts |
Covers smoke sequencing and stream collection. |
evals/src/skills.test.ts |
Checks skill staging and event guidance. |
evals/src/review.test.ts |
Covers semantic-review isolation and cleanup. |
evals/src/replay.ts |
Regrades saved evidence without live resources. |
evals/src/replay.test.ts |
Covers replay results and regression controls. |
evals/src/graders/review.ts |
Builds and scores semantic-review requests. |
evals/src/graders/result.ts |
Standardizes deterministic grader results. |
evals/src/graders/copilot-review.ts |
Runs isolated, tool-free Copilot reviews. |
evals/src/grader-plugin.ts |
Exposes graders through Vally’s plugin interface. |
evals/src/github.test.ts |
Covers API retries and subscription pagination. |
evals/src/executor-plugin.ts |
Registers the Vally agent executor. |
evals/src/core/trial-cleanup.ts |
Coordinates teardown while retaining failures. |
evals/src/core/suite.ts |
Defines reusable suite and trial interfaces. |
evals/src/core/session.ts |
Hooks actor actions into tool completion. |
evals/src/core/sandbox.ts |
Journals sandbox creation and guarded deletion. |
evals/src/core/observer.ts |
Records real commands and detects contamination. |
evals/src/core/io.ts |
Provides isolated environments and evidence helpers. |
evals/src/core/home.ts |
Prepares agent homes and observed binaries. |
evals/src/core/github.ts |
Provides fixture API access and retry handling. |
evals/src/core/executor.ts |
Orchestrates serialized live agent trials. |
evals/src/core/evidence.ts |
Names the persisted evidence artifact. |
evals/src/core/errors.ts |
Defines non-retryable infrastructure errors. |
evals/src/core/calls.ts |
Defines command evidence and argument parsing. |
evals/src/core/actor.ts |
Serializes actor ticks and evidence writes. |
evals/src/commands.test.ts |
Covers command recognition and readiness rules. |
evals/src/cleanup.ts |
Retries cleanup and locates unfinished journals. |
evals/src/cleanup.test.ts |
Covers teardown failures and shutdown ordering. |
evals/smoke |
Launches the compiled smoke tool. |
evals/running-evals.md |
Documents evaluation commands and result interpretation. |
evals/run |
Maps evaluation options to Vally invocations. |
evals/replay |
Launches the compiled replay tool. |
evals/package.json |
Declares evaluation dependencies and package scripts. |
evals/cleanup |
Launches the compiled cleanup tool. |
evals/.gitignore |
Excludes dependencies and compiled output. |
docs/README.md |
Links evaluation and event-preview documentation. |
docs/event-listen-preview.md |
Summarizes preview commands and lifecycle behavior. |
.github/skills/writing-evals/SKILL.md |
Guides evaluation design and safeguards. |
.github/skills/writing-evals/references/design-notes.md |
Records grading, timing, and isolation principles. |
.github/skills/running-evals/SKILL.md |
Guides evaluation execution and reporting. |
.github/skills/running-evals/references/execution-modes.md |
Distinguishes agent-run and caller-run workflows. |
.github/skills/running-evals/references/credentials.md |
Documents credential roles and authorization checks. |
Review effort: Balanced
Comment on lines
+60
to
+61
| const waitCalls = calls.filter(call => dedicatedWait(call)); | ||
| const waits = waitCalls.map(call => call.startedAt); |
2 of 6 tasks
BagToad
approved these changes
Nov 17, 2026
Merged
3 tasks
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 8 of 11 in the stack tracked by #15070.
Description
The previous PRs give agents a way to wait for pull request changes instead of polling, plus hints and help to find it. Unit tests cannot tell whether agents actually use it. This PR adds a general agent eval system to measure that kind of behavior, an
eventssuite that measures it for event-driven waiting, and the agent-facing documentation the suite evaluates.How the eval system works
evals/is a local, opt-in Vally package for evaluatingghfeatures that agents use. It is independent of the Go build: nothing ingo.mod,make, or the Go tests installs or runs it. Vally runs the evals; the package supplies the eval definitions, an executor plugin (gh-agent) that sets up the live GitHub side of each trial, and a grader plugin.evals/runis a thin wrapper that passes the right flags to the pinnedvallyCLI, andrun-evalsat the repository root checks the credentials and theghbinary before calling it.A trial. Each trial gives a Copilot agent a task, an already-built
gh, and a fresh private sandbox repository on github.com, then grades what it did:sequenceDiagram participant Vally as evals/run (vally eval) participant Exec as gh-agent executor participant Suite as Suite participant GitHub as GitHub sandbox participant Agent as Copilot agent participant Second as Second actor Vally->>Exec: Start a trial: definition, stimulus, skill on or off Exec->>Suite: start() Suite->>GitHub: Create the sandbox repository and fixtures, journaled first Exec->>Agent: Prompt, isolated home, observed gh loop While the agent works Agent->>GitHub: gh commands, recorded with their output Exec->>Second: Tick on a timer and after each tool call Second->>GitHub: Scripted changes end Exec->>Suite: snapshot() Exec->>Exec: Write the evidence file Exec->>Suite: Clean up live resources and the sandbox Vally->>Vally: Run the graders on the evidence and trajectorySuites. Definitions are grouped into suites: families of scenarios that share fixtures, an optional scripted second actor, and graders. The executor is not specific to any suite. A generic core in
evals/src/coreowns what every live agent trial needs: the isolated home with an observedgh, skill staging, the sandbox and its crash-safe resource journal, the serialized second-actor driver, evidence, and cleanup. A suite plugs in through a small contract insrc/core/suite.ts:startprovisions a trial and returns its prompt placeholders, an optional actor, and asnapshotof the facts its graders need.evals/README.mdwalks through adding a suite with a minimal example.Evidence and grading. A
ghlauncher records each realghprocess's arguments, timing, exit status, and output. At the end of a trial the executor writes an evidence file with every observed command and the suite's snapshot, and graders read that file rather than live GitHub state. Saved runs can be regraded withvally grade, and only model-based graders call a model again.Skill on and off.
evals/runruns each definition once without theghskill and once with it (--skill off|on|both). The skill is offered through Vally's skill directory, not pasted into the prompt, and the runtime's bundled skills are disabled, so the two configurations differ only by theghskill.--gh-skill-ref REV:PATHevaluates a skill as committed at a revision, such astrunk:skills/gh, for before and after comparisons.Isolation and cleanup. Each trial has a fresh home, configuration, workspace, and constructed environment. The agent's token lives in private
ghconfiguration and a Git credential helper, and the second actor's token and the grading evidence are never passed to the agent. This is lightweight isolation, not a security sandbox. Every live resource is journaled before it is created, and cleanup runs after every trial, pass or fail; if it cannot confirm cleanup, it keeps the repository, fails the trial, and prints anevals/cleanupcommand to retry.Errors versus failures. A trial errors, rather than fails, when the problem is not the agent's: setup, API, model, observer, or cleanup failures, contamination, or shared state that makes it ungradable. Trials run one at a time and are never retried, because they can share accounts and a second actor assumes it is the only change in flight. Every credential is an explicit environment variable; nothing falls back to the operator's
ghlogin.The events suite
The
eventssuite checks two things: whether the agent completes the task, and whether it waits throughgh event listenrather than polling. Each scenario is an ordinary Vallyeval.ymlthat builds its own live fixture:notify-reviewpull-after-mergepull-after-closefull-delegationreview-looplisten-at-limitnotify-review, but the subscription limit is already full.Prompts never name a waiting command or tell the agent to avoid polling. The second actor makes its change while a recognized
gh event listenis running, after letting the agent finish one catch-up read of the pull request; if the agent never starts a listener, the change comes after a third of the agent's budget.review-loopsubmits its first review before a listener is guaranteed to be attached, so the agent must either listen first or read the pull request after attaching.listen-at-limitfills the subscriber's subscription allowance before the agent starts, probing the limit rather than assuming it.A trial passes only when all four graders pass:
event-taskchecks the outcome against independently fetched GitHub state, local Git history, and the actor's timeline. A remote merge alone does not satisfy pulling.event-routerequires agh event listencovering each scripted change, with the matching event in its recorded output. Directgh api, custom SSE clients, and polling do not count.no-pollingfails repeated reads of the same pull request state with nothing changed in between. With the skill offered, any polling fails; without it, polling is allowed only before the agent switches to a listener.semantic-reviewhas a separate, tool-free Copilot session review the whole trajectory against the scenario's rubric, ending in a pass or fail verdict. It can fail a trial the mechanical graders passed, but cannot rescue one they failed.Besides the
evalstimuli, each scenario has adesign-probevariant, which hints that a waiting capability exists to see which interface agents reach for, and araw-apivariant, which describes the HTTP API for use against aghwithout theeventcommand. Two fast checks run before any model trial:evals/replayregrades saved or sanitized evidence offline in under a second, andevals/smokeruns the real two-review protocol and thegh event subscriptioncommands against github.com without a model. Subscriptions are deleted before their sandbox repositories, and only those on the fixture's pull requests.Agent skill and docs
skills/gh/SKILL.mdgains a preview section on waiting for pull request changes withgh event listen: when to use it instead of polling, reading the pull request once the listener is attached, when--followfits (multi-round review loops only), stopping when a pull request is closed without merging, and freeing a slot at the subscription limit. This is the skill the skill-on trials offer..github/skills/running-evalsandwriting-evalsguide agents through running and authoring evals.docs/event-listen-preview.mddescribes the preview behavior ofgh eventin one place, linked fromdocs/README.md.How did you test this change?
I ran the full matrix with
gpt-5.6-luna, one trial per cell and a 300 second agent budget, after first replaying the saved evidence of an earlier run offline (it reproduced that run's verdicts) and passing the live smoke check. All trials cleaned up their sandbox repositories and subscriptions.listen-at-limitnotify-reviewgh pr viewwithsleep 30, ignoring the hintpull-after-mergepull-after-closefull-delegationreview-loopIn the skill-on
full-delegationfailure, the agent usedgh event listen --followand read its output with two 120 second waits. The approval arrived during the first wait, but the agent resumed only after the second and ran out of time before merging. In the previous full run with the same skill content, skill on passed all six scenarios and skill off failed onlylisten-at-limit.Key points
ghlogin.--followremains a risk. Even with the skill limiting it to review loops, an agent can still pair it with long reads, as the skill-onfull-delegationtrial shows.evals/package-lock.json.Notes for reviewers
Stack, bottom to top (this is 8 of 11, based on
babakks/event-hints):babakks/event-client,babakks/event-listen,babakks/event-sub-list,babakks/event-sub-create,babakks/event-sub-view,babakks/event-sub-delete,babakks/event-hints,babakks/event-evals,babakks/event-listen-flush,babakks/event-listen-deleted-sub,babakks/event-check-suite.Start with
skills/gh/SKILL.md, the part that ships to users. Then readevals/README.mdandevals/suites/events/README.mdfor the harness and the scenarios, andevals/src/suites/events/gradingfor how trials are judged.docs/event-listen-preview.mdsummarizes the behavior of the whole stack.The preview doc and the events suite guide say that GitHub App installation tokens are admitted when the account the app is installed on is enabled for the preview. That follows the service's access rules; the evals have only been run with a user token.
Authorship and follow-up
Who wrote this:
Who answers review comments: