feat(server): agents can watch a PR and get woken when checks, reviews, or conflicts need them (#15057)

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Theo BrowneandClaude Opus 5.5 authored and GitHub committed 2026-10-03 03:08:44 -07:00
1 parent e8545b293b
commit 18b21325c3
31 files changed
+1531 -39

No files matched your search

@@ -26,6 +26,7 @@ import {
decodeWorkflowRunApprovalsJson,
reviewThreadConversation,
REVIEW_THREADS_GRAPHQL_QUERY,
pullRequestCoreGraphQlQuery,
pullRequestSearchGraphQlQuery,
} from "./gitHubPullRequestJson.ts";
@@ -285,6 +286,25 @@ describe("pull request detail decoding", () => {
]);
});
it("keeps what branch protection requires, and asks for it on github.com only", () => {
const raw = JSON.parse(detailJson) as Record<string, unknown>;
const detail = expectSuccess(
decodePullRequestDetailJson(
JSON.stringify({
...raw,
statusCheckRollup: [
{ __typename: "CheckRun", name: "test", status: "IN_PROGRESS", isRequired: true },
{ __typename: "StatusContext", context: "bot", state: "PENDING", isRequired: false },
{ __typename: "StatusContext", context: "legacy", state: "SUCCESS" },
],
}),
),
);
expect(detail.checks.map((check) => check.required)).toEqual([true, false, undefined]);
expect(pullRequestCoreGraphQlQuery("github.com")).toContain("isRequired");
expect(pullRequestCoreGraphQlQuery("github.example.com")).not.toContain("isRequired");
});
it("keeps a workflow waiting for approval out of the passing state", () => {
const raw = JSON.parse(detailJson) as Record<string, unknown>;
const detail = expectSuccess(