Repository navigation
Fix ripgrep result completeness, filename handling, and search errors - #25156
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (10)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review. 📝 WalkthroughWalkthroughRipgrep filename listings now use NUL-delimited records and incremental UTF-8 decoding. Path handling preserves literal backslashes for non-Windows roots and applies Windows separator rules to Windows roots. Text search adds bounded JSON parsing, Unicode-aware match offsets, root-aware path resolution, and diagnostic-based process outcomes. The renderer now stores and displays search errors. Windows relay ripgrep lookup uses the effective command environment PATH and refreshes cached results when that path changes. Priority: ⬆️ High Merge Risk: ⚪ Minimal · up to No outstanding issue is established; the change is mergeable after normal checks. Architecture SummaryArchitecture risk: 🟡 Medium · up to The change affects 3 systems. 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 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
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 new issues found.
Reviewed changes
I read the full 53-file diff, ran the new and changed suites (all green), and had two specialists independently verify the two novel algorithms. No blocking or actionable defects found.
- Config isolation —
--no-configadded tobuildRgArgs,buildRgArgsForQuickOpen, andlistMarkdownDocuments, so a user'sRIPGREP_CONFIG_PATHno longer silently changes results; repo ignore files still apply. - NUL framing — every rg
--filesbuilder now emits--nulland every consumer splits on\0, so filenames with embedded newlines/CR stay intact.normalizeQuickOpenRgLineno longer strips a trailing\r. - Strict filename decoding — new
RipgrepFilenameDecoder(fatalTextDecoder) rejects invalid UTF-8 and, when WSL translation is required, literal-backslash names, marking results incomplete rather than fabricating replacement-character paths. - Root-relative search target —
buildRgArgs(query, '.', opts)withcwd: rootPathacross main/runtime/relay, so anchored globs such assrc/**match; newresolveSearchResultPathresolves rg's cwd-relative output. - UTF-16 columns — new
ripgrep-line-decoding/ripgrep-match-offsetsmap rg byte offsets to editor columns with a monotonic reader. A specialist brute-forced all 3-byte prefixes (0 mismatches) and 4-byteF0–F4prefixes plus randomized fuzzing againstBuffer.toString('utf8')— exact parity, including malformed runs. - Dense matches — the silent 100-per-file cap is removed;
parseDenseRipgrepMatchJsonuses@streamparser/jsonto retain the remaining global budget from records exceeding the structural-token limit. Verified against@streamparser/[email protected]'skeepStack:falselive-stack semantics: the budget is exact and no undercount-without-truncatedpath exists. - Failure diagnostics —
RipgrepSearchDiagnosticsmakes searches that error with no matches (e.g. invalid regex) reject instead of resolving as a false-empty result; permission errors with matches stay incomplete-but-present. - Renderer + Windows relay PATH — the error surfaces in
SearchResultsPane, stale rejections are ignored bylatestSearchIdRef, and the Windows relay now resolves rg frombuildRelayCommandEnv()'s effective PATH with a bounded-miss cache and drive-rooted entries only.
I did not flag the one narrow compatibility consideration (--no-config is not in older ripgrep) because the relay prefers the bundled rg 15.0.0 and only a PATH-fallback host with an ancient rg would regress.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
cc4fea1 to
2bc589d
Compare
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run incrementally re-reviewed the delta since the prior pullfrog review (8da6986 → cc4fea1), a follow-up commit that closes the two round-one adversarial findings. I read the raw incremental diff and the full PR diff for context, and verified the load-bearing claims against the installed dependency and the changed callers.
- Preserves U+FEFF inside dense-record strings — a new pnpm patch on
@streamparser/[email protected]addsignoreBOM: trueto both buffered decoders. The tokenizer encodes string input to bytes, so the decoder is on the path; a BOM insidepath.text/lines.textnow survives instead of being stripped (which had shifted dense-match columns). A document-leading BOM is still handled by the tokenizer's own BOM state, so the patch is scoped to in-string BOMs. - Distinguishes literal POSIX backslashes —
normalizeRelativePathnow takes a root and only folds\when the root is Windows-like;splitPathSegments,isDotfileRelativePath,buildIgnoredSet, and the name-filter projection threadworktreePaththrough, so Explorer filtering no longer mergesa\b.txtwitha/b.txton POSIX. - Consistent synthetic row paths — name-filter projection builds
relativePathwith/unconditionally, matching the non-filtered listing's normalization on Windows. - Regression coverage — new tests cover BOMs at string-buffer boundaries (the dependency directly and through the dense parser), a real-
rgdense-line BOM column case, and POSIX/Windows filename-identity projection cases. Each can fail against the pre-fix code.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run re-reviewed the delta after the branch rebase (cc4fea1 → 2bc589d). The only content change is the third commit registering the search-failure localization entry.
- Registered the
fileSearch.failedstring —src/renderer/src/i18n/locales/en.jsongains"fileSearch": { "failed": "Search failed. Try again." }, matching thetranslate('fileSearch.failed', 'Search failed. Try again.')call added inuseFileSearchRunner.ts. This is the translator-source entry for the already-reviewed inline fallback, so the English fallback path is unchanged and non-English catalogs can now translate it. The rebase re-attributed this same hunk from the first commit to the third, so the net tree is otherwise identical to the previously approved revision.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This run incrementally re-reviewed the delta since the prior pullfrog review (2bc589d → 3d4a95b), the fourth commit that carries host filename identity through the document and watcher consumers. I read the raw incremental range-diff and the relevant full-diff hunks, then read each touched source file to trace the identity plumbing end to end. No specialist was needed — the change is mechanical threading of an existing rootPath parameter.
- Preserves literal POSIX backslashes in renderer path helpers —
normalizeRelativePath(path, rootPath?)andjoinPath(src/renderer/src/lib/path.ts) now fold\only whenisWindowsAbsolutePathLike(rootPath), so a POSIX filename likea\b.txtstays distinct from the directory patha/b.txtinstead of being merged. - Threads
worktreePaththrough the identity-sensitive consumers —splitPathSegments,isDotfileRelativePath,buildIgnoredSet,getRevealAncestorDirs, the name-filter projection, anduseFileExplorerVisibleRowProjectionall receive the root now, so noderelativePath, ignored-set keys, and dotfile checks agree byte for byte on POSIX. - Fixes watcher and directory-listing identity —
normalizeExplorerAbsolutePathonly strips trailing/on POSIX;parentDirForWatchPathgained a POSIXlastIndexOf('/')branch;getExternalFileChangeRelativePathpasses the root;clearStalePendingRevealrelies onisPathInsideOrEqual's normalization; andfileExplorerEntriesToTreeNodesusesgetRelativePathInsideRoot(path, worktreePath), which also fixes first-character truncation when the root ends in a separator. - Hardens Markdown document classification/decoding —
markdownDocumentFromRelativePathusesposix.extnameafter remote-separator normalization whileisMarkdownDocumentNamekeeps platformextname;rootRelativePathis root-aware; andlistMarkdownDocumentsnow rejects invalid UTF-8 and WSL literal-backslash names viaRipgrepFilenameDecoder. - Regression coverage — new cases cover Windows-client remote paths, local literal-backslash names, invalid/incomplete UTF-8 listing rejection, abandoned-scalar timeout preservation, and Explorer directory/filter/watcher identity. These assert exact values and would fail against the pre-fix code.
The sibling call sites that still normalize without a root (buildStatusMap, buildFolderStatusMap, source-control-tree.ts) are untouched and remain out of scope, matching the PR's stated boundary for presentation/Git path helpers.
deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

ELI5
Search should find the right files, highlight the right characters, and tell you when it could not finish. Several edge cases currently look like successful searches with missing or incorrect results. This change fixes the shared ripgrep inputs and output decoding used by desktop and remote searches.
What Changed
.so includes such assrc/**match correctly.Why
These are correctness fixes, not a claim that every search becomes faster. Shared builders, parsers, and diagnostics keep the desktop, runtime, and SSH implementations consistent. The ordinary JSON path remains simple; only dense records use bounded projection instead of constructing every submatch object. Repeated prefix decoding was rejected because it makes Unicode column conversion quadratic.
Measurements
Native macOS arm64, Node 24.20.0, bundled ripgrep 15.0.0. Parser measurements run serially in separate Node processes; ten samples, first two excluded. Ordinary records use 1,000 iterations per sample. These timings exclude subprocess startup and are parser-only.
The dense parser costs more because it now processes results previously discarded. A separate conversion benchmark compared two correct implementations: 2,000 Unicode offsets took about 0.041 ms with the monotonic reader versus 17.18 ms with repeated prefix decoding. This is not a speedup claim against the old incorrect byte offsets.
Strict filename decoding was also measured serially on 40,000 Unicode filenames / 1,188,890 bytes, delivered in 64 KiB chunks. Ten counterbalanced samples after two warmups: replacement decoding median 1.45 ms, strict decoding 0.53 ms, exact valid-output parity. This microbenchmark excludes process startup and does not establish end-to-end search speed.
The separate Markdown optimization was merged in #25148: identical 293 documents with 99.46% less filename stdout. No blanket thread tuning was adopted; a single scanning thread was slower in that measured checkout.
Linked Issue
N/A — maintainer-requested complete usage audit.
Visual Proof
Hidden Electron validation used an isolated profile and the current worktree. Entering an invalid regex displays the actual error; retrying with
needleclears the error and displays one result.Invalid regular expression:
Successful retry:
Testing
After rebasing onto main at
b1b78b4d20b3: 591 tests passed across 59 suites, with two platform-only cases skipped on macOS. All typecheck projects (Node, renderer, CLI and configured siblings), diff whitespace checks, and the changed-code quality gate pass. The first CI run caught an ESM-only test import under the CLI CommonJS project; that import now loads dynamically and the complete typecheck command passes. The search-failure localization key is now registered; both catalog and extraction gates pass locally. Actual bundled-binary fixtures cover Unicode columns, anchored globs, dense matches, per-file completeness and invalid regex.Review
Proposals received adversarial agent review before implementation. Repeated three-agent review rounds covered parsers, subprocess lifecycle, renderer consumers, remote boundaries and platform paths, with independent review after fixes. Findings fixed with regressions include U+FEFF stripped inside strings by the streaming JSON dependency, POSIX backslashes collapsed in Explorer consumers, Windows-client classification of POSIX Markdown names, watcher updates routed to the wrong similarly named tab, and truncated relative names at filesystem roots. The final independent reviews are clean. The unused normalization helper was removed.
Independent parser validation includes 64 ESM/CJS Unicode/buffer-boundary probes and 23,000 differential cases. The dependency fix is six decoder-option changes in the existing pnpm patch mechanism, verified against the clean npm tarball and tested against the other session-stream consumers. The final consumer review also traces actual editor event indexing and filesystem mutation routing.
Agent skill upstream boundary
Audit coverage
filesystem-list-files.tsfilesystem-search-file-paths.tsmarkdown-documents.tsfilesystem-search-handlers.tsruntime-file-commands-search-local-runtime-files.tsrelay/fs-handler-list-files.tsrelay/fs-handler-utils.tsripgrep-process-availability.tsBinary/resource resolution, WSL architecture selection, SSH upload and reference-based cache collection, desktop six-platform packaging, target-specific orcad packaging, and the CI xprop readiness invocation were also reviewed. No additional application rg execution sites were found. Configuration isolation is applied in shared argument builders; no new local git/readdir fallback was added. Default thread selection is retained because measured single-thread scans were slower.
Deliberately retained policies
Notes
All seven application execution sites and the failure-only version probe were audited, along with binary resolution, WSL routing, SSH upload/cache collection, desktop and orcad packaging, and the small CI-only invocation. No new wire fields or opcodes are introduced. Old remote hosts retain their own search behavior until updated; old clients may not show the new detailed error display.
Live host validation used
orca host listand a dedicated background terminal on the pairedawinenvironment. The final production helpers were bundled from this worktree and exercised on macOS arm64 (Node24.20.0), Windows x64 (Node24.18.0), and Ubuntu24.04 under WSL/Linux x64 (Node24.0.0). Each ripgrep binary matched the SHA256 of the corresponding installed Orca dependency. Checks covered Unicode columns, anchored includes, config isolation, 150 matching lines, 10,000 dense hits retaining 2,000, FEFF preservation, POSIX Explorer identity on a Windows client, NUL-framed Unicode filenames, regex exit 2, and Windows Cargo PATH fallback. A real invalid-UTF8 filename on Linux also verified explicit listing rejection and incomplete text results. This is live binary/helper validation, not a complete desktop installation or paired app end-to-end test. The listed Linux SSH host was disconnected, so no real SSH host result is claimed. Host-path tests and CI do not substitute for release notarization or deployment smoke tests. Existing limits remain: 5 MiB files, 2,000 requested matches, 500-character snippets and 15-second search timeout. Remote Markdown ignore-policy differences and listing partial-result policy are called out in the audit rather than silently changed.Checklist