Repository navigation
fix(quick-open): guide rg install after fallback budget errors - #9627
AmethystLiang merged 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds shared Quick Open utilities for detecting ripgrep installation commands across platforms and Linux distributions, then formats oversized-scan guidance for local or remote hosts. The filesystem fallback transforms readdir-budget errors while preserving other failures. Relay guidance uses the shared formatter. Renderer parsing and display now support both host-neutral and legacy remote message wording, with tests covering the updated behavior. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 |
…tall-guidance-9539
The install-rg guidance component hardcoded 'on the remote', so the new local fallback path told local users to install ripgrep 'on the remote' — wrong for the exact case stablyai#9627 targets. Parse the location out of the message and render the matching wording; add the local locale string and a render test that guards against the 'on the remote' regression. Also harden the reason capture against a stray ')' in the error text. Co-authored-by: Orca <[email protected]>
AmethystLiang
left a comment
There was a problem hiding this comment.
Approving. Scope is error/alerting only — the file-listing algorithm, the rg spawn, git ls-files, the readdir walk, and the 10,000-file budget are all unchanged.
No performance regression: the only change in the hot path (listQuickOpenFiles) is return → return await inside a new try/catch, and that block is reached only when rg is absent. The added work (budget-error classification + buildInstallRgMessage, which reads /etc/os-release once on Linux) runs strictly in the catch — i.e. only after a scan has already failed with a budget error. The rg-available path and the success path do zero extra work. checkRgAvailable on line 45 is pre-existing, not introduced here.
Pushed a follow-up fixing a UI wording bug: the guidance component hardcoded "on the remote", so local scans told users to install ripgrep "on the remote". Now the location is parsed from the message and rendered correctly, with a render test guarding the regression.
| @@ -42,13 +44,20 @@ export async function listQuickOpenFiles( | |||
| // can run. | |||
| const rgAvailable = await checkRgAvailable(authorizedRootPath, localGitOptions.wslDistro) | |||
There was a problem hiding this comment.
No performance regression from this line or the surrounding change.
checkRgAvailable(this line) is pre-existing — not introduced by this PR.- The only hot-path edit is
return→return awaitinside a new try/catch, reached only when rg is absent. - The added work (budget-error classification +
buildInstallRgMessage, which reads/etc/os-releaseonce on Linux) runs strictly inside the catch — i.e. only after a scan already failed with a budget error. The rg-available path and every successful scan do zero extra work. - No change to the listing algorithm, rg spawn,
git ls-files, the readdir walk, or the 10,000-file budget.
…yai#9627) * fix(quick-open): guide rg install after fallback budget errors * fix(quick-open): show local host wording for local install guidance The install-rg guidance component hardcoded 'on the remote', so the new local fallback path told local users to install ripgrep 'on the remote' — wrong for the exact case stablyai#9627 targets. Parse the location out of the message and render the matching wording; add the local locale string and a render test that guards against the 'on the remote' regression. Also harden the reason capture against a stray ')' in the error text. Co-authored-by: Orca <[email protected]> --------- Co-authored-by: Jinjing <[email protected]> Co-authored-by: Orca <[email protected]>
Summary
Improves user alerting when local Quick Open falls back because ripgrep is unavailable. Previously the fallback surfaced a raw, opaque error (e.g. "File listing exceeded 10000 files"); now a readdir/git budget failure (file-count limit or timeout) is turned into actionable guidance that points the user at installing ripgrep, matching the guidance the relay/remote path already shows. Git, cancellation, and other file errors keep their original messages.
Scope / non-goals: This is an alerting change only. It does not change the file-listing algorithm, raise the 10,000-file budget, or otherwise fix the underlying case where searching a large repo without ripgrep fails. It only makes the existing failure legible and actionable. The durable fix for the root cause is to bundle ripgrep for the local host — tracked on #9539, not addressed here.
Screenshots
No new layout or styling; the local error reuses the existing Quick Open install-guidance UI.
Testing
pnpm lint— changed-scope lint is clean; the full gate stops only on two pre-existing switch-exhaustiveness errors already present onorigin/mainpnpm typecheckpnpm test— changed-scope tests pass: 6 files, 56 tests; the full suite has one unrelated local PTY non-ASCII-path failurepnpm build— desktop/typecheck/web stages pass; native macOS sub-builds are blocked by local Swift Command Line Tools errors and the existing pnpm native-wrapper issueAI Review Report
/etc/os-releasedetection; no shell execution or new permissions.Security Audit
No new process execution, permissions, network access, or user-controlled command interpolation was added.
Notes
Related to #9539 — this PR improves the alert but does not close the issue. The root cause (Quick Open scanning the whole tree and hitting the fallback budget when ripgrep is absent) remains; bundling ripgrep locally is the follow-up fix and is left to that issue. Locale JSON and release/version files are unchanged.