@devries-cameron20 / t3code-1 / commits / f901c37e7f
Fork 0

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

fix(server): git failures are read in English when macOS git follows the system language (#32252)

Jui-Chen Chien committed Nov 7, 2026 at 14:27 UTC f901c37e7fe20816caa52e5f5e8eca7729e5b42c
2 files changed +52
apps/server/src/vcs/VcsProcess.test.ts
+49
@@ -149,6 +149,55 @@ describe("VcsProcess.run", () => {
149 }),
150 );
151
152 + // Without LANG, macOS Git follows the system language, as in an app launched from Finder.
153 + it.effect("reads Git failures in English when Git would follow the system language", () =>
154 + Effect.gen(function* () {
155 + let attempts = 0;
156 + const service = yield* VcsProcess.make.pipe(
157 + Effect.provideService(
158 + ProcessRunner.ProcessRunner,
159 + ProcessRunner.ProcessRunner.of({
160 + run: (input) =>
161 + Effect.sync(() => {
162 + attempts += 1;
163 + return {
164 + stdout: "",
165 + stderr:
166 + attempts % 2 === 0
167 + ? ""
168 + : input.env?.LANGUAGE === "C"
169 + ? "fatal: Unable to create '/private/repo/.git/index.lock': File exists.\n"
170 + : "致命錯誤: 無法建立「/private/repo/.git/index.lock」:File exists。\n",
171 + code: ChildProcessSpawner.ExitCode(attempts % 2 === 0 ? 0 : 128),
172 + timedOut: false,
173 + stdoutTruncated: false,
174 + stderrTruncated: false,
175 + stdoutInvalidUtf8: false,
176 + stderrInvalidUtf8: false,
177 + };
178 + }),
179 + }),
180 + ),
181 + );
182 +
183 + const capture = yield* service
184 + .run({
185 + ...baseInput,
186 + operation: VcsProcess.CHECKPOINT_CAPTURE_OPERATION,
187 + args: ["add", "--all"],
188 + })
189 + .pipe(Effect.exit, Effect.forkChild({ startImmediately: true }));
190 + yield* TestClock.adjust("1 second");
191 + expect(Exit.isSuccess(yield* Fiber.join(capture))).toBe(true);
192 + expect(attempts).toBe(2);
193 +
194 + attempts = 0;
195 + const error = yield* Effect.flip(service.run(baseInput));
196 + assert.instanceOf(error, VcsProcessExitError);
197 + expect(error.detail).toBe(VcsProcess.GIT_INDEX_LOCKED_DETAIL);
198 + }),
199 + );
200 +
201 it.effect.each([
202 {
203 stderr: "fatal: fsync error on '.git/objects/a5/tmp_obj_Pseg66': Operation not supported",
apps/server/src/vcs/VcsProcess.ts
+3
@@ -210,6 +210,9 @@ export const make = Effect.gen(function* () {
210 ...(input.stdin !== undefined ? { stdin: input.stdin } : {}),
211 ...(input.onStdoutChunk !== undefined ? { onStdoutChunk: input.onStdoutChunk } : {}),
212 env: {
213 + // Failures are read by English patterns; without LANG, macOS Git follows the system language.
214 + // LANGUAGE leaves LC_CTYPE, which hooks inherit, alone.
215 + ...(input.command === "git" ? { LANGUAGE: "C" } : {}),
216 ...input.env,
217 ...explicitBareRepositoryEnv({ ...process.env, ...input.env }, hostPlatform),
218 },