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

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

fix(server): generated commit and PR text ignores git signature output (#29580)

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

Alex Southwell committed Nov 3, 2026 at 18:41 UTC 4a09502b38e2d30ad23871f85fd629e8c3473e7d
4 files changed +71 -4
apps/server/src/git/GitManager.test.ts
+40
@@ -2638,6 +2638,46 @@ it.layer(layerGitManagerTest)("GitManager", (it) => {
2638 }),
2639 );
2640
2641 + it.effect("keeps signature output out of recent commit subjects", () =>
2642 + Effect.gen(function* () {
2643 + const repoDir = yield* makeTempDir("t3code-git-manager-");
2644 + yield* initRepo(repoDir);
2645 + const signingKey = NodePath.join(yield* makeTempDir("t3code-git-signing-key-"), "key");
2646 + NodeChildProcess.execFileSync("ssh-keygen", [
2647 + "-q",
2648 + "-t",
2649 + "ed25519",
2650 + "-N",
2651 + "",
2652 + "-f",
2653 + signingKey,
2654 + ]);
2655 + yield* runGit(repoDir, ["config", "gpg.format", "ssh"]);
2656 + // A global signer such as 1Password's cannot use the fixture's generated key.
2657 + yield* runGit(repoDir, ["config", "gpg.ssh.program", "ssh-keygen"]);
2658 + yield* runGit(repoDir, ["config", "user.signingkey", `${signingKey}.pub`]);
2659 + yield* runGit(repoDir, ["config", "log.showSignature", "true"]);
2660 + yield* runGit(repoDir, ["commit", "--amend", "-S", "--no-edit"]);
2661 + NodeFS.writeFileSync(NodePath.join(repoDir, "README.md"), "hello again\n");
2662 + let commitInstructions: string | undefined;
2663 +
2664 + const { manager } = yield* makeManager({
2665 + textGeneration: {
2666 + generateCommitMessage: (input) => {
2667 + commitInstructions = input.policy?.commitInstructions;
2668 + return Effect.succeed({ subject: "Update readme", body: "" });
2669 + },
2670 + },
2671 + });
2672 +
2673 + yield* runStackedAction(manager, { cwd: repoDir, action: "commit" });
2674 +
2675 + expect(commitInstructions).toMatch(
2676 + /Recent commit subjects from this repository:\nInitial commit$/,
2677 + );
2678 + }),
2679 + );
2680 +
2681 it.effect("falls back when the dedicated source control writer is unavailable", () =>
2682 Effect.gen(function* () {
2683 const repoDir = yield* makeTempDir("t3code-git-manager-");
apps/server/src/git/GitManager.ts
+1 -1
@@ -792,7 +792,7 @@ export const make = Effect.gen(function* () {
792 .execute({
793 operation: "GitManager.readRecentCommitSubjects",
794 cwd,
795 - args: ["log", "-n", "20", "--no-merges", "--pretty=format:%s"],
795 + args: ["log", "-n", "20", "--no-merges", "--no-show-signature", "--pretty=format:%s"],
796 })
797 .pipe(
798 Effect.map((result) =>
apps/server/src/vcs/GitVcsDriverCore.test.ts
+21 -2
@@ -2849,20 +2849,38 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => {
2849 }),
2850 );
2851
2852 - it.effect("reads range patches from source without textconv, color, or diff.relative", () =>
2852 + it.effect("reads raw range context regardless of Git display configuration", () =>
2853 Effect.gen(function* () {
2854 const cwd = yield* makeTmpDir();
2855 const { initialBranch } = yield* initRepoWithCommit(cwd);
2856 yield* git(cwd, ["config", "diff.probe.textconv", "touch textconv-ran; echo converted"]);
2857 yield* git(cwd, ["config", "color.ui", "always"]);
2858 yield* git(cwd, ["config", "diff.relative", "true"]);
2859 + yield* git(cwd, ["config", "log.decorate", "short"]);
2860 yield* git(cwd, ["checkout", "-b", "feature/range"]);
2861 yield* writeTextFile(cwd, ".gitattributes", "*.doc diff=probe\n");
2862 yield* writeTextFile(cwd, "notes.doc", "source line\n");
2863 yield* writeTextFile(cwd, "plain.txt", "plain line\n");
2864 yield* writeTextFile(cwd, "binary.dat", "binary\0data");
2865 yield* git(cwd, ["add", "."]);
2865 - yield* git(cwd, ["commit", "-m", "range files"]);
2866 + const signingKey = `${yield* makeTmpDir("git-vcs-driver-signing-key-")}/key`;
2867 + const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
2868 + const keygen = ChildProcess.make("ssh-keygen", [
2869 + "-q",
2870 + "-t",
2871 + "ed25519",
2872 + "-N",
2873 + "",
2874 + "-f",
2875 + signingKey,
2876 + ]);
2877 + assert.equal(Number(yield* spawner.exitCode(keygen)), 0);
2878 + yield* git(cwd, ["config", "gpg.format", "ssh"]);
2879 + // A global signer such as 1Password's cannot use the fixture's generated key.
2880 + yield* git(cwd, ["config", "gpg.ssh.program", "ssh-keygen"]);
2881 + yield* git(cwd, ["config", "user.signingkey", `${signingKey}.pub`]);
2882 + yield* git(cwd, ["config", "log.showSignature", "true"]);
2883 + yield* git(cwd, ["commit", "-S", "-m", "range files"]);
2884 const driver = yield* GitVcsDriver.GitVcsDriver;
2885 const fileSystem = yield* FileSystem.FileSystem;
2886 const projectCwd = `${cwd}/app`;
@@ -2870,6 +2888,7 @@ it.layer(layerTest)("GitVcsDriver core integration", (it) => {
2888
2889 const context = yield* driver.readRangeContext(projectCwd, initialBranch);
2890
2891 + assert.match(context.commitSummary.trim(), /^[a-f0-9]+ range files$/);
2892 assert.include(context.diffPatch, "+source line");
2893 assert.notInclude(context.diffPatch, "converted");
2894 assert.include(context.diffPatch, "+plain line");
apps/server/src/vcs/GitVcsDriverCore.ts
+9 -1
@@ -2942,7 +2942,15 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
2942 runGitStdoutWithOptions(
2943 "GitVcsDriver.readRangeContext.log",
2944 cwd,
2945 - ["log", "--oneline", "--no-color", "--end-of-options", commitRange],
2945 + [
2946 + "log",
2947 + "--oneline",
2948 + "--no-color",
2949 + "--no-decorate",
2950 + "--no-show-signature",
2951 + "--end-of-options",
2952 + commitRange,
2953 + ],
2954 {
2955 maxOutputBytes: RANGE_COMMIT_SUMMARY_MAX_OUTPUT_BYTES,
2956 appendTruncationMarker: true,