@devries-cameron20 / t3code-1 / commits / 4de78cd1e6
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(source-control): fix watch failures on large forgejo PRs (#18432)

Robbie committed Oct 18, 2026 at 14:10 UTC 4de78cd1e6b1090642be067cf4c397299245f56e
2 files changed +59 -2
packages/source-control-forgejo/src/server/ForgejoPullRequestProvider.ts
+6 -2
@@ -305,7 +305,11 @@ export const make = Effect.gen(function* () {
305 })),
306 ),
307 page({ ...input, path: `${pullPath(input)}/reviews` }, ForgejoReview),
308 - page({ ...input, path: `${pullPath(input)}/commits` }, ForgejoCommit),
308 + // Without these, each commit lists its files and a big merge outgrows the output limit.
309 + page(
310 + { ...input, path: `${pullPath(input)}/commits?files=false&verification=false` },
311 + ForgejoCommit,
312 + ),
313 page({ ...input, path: `${issuePath(input)}/reactions` }, ForgejoReaction),
314 getViewer(input),
315 ],
@@ -403,7 +407,7 @@ export const make = Effect.gen(function* () {
407 ? yield* read(
408 {
409 ...input,
406 - path: `${repoPath(input)}/git/commits/${encodeURIComponent(input.commit)}`,
410 + path: `${repoPath(input)}/git/commits/${encodeURIComponent(input.commit)}?files=false&verification=false`,
411 },
412 ForgejoCommit,
413 )
packages/source-control-forgejo/src/server/ForgejoSourceControlProvider.test.ts
+53
@@ -580,6 +580,59 @@ it.effect(
580 },
581 );
582
583 +it.effect("reads Forgejo pull request commits without their file lists", () => {
584 + const paths: string[] = [];
585 + return Effect.gen(function* () {
586 + const provider = yield* ForgejoPullRequestProvider.make;
587 + const activity = yield* provider.getChangeRequestActivity({
588 + cwd: "/repo",
589 + repository: "maria/project",
590 + host: "forgejo.test",
591 + number: 30,
592 + });
593 + assert.deepStrictEqual(
594 + activity.commits.map((commit) => commit.oid),
595 + ["abc"],
596 + );
597 + const commitReads = paths.filter((path) =>
598 + path.startsWith("repos/maria/project/pulls/30/commits"),
599 + );
600 + assert.isNotEmpty(commitReads);
601 + for (const path of commitReads) {
602 + const query = new URLSearchParams(path.split("?")[1]);
603 + assert.strictEqual(query.get("files"), "false");
604 + assert.strictEqual(query.get("verification"), "false");
605 + }
606 + }).pipe(
607 + Effect.provide(
608 + Layer.mock(ForgejoCli.ForgejoCli)({
609 + api: (input) => {
610 + paths.push(input.path);
611 + const [path, query] = input.path.split("?");
612 + const page = Number(new URLSearchParams(query).get("page") ?? "1");
613 + const body =
614 + path === "user"
615 + ? { login: "maria" }
616 + : path === "repos/maria/project/pulls/30/commits" && page === 1
617 + ? [
618 + {
619 + sha: "abc",
620 + author: null,
621 + commit: {
622 + message: "Reorganize folders",
623 + committer: { date: "2026-10-11T00:00:00Z" },
624 + },
625 + parents: [],
626 + },
627 + ]
628 + : [];
629 + return encodeJsonEffect(body).pipe(Effect.orDie, Effect.map(processOutput));
630 + },
631 + }),
632 + ),
633 + );
634 +});
635 +
636 it.effect("discovers Forgejo accounts and retains the server port", () =>
637 Effect.gen(function* () {
638 const auth = ForgejoSourceControlProvider.discovery.parseAuth(