authorgravatar for mailtochamaru@gmail.comChamaru Amasara <mailtochamaru@gmail.com> 2026-08-21 07:40:26+05:30
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-08-20 22:10:26-04:00
log12c497083e6ed2d6f90cc7775b5ecea232926b4a
treedcb0b4354cbaaec944fe7258fc2c29a070ba1cc9
parent820e5639c30be83a9433f696613760f8ee42075a
signature Signed by PGP key B5690EEEBB952194

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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>

1 files changed, 5 insertions(+), 0 deletions(-)

apps/server/src/vcs/GitVcsDriverCore.ts+5
...@@ -39,6 +39,10 @@ import {...@@ -39,6 +39,10 @@ import {
39import { ServerConfig } from "../config.ts";39import { ServerConfig } from "../config.ts";
4040
41const DEFAULT_TIMEOUT_MS = 30_000;41const 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.
45const WORKTREE_ADD_TIMEOUT_MS = 300_000;
42const DEFAULT_MAX_OUTPUT_BYTES = 1_000_000;46const DEFAULT_MAX_OUTPUT_BYTES = 1_000_000;
43const OUTPUT_TRUNCATED_MARKER = "\n\n[truncated]";47const OUTPUT_TRUNCATED_MARKER = "\n\n[truncated]";
44const PREPARED_COMMIT_PATCH_MAX_OUTPUT_BYTES = 49_000;48const PREPARED_COMMIT_PATCH_MAX_OUTPUT_BYTES = 49_000;
...@@ -2769,6 +2773,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*...@@ -2769,6 +2773,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
27692773
2770 yield* executeGit("GitVcsDriver.createWorktree", input.cwd, args, {2774 yield* executeGit("GitVcsDriver.createWorktree", input.cwd, args, {
2771 fallbackErrorDetail: "git worktree add failed",2775 fallbackErrorDetail: "git worktree add failed",
2776 timeoutMs: WORKTREE_ADD_TIMEOUT_MS,
2772 });2777 });
27732778
2774 if (input.newRefName && input.baseRefName) {2779 if (input.newRefName && input.baseRefName) {