Skip to content

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

Closed
Radu028 wants to merge 1 commit into
pingdotgg:mainfrom
Radu028:fix/checkpoint-temp-index-cleanup
Closed

fix(server): avoid slow checkpoint index rebuilds#8538
Radu028 wants to merge 1 commit into
pingdotgg:mainfrom
Radu028:fix/checkpoint-temp-index-cleanup

Conversation

@Radu028

@Radu028 Radu028 commented Aug 28, 2026

Copy link
Copy Markdown

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

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Aug 28, 2026
Comment thread apps/server/src/vcs/GitVcsDriver.ts Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Reviewed by Cursor Bugbot for commit e3674afe966682d062f243a827a4fd11b7c68dfb. Configure here.

Comment thread apps/server/src/vcs/GitVcsDriver.ts
@macroscopeapp

macroscopeapp Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

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.

@Radu028
Radu028 force-pushed the fix/checkpoint-temp-index-cleanup branch from e3674af to 4b61437 Compare August 28, 2026 14:45
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Aug 28, 2026
@Radu028 Radu028 closed this Aug 28, 2026
@Radu028
Radu028 deleted the fix/checkpoint-temp-index-cleanup branch August 28, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant