The best way to control Claude Code, Codex and more from any computer or phone
fix(server): review guides no longer fail on the repository's checkout hooks (#29907)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Alex Southwell committed
Nov 3, 2026 at 23:49 UTC
e1cf10bae46b22a5064bb67bd0a39c80ace71783
2 files changed
+19
-5
apps/server/src/pullRequest/PullRequestReviewGuideService.test.ts
+8
-4
@@ -467,7 +467,7 @@ it.layer(layerBase, { excludeTestServices: true })("PullRequestReviewGuideServic
467
),
468
);
469
470
- it.effect("keeps excerpts of source lines a configured diff driver would convert away", () =>
470
+ it.effect("keeps excerpts despite the checkout's diff driver and a failing hook", () =>
471
Effect.scoped(
472
Effect.gen(function* () {
473
const repositories = yield* makeRepositories;
@@ -477,6 +477,9 @@ it.layer(layerBase, { excludeTestServices: true })("PullRequestReviewGuideServic
477
"feature.txt diff=blank\n",
478
);
479
yield* git(repositories.workspace, ["config", "diff.blank.textconv", "true"]);
480
+ const hook = `${repositories.workspace}/.git/hooks/post-checkout`;
481
+ yield* fs.writeFileString(hook, "#!/bin/sh\nexit 1\n");
482
+ yield* fs.chmod(hook, 0o755);
483
const stored = yield* Deferred.make<void>();
484
const context = yield* Layer.build(
485
makeLayer({
@@ -502,9 +505,10 @@ it.layer(layerBase, { excludeTestServices: true })("PullRequestReviewGuideServic
505
context,
506
PullRequestReviewGuideService.PullRequestReviewGuideService,
507
);
505
- yield* service.generate(reference);
506
- yield* Deferred.await(stored);
507
- const result = yield* service.get(reference);
508
+ const runs = yield* watchRuns;
509
+ yield* runs.generate(service, reference);
510
+ const result = yield* runs.settled(service, reference);
511
+ assert.notStrictEqual(result.run?._tag, "Failed", JSON.stringify(result.run));
512
assert.deepStrictEqual(result.guide?.stops[0]?.excerpts, [
513
{ path: "feature.txt", side: "new", start: 1, end: 3, caption: "" },
514
]);
apps/server/src/pullRequest/PullRequestReviewGuideService.ts
+11
-1
@@ -305,7 +305,17 @@ const make = Effect.gen(function* () {
305
yield* git.execute({
306
operation: "PullRequestReviewGuideService.addWorktree",
307
cwd: workspaceRoot,
308
- args: ["worktree", "add", "--detach", "--quiet", path, resolvedHead.commitSha],
308
+ // Scratch checkout for reading the change: repository hooks (installs, LFS) only slow or fail it.
309
+ args: [
310
+ "-c",
311
+ "core.hooksPath=/dev/null",
312
+ "worktree",
313
+ "add",
314
+ "--detach",
315
+ "--quiet",
316
+ path,
317
+ resolvedHead.commitSha,
318
+ ],
319
timeoutMs: 5 * 60_000,
320
});
321
yield* Effect.addFinalizer(() =>