fix(vcs): give git worktree add a longer timeout on large repos (#6326)

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
Chamaru AmasaraandClaude Opus 5 authored and GitHub committed 2026-08-20 22:10:26 -04:00
1 parent 820e5639c3
commit 12c497083e
1 file changed
+5
+5
View File
@@ -39,6 +39,10 @@ import {
import { ServerConfig } from "../config.ts";
const DEFAULT_TIMEOUT_MS = 30_000;
// `git worktree add` checks out the full tree, so on large repositories it can
// take well beyond the default 30s (e.g. a 375k-file repo takes ~40s on an idle
// machine). Give it generous headroom while still bounding a genuinely hung git.
const WORKTREE_ADD_TIMEOUT_MS = 300_000;
const DEFAULT_MAX_OUTPUT_BYTES = 1_000_000;
const OUTPUT_TRUNCATED_MARKER = "\n\n[truncated]";
const PREPARED_COMMIT_PATCH_MAX_OUTPUT_BYTES = 49_000;
@@ -2769,6 +2773,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
yield* executeGit("GitVcsDriver.createWorktree", input.cwd, args, {
fallbackErrorDetail: "git worktree add failed",
timeoutMs: WORKTREE_ADD_TIMEOUT_MS,
});
if (input.newRefName && input.baseRefName) {