Repository navigation
Avoid duplicate ripgrep scans for full file inventories - #23490
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (8)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughRelay and IPC file listings now use an ignored-inclusive ripgrep pass directly for unbounded listings. Bounded listings run the primary pass first and may run the ignored-inclusive pass if the result limit has room. The updated tests cover pass ordering and single-pass behavior, along with output filtering, failures, retries, timeouts, and cancellation. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to Unbounded inventories now use one ignored-inclusive scan, while bounded listings remain source-first. The inspected contracts show no material regression, so the change is ready to merge. Architecture SummaryArchitecture risk: 🟡 Medium · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
Reliability and maintainability
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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.
ℹ️ No critical issues — one coverage suggestion and a doc nit.
Reviewed changes
- Unbounded local listings use one scan.
listQuickOpenFilesnow runsrunRg(ignoredPass)alone when bothmaxResultsandmaxSerializedBytesare unset, instead of racingprimaryandignoredPassthroughPromise.all. - Unbounded relay listings use one scan.
listFilesWithRgcollapses its pass selection tosearchQuery !== undefined || maxResults === undefined ? runPass(ignoredPass) : …; bounded-by-maxResultslistings still runprimaryfirst, then the broad pass only if budget remains. - Tests retargeted to single-pass unbounded. The two-process mocks in the main, relay-ignored, and relay-cancel suites are narrowed to the one admitted pass, with new coverage for the byte-budget-only primary-first path (main) and the bounded relay primary-first path.
- No user-visible change expected. The unbounded result set was already
primary ∪ ignored, which equalsignoredunder the superset invariant; only the subprocess count drops from two to one.
ℹ️ Nitpicks
RgArgs.ignoredPassis documented insrc/shared/quick-open-filter.tsas the "Second pass", but for unbounded listings it is now the only pass. Since that file is untouched, a one-line JSDoc tweak there would keep the builder's description aligned with how both callers use it.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
604e0c6 to
129e1fe
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Superset invariant pinned by a test.
src/shared/quick-open-filter.test.tsadds anit.eachasserting thatignoredPasswith--no-ignore-vcsremoved deep-equalsprimaryfor two option sets (root.and/rootwith excludes plus slash separator). This is the exact invariant the single-pass unbounded listing relies on, so the two arg arrays can no longer diverge without failing a test. ignoredPassJSDoc corrected.src/shared/quick-open-filter.tsnow describes the field as the "Broader pass: primary files plus gitignored files", aligned with its sole-pass role for unbounded listings.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
129e1fe to
2667470
Compare
469bcb0 to
5975527
Compare

ELI5
Full workspace file inventories currently walk the same tree twice. Run the broader scan once to return the same files with less work.
What Changed
Unbounded local and relay file listings now use only the existing
--no-ignore-vcspass, which already includes every path from the ordinary pass. Result-count and byte-budgeted listings retain ordinary-source-files-first priority; ranked searches are unchanged.This benefits full mobile inventories and uncapped callers, including remote Markdown inventories. Normal capped Quick Open is unchanged. No protocol or API changes.
Why
On the actual checkout, the two scans emitted 68,028 filename records for 38,188 unique paths. One scan emits 38,188 records: 44% fewer and one subprocess instead of two. Removing duplicate work needs no new abstraction, cache, or fallback.
Warm-cache traversal/output collection measured approximately 50 ms → 30 ms on macOS arm64, Node 24.20.0, bundled rg 15.0.0 (eight counterbalanced samples after two warmups). This measures the scan, not total UI latency. Real-binary fixtures preserved exact file sets for Git and ordinary folders, nested ignore rules, symlinks, and subtree exclusions.
A broader audit measured transcript discovery/parsing, skills, themes, source scanning, localization enumeration, and installed Gemini extraction. None justified another production migration: most were slower or effectively tied; small gains came with behavior/lifecycle complexity.
Linked Issue
N/A — maintainer-requested performance audit.
Visual Proof
N/A — no visual or interaction change; this removes a redundant background scan.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
12 focused suites: 90 passed, 1 skipped, covering main/relay listings, count budgets, byte-only budgets, cancellation, retries, missing-binary recovery, and bundled/WSL command routing.
pnpm tc:nodepassed.pnpm run check:code-quality:changed, formatting, and diff whitespace checks passed.Actual bundled-binary before/after benchmarks and exact-set parity fixtures run locally.
Native macOS tested. Windows/WSL routing and relay behavior have automated coverage; real Windows, WSL, Linux, and SSH performance were not measured. Full lint/build and remaining suites are left to CI.
Review
Adversarial proposal reviews completed before coding. A separate agent reviewed the final implementation and tests with no actionable findings. Unbounded ordering was already nondeterministic because the two processes raced; capped source priority stays intact.
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Rebased onto current main, including the SSH browser reconnect fix (#23465) for the prior failing end-to-end test. Also supplies the newly required prompt registry in an existing Claude child-work test fixture; this repairs a typecheck failure inherited from main and changes no production behavior. After rebase: 91 ripgrep tests and 3 fixture tests pass, and
pnpm tc:nodepasses.Existing bundled binary resolution, host ownership, exclusions, cancellation, timeouts, and fallback classification stay in place. Folder workspaces and mixed client/server versions require no new behavior.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Comprehensive audit and measurements
Inventoried 163 main/relay/shared files mentioning traversal APIs, 329 mentioning file reads, and 343 search/scan/discovery-named modules. These are overlapping search inventories, not counts of independently benchmarked functions. Reviewed production ownership/call paths, CLI/mobile routing, shell find/grep uses, and relevant developer scanners. Three sub-agents reviewed separate areas; the duplicate-scan proposal received adversarial review before coding.
Benchmarks ran serially, with process startup included and warm filesystem caches. Candidate and production outputs were checked for parity. Most comparisons alternate order with warmups and multiple measured repetitions. Synthetic fixtures were used for transcripts, skills and themes, rather than private user data. Source-tree and file-inventory measurements use this actual checkout. Installed Gemini code was inspected without printing credential values. No Windows, WSL, Linux, network filesystem or SSH latency measurements were performed.
Decision: remove one redundant scan from unbounded file listings
filesystem-list-files.tsand relayfs-handler-list-files.tsrun a normal rg pass and a--no-ignore-vcspass for an unbounded inventory. The second already includes the first's paths. In this checkout both return a union of 38,188 paths, of which 29,840 are emitted twice. One pass reduces this subprocess count from two to one and filename delivery from 68,028 to 38,188 records (44% fewer).Measured traversal/output collection: about 50 ms for two concurrent passes vs 30 ms for one. This is not total UI latency. Real fixture checks cover ordinary/git folders, nested ignore rules, explicit subtree exclusions and symlinks. Capped listings and byte-budgeted listings retain the primary-first policy; normal renderer Quick Open supplies a cap and therefore is not the beneficiary. Full mobile inventories, uncapped runtime callers and remote Markdown inventories can benefit. Ranked query search already uses one pass.
Measured candidates rejected
Gemini illustrates why synthetic numbers alone are insufficient: a worst-case synthetic 100×1 MiB bundle improved 54.82→8.29 ms, but the installed CLI improved only ~0.55 ms. Small synthetic bundles regressed. Usage parsing numbers include the real unchanged parser, not a filename-only proxy; they exclude full account/service orchestration. Theme and skill candidate fixtures match ordinary inputs, not the complete symlink/budget contract.
Areas already using the appropriate mechanism
Areas where rg cannot replace the required work
Cleanup observation
src/shared/node-markdown-document-discovery.tscurrently has no production callers (only its test and CI timing references). It is a dead-code cleanup candidate, not a runtime speed opportunity. It was not mixed into this performance change.