| ... | @@ -39,6 +39,10 @@ import { | ... | @@ -39,6 +39,10 @@ import { |
| 39 | import { ServerConfig } from "../config.ts"; | 39 | import { ServerConfig } from "../config.ts"; |
| 40 | | 40 | |
| 41 | const DEFAULT_TIMEOUT_MS = 30_000; | 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; |
| 42 | const DEFAULT_MAX_OUTPUT_BYTES = 1_000_000; | 46 | const DEFAULT_MAX_OUTPUT_BYTES = 1_000_000; |
| 43 | const OUTPUT_TRUNCATED_MARKER = "\n\n[truncated]"; | 47 | const OUTPUT_TRUNCATED_MARKER = "\n\n[truncated]"; |
| 44 | const PREPARED_COMMIT_PATCH_MAX_OUTPUT_BYTES = 49_000; | 48 | const 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* |
| 2769 | | 2773 | |
| 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 | }); |
| 2773 | | 2778 | |
| 2774 | if (input.newRefName && input.baseRefName) { | 2779 | if (input.newRefName && input.baseRefName) { |