@devries-cameron20 / t3code-1 / commits / 655165d5f8
Fork 0

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

fix(server): generated PR text reads source diffs instead of textconv output (#22503)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: GPT-6.1 Sol <noreply@openai.com> Co-authored-by: maria-rcks <maria@kuuro.net>

Victor Vogel committed Oct 31, 2026 at 21:22 UTC 655165d5f8053d1008bbaf9d0015f8f637275c3d
2 files changed +43 -2
apps/server/src/vcs/GitVcsDriverCore.test.ts
+33
@@ -2577,6 +2577,39 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => {
2577 }),
2578 );
2579
2580 + it.effect("reads range patches from source without running textconv", () =>
2581 + Effect.gen(function* () {
2582 + const cwd = yield* makeTmpDir();
2583 + const { initialBranch } = yield* initRepoWithCommit(cwd);
2584 + yield* git(cwd, ["config", "diff.probe.textconv", "touch textconv-ran; echo converted"]);
2585 + yield* git(cwd, ["checkout", "-b", "feature/range"]);
2586 + yield* writeTextFile(cwd, ".gitattributes", "*.doc diff=probe\n");
2587 + yield* writeTextFile(cwd, "notes.doc", "source line\n");
2588 + yield* writeTextFile(cwd, "plain.txt", "plain line\n");
2589 + yield* writeTextFile(cwd, "binary.dat", "binary\0data");
2590 + yield* git(cwd, ["add", "."]);
2591 + yield* git(cwd, ["commit", "-m", "range files"]);
2592 + const driver = yield* GitVcsDriver.GitVcsDriver;
2593 + const fileSystem = yield* FileSystem.FileSystem;
2594 +
2595 + const context = yield* driver.readRangeContext(cwd, initialBranch);
2596 +
2597 + assert.include(context.diffPatch, "+source line");
2598 + assert.notInclude(context.diffPatch, "converted");
2599 + assert.include(context.diffPatch, "+plain line");
2600 + assert.include(context.diffPatch, "Binary files /dev/null and b/binary.dat differ");
2601 + assert.include(context.diffSummary, "notes.doc");
2602 + assert.isFalse(yield* fileSystem.exists(`${cwd}/textconv-ran`));
2603 +
2604 + yield* writeTextFile(cwd, "notes.doc", "updated source line\n");
2605 + const staged = yield* driver.prepareCommitContext(cwd, ["notes.doc"]);
2606 + assert.include(staged?.stagedPatch ?? "", "+updated source line");
2607 + assert.notInclude(staged?.stagedPatch ?? "", "converted");
2608 + assert.include(staged?.stagedSummary ?? "", "notes.doc");
2609 + assert.isFalse(yield* fileSystem.exists(`${cwd}/textconv-ran`));
2610 + }),
2611 + );
2612 +
2613 it.effect("loads new and deleted files without reading their missing side", () =>
2614 Effect.gen(function* () {
2615 const cwd = yield* makeTmpDir();
apps/server/src/vcs/GitVcsDriverCore.ts
+10 -2
@@ -2502,7 +2502,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
2502 const stagedPatch = yield* runGitStdoutWithOptions(
2503 "GitVcsDriver.prepareCommitContext.stagedPatch",
2504 cwd,
2505 - ["diff", "--no-ext-diff", "--cached", "--patch", "--minimal"],
2505 + ["diff", "--no-ext-diff", "--no-textconv", "--cached", "--patch", "--minimal"],
2506 {
2507 env,
2508 maxOutputBytes: PREPARED_COMMIT_PATCH_MAX_OUTPUT_BYTES,
@@ -2913,7 +2913,15 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
2913 runGitStdoutWithOptions(
2914 "GitVcsDriver.readRangeContext.diffPatch",
2915 cwd,
2916 - ["diff", "--no-ext-diff", "--patch", "--minimal", "--end-of-options", diffRange],
2916 + [
2917 + "diff",
2918 + "--no-ext-diff",
2919 + "--no-textconv",
2920 + "--patch",
2921 + "--minimal",
2922 + "--end-of-options",
2923 + diffRange,
2924 + ],
2925 {
2926 maxOutputBytes: RANGE_DIFF_PATCH_MAX_OUTPUT_BYTES,
2927 appendTruncationMarker: true,