Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): avoid slow checkpoint index rebuilds #8538

ClosedRadu028(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/8538/headopened View on GitHub

Problem

Checkpoint capture rebuilds a temporary index from HEAD, so git add -A must rescan the whole working tree. On large repositories this can hit the 30-second VCS timeout and leave temporary index lock files behind.

Fix

Seed the temporary checkpoint index from the worktree's current Git index to retain its stat cache, then normalize the copy before staging:

  • reset staged content to HEAD
  • clear assume-unchanged and skip-worktree flags
  • disable split-index, untracked-cache, and fsmonitor state
  • fall back to a fresh HEAD index if the live index cannot be copied or inspected safely

Cleanup removes both the temporary index and its .lock file. The user's real index is never modified.

Tests

  • pnpm --filter t3 exec vp test run src/vcs/GitVcsDriver.test.ts src/checkpointing/CheckpointStore.test.ts (13 passed)
  • pnpm --filter t3 typecheck
  • targeted lint and format checks
  • real Git regression test for modified files marked assume-unchanged and skip-worktree
  • focused 36,976-file repository measurement: full checkpoint index preparation and git add -A completed in 559 ms instead of timing out at 30 seconds
    1. 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: 56f87639-74b8-43d4-b542-7f7f09009f8c

      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

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

    3. 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 e3674afe966682d062f243a827a4fd11b7c68dfb. Configure [here](https://www.cursor.com/dashboard/bugbot).
    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Not approved

      Macroscope's review found this PR not approvable — The production checkpoint-capture path now includes substantial Git-index copying, flag normalization, fallback handling, and lock cleanup for every headed repository. Although the intent is clear and targeted tests were added, the runtime behavior and Git-specific complexity warrant human review.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).

Sign in to join this conversation.