Skip to content

Bound server memory usage when reviewing large untracked files#1118

Open
kcosr wants to merge 1 commit into
backnotprop:mainfrom
kcosr:fix/bound-review-memory
Open

Bound server memory usage when reviewing large untracked files#1118
kcosr wants to merge 1 commit into
backnotprop:mainfrom
kcosr:fix/bound-review-memory

Conversation

@kcosr

@kcosr kcosr commented Jul 24, 2026

Copy link
Copy Markdown

When an unignored build artifact or binary file appears in Git status, Plannotator can consume several gigabytes of server-side memory even if the rendered diff is small.

This PR keeps those files visible without loading their contents into memory. It also:

  • Limits untracked diff generation to four concurrent Git processes
  • Uses metadata instead of reading large files during freshness checks
  • Prevents binary files and oversized Git content from being served through /api/file-content
  • Applies the same endpoint behavior to the Bun and Pi servers

Large untracked files over 5 MiB are displayed as binary additions. Smaller files continue to behave normally, including manual hunk expansion.

Validated with focused tests, full TypeScript checks, and production builds for the review UI and hook.

Related to #940.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant