orca icon indicating copy to clipboard operation
orca copied to clipboard

fix(source-control): keep huge change sets responsive

Open OrcaWin opened this issue 4 months ago • 2 comments

Summary

  • stream porcelain status incrementally on relay hosts and terminate Git as soon as Orca has enough entries
  • cap source-control data at 1,000 entries before IPC or SSH/relay transfer, preserving an explicit didHitLimit signal
  • keep huge-repository watcher suppression sticky while adding an explicit Retry path that recovers after the repository drops below the cap

ELI5

A branch with thousands of changes made Orca carry and render a giant list all at once, briefly freezing the window even though only a capped list was shown. Orca now stops reading as soon as it has the capped result, sends only that bounded result across process and host boundaries, pauses automatic refresh churn, and lets the user retry explicitly after cleaning up files.

Electron evidence

Exact fixture in both runs: one committed file plus exactly 12,000 untracked TypeScript files in 120 directories.

Measurement Before After
Initial Source Control activation 1601.6 ms 1516.9 ms
Renderer max event-loop lag during activation 1113.6 ms 664.4 ms
Explicit status scan 529.6 ms 284.0 ms
Warm rescan 146.4 ms 196.9 ms
IPC payload 850,222 bytes 85,221 bytes
Entries crossing IPC 10,000 1,000
Post-activation max lag 29.2 ms 20.7 ms
Render update — 2.0 ms

The exact Electron flow passed twice after the fix, including a fresh rebuild. Removing all 12,000 untracked files and choosing Retry cleared capped mode, proving explicit recovery.

Validation

  • 429 focused parser, status, relay, IPC, provider, runtime, store, and polling tests
  • additional relay/component run: 192 passed, 10 skipped
  • typecheck:node
  • typecheck:web
  • changed-file oxlint and max-lines ratchet
  • localization catalog and coverage checks
  • all six relay target builds plus the WSL hook relay
  • exact 12,000-file Electron E2E

Trade-off / user-visible change

Repositories with more than 1,000 changes now enter capped mode earlier, show the first 1,000 entries, pause automatic watcher and safety refreshes, and expose Retry. The smaller bound is what keeps renderer projection and cross-host transfer responsive; explicit Retry preserves recovery after cleanup.

Fixes #7991

OrcaWin avatar Jul 19 '26 22:07 OrcaWin

Electron before/after proof for the exact 12,000-file fixture: https://htmlpreview.github.io/?https://gist.githubusercontent.com/OrcaWin/6647ab6a294ab47bc1898334076e66b6/raw/orca-7991-electron-proof.html

The artifact embeds both temporary screenshots and their SHA-256 hashes; neither the screenshots nor fixture are committed to the repository. The measured IPC boundary changed from 10,000 entries / 850,222 bytes to 1,000 entries / 85,221 bytes, and deleting the fixture followed by Retry verified recovery.

OrcaWin avatar Jul 19 '26 22:07 OrcaWin

Review Change Stack

[!NOTE]

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • [ ] ▶️ Resume reviews
  • [ ] 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: bb35f38e-07e2-43fa-aaa3-275b8b4f396e

📥 Commits

Reviewing files that changed from the base of the PR and between eff7a344d28870e299be444df017c84159b7eec0 and 8c41c8f04d867da859fd283e570304a806530d19.

📒 Files selected for processing (1)
  • src/renderer/src/components/right-sidebar/SourceControl.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/components/right-sidebar/SourceControl.tsx

📝 Walkthrough

Walkthrough

The change streams Git status output into an incremental porcelain parser, enabling early termination and capped status metadata. Unmerged records now count toward limits and preserve output order across main and relay status paths. Shared subprocess-tree termination handles streamed Git and agent execution cleanup. Capped metadata propagates through IPC, runtime, polling, submodule, and editor state. Source Control adds retry and truncated-submodule UI states, with end-to-end coverage for payload size, responsiveness, recovery, and cache behavior.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary and testing, but it misses required template sections like Screenshots, AI Review Report, Security Audit, and Notes. Add the missing template sections and briefly summarize screenshots, AI review findings, security review, and any platform-specific notes.
Docstring Coverage ⚠️ Warning Docstring coverage is 15.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly matches the main change: making large source-control change sets responsive.
Linked Issues check ✅ Passed The PR implements the linked issue’s core fix: earlier capping, early Git termination, sticky huge-state suppression, and explicit retry recovery.
Out of Scope Changes check ✅ Passed No clear out-of-scope code changes stand out; the added relay, IPC, renderer, and test updates support the large-status responsiveness fix.

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.

coderabbitai[bot] avatar Jul 19 '26 22:07 coderabbitai[bot]