The best way to control Claude Code, Codex and more from any computer or phone
fix(vcs): give `git worktree add` a longer timeout on large repos (#6326)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Chamaru Amasara committed
Aug 21, 2026 at 07:40 UTC
12c497083e6ed2d6f90cc7775b5ecea232926b4a
1 file changed
+5
apps/server/src/vcs/GitVcsDriverCore.ts
+5
@@ -39,6 +39,10 @@ import {
39
import { ServerConfig } from "../config.ts";
40
41
const DEFAULT_TIMEOUT_MS = 30_000;
42
+// `git worktree add` checks out the full tree, so on large repositories it can
43
+// take well beyond the default 30s (e.g. a 375k-file repo takes ~40s on an idle
44
+// machine). Give it generous headroom while still bounding a genuinely hung git.
45
+const WORKTREE_ADD_TIMEOUT_MS = 300_000;
46
const DEFAULT_MAX_OUTPUT_BYTES = 1_000_000;
47
const OUTPUT_TRUNCATED_MARKER = "\n\n[truncated]";
48
const PREPARED_COMMIT_PATCH_MAX_OUTPUT_BYTES = 49_000;
@@ -2769,6 +2773,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
2773
2774
yield* executeGit("GitVcsDriver.createWorktree", input.cwd, args, {
2775
fallbackErrorDetail: "git worktree add failed",
2776
+ timeoutMs: WORKTREE_ADD_TIMEOUT_MS,
2777
});
2778
2779
if (input.newRefName && input.baseRefName) {