Skip to content

fix(quick-open): guide rg install after fallback budget errors - #9627

Merged
AmethystLiang merged 3 commits into
stablyai:mainfrom
squatboy:fix/quick-open-rg-install-guidance-9539
Jul 23, 2026
Merged

AmethystLiang merged 3 commits into
stablyai:mainfrom
squatboy:fix/quick-open-rg-install-guidance-9539

Conversation

@squatboy

@squatboy squatboy commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

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 on origin/main
  • pnpm typecheck
  • pnpm test — changed-scope tests pass: 6 files, 56 tests; the full suite has one unrelated local PTY non-ASCII-path failure
  • pnpm 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 issue
  • Regression tests cover budget guidance, cancellation/Git error preservation, macOS install command, and legacy remote parsing

AI Review Report

  • macOS/Linux/Windows: preserves platform-specific install command detection and generic fallback; no listing algorithm or 10,000-file limit changes.
  • Local/SSH: applies the new classification only to local fallback errors and preserves relay behavior and legacy parsing.
  • Performance: guidance is built only after a budget failure; file listing work is unchanged.
  • UI: reuses the existing copy-command guidance UI for the new local message.
  • Security: uses fixed install text and read-only /etc/os-release detection; 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.

@squatboy squatboy closed this Jul 21, 2026
@coderabbitai

coderabbitai Bot commented Jul 21, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dbaf3749-8d62-4699-b729-1690f98227fd

📥 Commits

Reviewing files that changed from the base of the PR and between 33ef061 and e66ef38.

📒 Files selected for processing (4)
  • src/renderer/src/components/QuickOpen.tsx
  • src/renderer/src/components/quick-open-install-rg-guidance.render.test.tsx
  • src/renderer/src/components/quick-open-install-rg-guidance.test.ts
  • src/renderer/src/components/quick-open-install-rg-guidance.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/components/quick-open-install-rg-guidance.test.ts

📝 Walkthrough

Walkthrough

Adds 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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: actionable ripgrep-install guidance after Quick Open budget fallback errors.
Description check ✅ Passed The description follows the required template and includes all requested sections with sufficient detail.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

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 AmethystLiang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 await inside a new try/catch, reached only when rg is absent.
  • The added work (budget-error classification + buildInstallRgMessage, which reads /etc/os-release once 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.

@AmethystLiang
AmethystLiang merged commit e8d5d50 into stablyai:main Jul 23, 2026
1 check passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants