The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 02:00 UTC
fix(github): keep review-required until required reviewers approve (#32395)
Co-authored-by: Cursor <cursoragent@cursor.com>
William Sedlacek committed
Nov 7, 2026 at 02:46 UTC
95e7dbfdaf6d3c452eaeebd34c2d9712e2245358
2 files changed
+16
-2
packages/source-control-github/src/server/gitHubPullRequestJson.test.ts
+14
@@ -294,6 +294,20 @@ describe("pull request list decoding", () => {
294
]);
295
});
296
297
+ it("keeps review required when an approval falls short of the branch's required count", () => {
298
+ const batch = expectSuccess(
299
+ decodePullRequestListJson(
300
+ listJson([
301
+ {
302
+ reviewDecision: "REVIEW_REQUIRED",
303
+ latestReviews: [{ author: user("octocat"), state: "APPROVED" }],
304
+ },
305
+ ]),
306
+ ),
307
+ );
308
+ expect(batch.items.map((entry) => entry.reviewDecision)).toEqual(["review-required"]);
309
+ });
310
+
311
it("skips malformed entries but still counts them, so paging does not stop early", () => {
312
const batch = expectSuccess(
313
decodePullRequestListJson(listJson([{}, { number: "not-a-number" }])),
packages/source-control-github/src/server/gitHubPullRequestJson.ts
+2
-2
@@ -509,7 +509,7 @@ export function toPullRequestActionSummary(
509
};
510
}
511
512
-/** GitHub's reviewDecision ignores reviews outside branch rules, including app approvals. */
512
+/** Prefer GitHub's reviewDecision; only use latest reviews when it is absent (e.g. bot approvals). */
513
function toReviewDecisionWithReviews(
514
value: string | null | undefined,
515
reviews: ReadonlyArray<LatestReviewFields> | undefined,
@@ -518,7 +518,7 @@ function toReviewDecisionWithReviews(
518
if (summarized === "approved" || summarized === "changes-requested") return summarized;
519
const states = new Set((reviews ?? []).map((review) => review.state?.trim().toUpperCase() ?? ""));
520
if (states.has("CHANGES_REQUESTED")) return "changes-requested";
521
- if (states.has("APPROVED")) return "approved";
521
+ if (summarized === null && states.has("APPROVED")) return "approved";
522
return summarized;
523
}
524