Skip to content
Source
Sign inSign up
pingdotgg/t3code

Fix worktree removal timing out on large install trees #3902

Mergedjakeleventhal(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/3902/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Summary

Solves https://github.com/pingdotgg/t3code/issues/3593

  • Give git worktree remove a bounded five-minute cleanup window for dependency-heavy worktrees.
  • Keep path validation, lock handling, removal, and registration cleanup inside Git instead of pre-deleting directories through the filesystem.
  • Preserve the current already-removed worktree behavior from main.
  • Add an integration regression test that carries a forced removal past the previous timeout.

Test plan

  • pnpm exec vp test run apps/server/src/vcs/GitVcsDriverCore.test.ts (58 passed)
  • Focused formatting and lint checks
  • pnpm --filter t3 typecheck
  • git diff --check

Updated with Codex (gpt-5.6-sol) in the Codex harness.

Note

Fix 'removeWorktree' timeout to 5 minutes for large install trees

Updates GitVcsDriverCore.ts to use a new 5-minute WORKTREE_REMOVE_TIMEOUT_MS constant instead of the default 15-second timeout for git worktree remove. Adds an integration test in GitVcsDriverCore.test.ts that verifies the removal can run longer than the default command timeout without failing.

Macroscope summarized 4410854.

Note

Medium Risk Changes Git subprocess timeout for worktree teardown; longer waits on stuck removals but no auth or data-model impact.

Overview Fixes premature failures when tearing down worktrees that contain large dependency trees (e.g. node_modules), where git worktree remove can exceed the previous 15 second limit.

removeWorktree now uses a dedicated WORKTREE_REMOVE_TIMEOUT_MS (five minutes), aligned with the existing generous timeout for worktree add. Comments note the change is meant to stay bounded while avoiding killing Git mid-cleanup on slow filesystems (especially Windows). Idempotent “already gone” handling is unchanged.

Adds an integration test that wraps git worktree remove in a 31s delay and asserts removal still completes—mirroring the existing “push longer than default timeout” pattern.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 44108547699fb4ae5405adde500c27e7fe40cc8a. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
    1. You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

    2. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: c2a853e3-ce6e-4bdf-921e-e14719be4bf8

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    3. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved at b457585

      Macroscope's review found this PR approvable — This is a focused bug fix that raises only the worktree-removal deadline from 15 seconds to a bounded five minutes, allowing large filesystem cleanups to complete without changing cleanup semantics. A targeted integration test covers the longer-running path.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit cc622e2b79c62c23210db8ce83a97cace23eb853. Configure [here](https://www.cursor.com/dashboard/bugbot).
    6. t3dotgg(GitHub profile, opens in a new tab) added labelsvouch:trusted

    7. t3dotgg(GitHub profile, opens in a new tab) removed labelsvouch:unvouched

Sign in to join this conversation.