Repository navigation
Reduce Git refresh subprocess fanout - #6324
Conversation
Co-authored-by: Orca <[email protected]>
📝 WalkthroughWalkthroughThe PR adds local Git config signature reading, uses it to invalidate owner/repo cache entries, changes tracked-upstream discovery to bulk 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
src/main/github/local-git-config-signature.ts (1)
16-18: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd a short
Whycomment for the host-only early return.This branch encodes the PR's local-only invalidation rule, but the SSH/WSL exclusion is otherwise easy to misread as an accidental omission. As per coding guidelines "When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does."
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 5ce814d9-4cbc-42de-b24f-b7e26508bf02
📒 Files selected for processing (8)
src/main/github/client.test.tssrc/main/github/client.tssrc/main/github/conflict-summary.tssrc/main/github/gh-utils.test.tssrc/main/github/github-repository-identity.tssrc/main/github/local-git-config-signature.tssrc/main/ipc/worktrees.test.tssrc/main/ipc/worktrees.ts
Only cache stable missing-remote negatives for five minutes; transient git remote get-url failures retry on the next lookup. Tracked-upstream snapshot waiters re-probe missing branches, coalesce superseded probes, and avoid caching failed for-each-ref scans that would fan out per branch.
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Summary
This reduces Git subprocess pressure during PR/worktree refresh paths that were showing up in crash diagnostics with thousands of
git.execspans.git for-each-refsnapshot per repo/runtime, including SSH/WSL/local cache separation..git/configsignature so repeated missing/non-GitHub remote probes do not keep spawning Git.git merge-tree --merge-basecapability per runtime and reuse the legacy merge-tree path after the first failure.This is root-cause pressure reduction for repeated background Git/GitHub refresh work. It is not intended to prove every crash family is fixed; renderer active-status polling/backoff and lazy chunk load/syntax crashes remain separate work.
Tests
pnpm run typecheckpnpm run lintgit diff --checkpnpm exec vitest run --config config/vitest.config.ts src/main/github/gh-utils.test.ts src/main/github/client.test.ts --reporter=dot --testTimeout=15000(119 tests)pnpm exec vitest run --config config/vitest.config.ts src/main/ipc/worktrees.test.ts --reporter=dot --testTimeout=15000(154 tests)pnpm build:relaywindow.api.app.getIdentity()reportedcutlassfish @ brennanb2025/diagnose-bricked-machine.remote: 1 failure,worktree: 1 success); ten GitHub-style PR branch lookups produced one upstream snapshot rather than per-lookup branch probes (for-each-ref: 1)./work/demo-project: registered through Orca SSH, verified remotegit status --short --branchandgit worktree list --porcelain, then repeated the PR branch lookup path through the app.for-each-refcalls; after the fix, ten lookups for a newly-created remote branch producedfor-each-ref: 1 andremote get-url: 2.Made with Orca 🐋
Screenshots
No visual change.
AI Review Report
CodeRabbit code review threads were addressed and resolved. A separate
review-codesubagent pass reported no issues.Security Audit
No auth, credential storage, or permission model changes. The change reduces repeated Git/GitHub subprocess work and keeps SSH, WSL, and host caches separated by runtime.
Notes
Validated normal sidebar/PR checks refresh behavior on
demo-project. Active git status polling and lazy chunk load/syntax crashes remain separate work.