Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/server/src/vcs/GitVcsDriverCore.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1396,7 +1396,7 @@ it.layer(TestLayer)("GitVcsDriver core integration", (it) => {
assert.equal(created.worktree.refName, "feature/worktree");
assert.equal(yield* git(worktreePath, ["branch", "--show-current"]), "feature/worktree");

yield* driver.removeWorktree({ cwd, path: worktreePath });
yield* driver.removeWorktree({ cwd, path: worktreePath, force: true });
const fileSystem = yield* FileSystem.FileSystem;
assert.equal(yield* fileSystem.exists(worktreePath), false);
}),
Expand Down
6 changes: 5 additions & 1 deletion apps/server/src/vcs/GitVcsDriverCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ const DEFAULT_TIMEOUT_MS = 30_000;
// 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;
// Large worktrees can take minutes to remove, especially when they contain
// install artifacts. Keep a deadline for stalled filesystems without imposing
// the short default timeout on normal cleanup.
const WORKTREE_REMOVE_TIMEOUT_MS = 30 * 60_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;
Expand Down Expand Up @@ -2988,7 +2992,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function*
}
args.push(input.path);
yield* executeGit("GitVcsDriver.removeWorktree", input.cwd, args, {
timeoutMs: 15_000,
timeoutMs: WORKTREE_REMOVE_TIMEOUT_MS,
fallbackErrorDetail: "git worktree remove failed",
});
});
Expand Down