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, 07:00 UTC
fix(server): generated commit and PR text no longer reads colored git output (#29126)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Alex Southwell committed
Nov 3, 2026 at 01:35 UTC
50106efdd9206d2df90c6a04eb63c115b43474e1
2 files changed
+18
-4
apps/server/src/vcs/GitVcsDriverCore.test.ts
+6
-1
@@ -2714,11 +2714,12 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => {
2714
}),
2715
);
2716
2717
- it.effect("reads range patches from source without running textconv", () =>
2717
+ it.effect("reads range patches from source without textconv or color", () =>
2718
Effect.gen(function* () {
2719
const cwd = yield* makeTmpDir();
2720
const { initialBranch } = yield* initRepoWithCommit(cwd);
2721
yield* git(cwd, ["config", "diff.probe.textconv", "touch textconv-ran; echo converted"]);
2722
+ yield* git(cwd, ["config", "color.ui", "always"]);
2723
yield* git(cwd, ["checkout", "-b", "feature/range"]);
2724
yield* writeTextFile(cwd, ".gitattributes", "*.doc diff=probe\n");
2725
yield* writeTextFile(cwd, "notes.doc", "source line\n");
@@ -2736,12 +2737,16 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => {
2737
assert.include(context.diffPatch, "+plain line");
2738
assert.include(context.diffPatch, "Binary files /dev/null and b/binary.dat differ");
2739
assert.include(context.diffSummary, "notes.doc");
2740
+ for (const output of [context.commitSummary, context.diffSummary, context.diffPatch]) {
2741
+ assert.notInclude(output, "\u001b[");
2742
+ }
2743
assert.isFalse(yield* fileSystem.exists(`${cwd}/textconv-ran`));
2744
2745
yield* writeTextFile(cwd, "notes.doc", "updated source line\n");
2746
const staged = yield* driver.prepareCommitContext(cwd, ["notes.doc"]);
2747
assert.include(staged?.stagedPatch ?? "", "+updated source line");
2748
assert.notInclude(staged?.stagedPatch ?? "", "converted");
2749
+ assert.notInclude(staged?.stagedPatch ?? "", "\u001b[");
2750
assert.include(staged?.stagedSummary ?? "", "notes.doc");
2751
assert.isFalse(yield* fileSystem.exists(`${cwd}/textconv-ran`));
2752
}),
apps/server/src/vcs/GitVcsDriverCore.ts
+12
-3
@@ -2530,7 +2530,15 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
2530
const stagedPatch = yield* runGitStdoutWithOptions(
2531
"GitVcsDriver.prepareCommitContext.stagedPatch",
2532
cwd,
2533
- ["diff", "--no-ext-diff", "--no-textconv", "--cached", "--patch", "--minimal"],
2533
+ [
2534
+ "diff",
2535
+ "--no-color",
2536
+ "--no-ext-diff",
2537
+ "--no-textconv",
2538
+ "--cached",
2539
+ "--patch",
2540
+ "--minimal",
2541
+ ],
2542
{
2543
env,
2544
maxOutputBytes: PREPARED_COMMIT_PATCH_MAX_OUTPUT_BYTES,
@@ -2923,7 +2931,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
2931
runGitStdoutWithOptions(
2932
"GitVcsDriver.readRangeContext.log",
2933
cwd,
2926
- ["log", "--oneline", "--end-of-options", commitRange],
2934
+ ["log", "--oneline", "--no-color", "--end-of-options", commitRange],
2935
{
2936
maxOutputBytes: RANGE_COMMIT_SUMMARY_MAX_OUTPUT_BYTES,
2937
appendTruncationMarker: true,
@@ -2932,7 +2940,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
2940
runGitStdoutWithOptions(
2941
"GitVcsDriver.readRangeContext.diffStat",
2942
cwd,
2935
- ["diff", "--stat", "--end-of-options", diffRange],
2943
+ ["diff", "--stat", "--no-color", "--end-of-options", diffRange],
2944
{
2945
maxOutputBytes: RANGE_DIFF_SUMMARY_MAX_OUTPUT_BYTES,
2946
appendTruncationMarker: true,
@@ -2943,6 +2951,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
2951
cwd,
2952
[
2953
"diff",
2954
+ "--no-color",
2955
"--no-ext-diff",
2956
"--no-textconv",
2957
"--patch",