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 21, 09:45 UTC
fix(github): PR Code tab reads files 30 per page so GitHub keeps their patches (#31419)
Julius Marminge committed
Nov 16, 2026 at 17:02 UTC
6b134a7add372518e4e81a066fce2ec6cdcead9e
2 files changed
+6
-5
packages/source-control-github/src/server/GitHubPullRequestApi.test.ts
+4
-4
@@ -3133,7 +3133,7 @@ layer("GitHubPullRequestApi.layer", (it) => {
3133
expect(diff.patch).toContain("diff --git a/src/file1.ts b/src/file1.ts");
3134
expect(diff.patch).toContain("diff --git a/src/file2.ts b/src/file2.ts");
3135
assert.strictEqual(callAt(1).host, "github.acme.dev");
3136
- assert.strictEqual(pathAt(1), "repos/acme/web/pulls/7/files?per_page=100&page=1");
3136
+ assert.strictEqual(pathAt(1), "repos/acme/web/pulls/7/files?per_page=30&page=1");
3137
}),
3138
);
3139
@@ -3167,7 +3167,7 @@ layer("GitHubPullRequestApi.layer", (it) => {
3167
it.effect("hands back a cursor for the next page rather than walking on by itself", () =>
3168
Effect.gen(function* () {
3169
mockedExecute.mockReturnValueOnce(Effect.fail(diffRefused));
3170
- mockedExecute.mockReturnValueOnce(Effect.succeed(output(pullRequestFiles(100, 0))));
3170
+ mockedExecute.mockReturnValueOnce(Effect.succeed(output(pullRequestFiles(30, 0))));
3171
const cli = yield* GitHubPullRequestApi.GitHubPullRequestApi;
3172
3173
const diff = yield* cli.getPullRequestDiff({
@@ -3222,7 +3222,7 @@ layer("GitHubPullRequestApi.layer", (it) => {
3222
expect(diff.patch).toContain("diff --git a/src/file1.ts b/src/file1.ts");
3223
assert.strictEqual(
3224
pathAt(0),
3225
- "repos/acme/web/commits/a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0?per_page=100&page=1",
3225
+ "repos/acme/web/commits/a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0?per_page=30&page=1",
3226
);
3227
}),
3228
);
@@ -4047,7 +4047,7 @@ layer("GitHubPullRequestApi.layer", (it) => {
4047
number: 7,
4048
});
4049
4050
- assert.strictEqual(pathAt(1), "repos/acme/web/pulls/7/files?per_page=100&page=1");
4050
+ assert.strictEqual(pathAt(1), "repos/acme/web/pulls/7/files?per_page=30&page=1");
4051
expect(slice.patch).toContain("src/file1.ts");
4052
expect(slice.patch).not.toContain("diff --git a/a b/a");
4053
assert.isTrue(slice.withheldFilesReadable);
packages/source-control-github/src/server/GitHubPullRequestApi.ts
+2
-1
@@ -437,7 +437,8 @@ const collect = Effect.fn("GitHubPullRequestApi.collect")(function* <Item, E>(
437
438
const PULL_REQUEST_FALLBACK_MAX_ROWS = 1_000;
439
440
-const DIFF_FILES_PAGE_SIZE = 100;
440
+// Larger pages make GitHub drop patches and report those files as 0/0.
441
+const DIFF_FILES_PAGE_SIZE = 30;
442
const FILES_VIEWED_MAX_PAGES = 5;
443
const FILES_VIEWED_PER_REQUEST = 100;
444