fix(server): reduce editor scan work and retain partial results #11071
main fromrefs/pull/11071/head·opened View on GitHubWhat Changed#
Reuse PATH directory listings during editor discovery to reduce repeated filesystem checks. Return and cache editors found within four seconds if the scan takes longer. Preserve filesystem case-sensitivity behaviour and add tests for directory caching, fallback checks, and partial results.
Why#
T3 Code on my Windows 11 machine would show an empty 'Open' list as it would timeout while looking for available editors. Even if some were found, they were thrown out if it reached the timeout. The reason was 29,568 file checks being performed (22 commands (editors), 56 paths (my windows PATH), 12 file extensions and 2 case checks)
UI Changes#
Before:
After:
Checklist#
- This PR is small and focused
- I explained what changed and why
- I included before/after screenshots for any UI changes
Summary by CodeRabbit#
Bug Fixes
- Editor discovery now returns successfully detected editors even when another probe stalls or times out.
- Completed discovery results remain available for subsequent requests.
- Command lookup is more reliable on case-sensitive file systems and safely falls back when directory contents cannot be read.
Performance
- Repeated command lookups within the same operation reuse directory information, reducing unnecessary file-system checks while preserving PATH priority.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
Approvability#
Verdict: Approved at
9cbe171Macroscope's review found this PR approvable — The PR makes a focused correction to existing editor discovery: it reuses PATH listings and preserves editors found before a slow probe times out. Runtime changes are confined to this discovery path, with fallback behavior and partial-result caching covered by targeted tests.
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Advanced
Run ID:
df74768f-0f22-4f4d-aec4-350a492ed4cf📥 Commits
Reviewing files that changed from the base of the PR and between 9cbe17114685f839dd79edca10ece8ca25de97c0 and 1be253668e72a1763d7b9ba6a0a9e2c6eaf28d61.
📒 Files selected for processing (4)
apps/server/src/process/externalLauncher.test.tsapps/server/src/process/externalLauncher.tspackages/shared/src/shell.test.tspackages/shared/src/shell.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
📝 Walkthrough
Walkthrough#
Changes#
The shell resolver now caches PATH directory listings and handles listing errors. Editor discovery now returns and caches completed probes after a four-second timeout.
Command discovery and editor probing
Layer / File(s) Summary Cached PATH directory resolution
packages/shared/src/shell.ts,packages/shared/src/shell.test.tsCommand resolution caches directory listings, applies platform-specific case handling, and falls back to file probes for non- NotFounderrors.Bounded editor discovery
apps/server/src/process/externalLauncher.ts,apps/server/src/process/externalLauncher.test.tsEditor discovery now times out after four seconds and caches completed probes. Tests cover timeout recovery and memoization. Priority: ➖ Normal
Estimated code review effort: 3 (Moderate) | ~20 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge,utkarshusernameMerge Risk: ⚪ Minimal · up to
1be25Completed editor discoveries remain available when a later probe times out, with no confirmed merge-blocking risk.
🚥 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. 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 clearly summarizes the primary changes: reducing editor scan work and retaining partial results during timeouts. Description check ✅ Passed The description includes the required What Changed, Why, UI Changes, and Checklist sections. It explains the problem, solution, testing scope, and provides before-and-after screenshots for the UI chan… 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. - Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
Comment `@coderabbitai help` to get the list of available commands.@coderabbitai help
Chat#
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. - PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
CodeRabbit commands#
These commands are invoked using PR/Issue comments.
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai review --preview-configto test the unmerged CodeRabbit configuration on a draft PR. The requester must have repository write access; preview results are non-authoritative.@coderabbitai rate limitto show your current review rate limit status.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai trackin a human-authored review thread to track the original finding until CodeRabbit verifies it is fixed.@coderabbitai fixedin a tracked review thread to verify the current code against the original finding.@coderabbitai evaluate custom pre-merge check --instructions <custom-checks-instructions> --name <custom-checks-title> [--mode <error|warning>]to validate the custom pre-merge checks instructions. Defaults toerrorwhen--modeis omitted.@coderabbitai ignore pre-merge checksto override pre-merge checks and get an approval on PR.@coderabbitai run pre-merge checksto run pre-merge checks on the pull request.@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai generate unit teststo generate unit tests for this PR.@coderabbitai emit path instructionsto emit generated path-specific review instructions for this repository.@coderabbitai generate project vocabularyto list vocabulary that is specific to this repository.@coderabbitai resolve merge conflictto automatically resolve merge conflicts.@coderabbitai autofixto automatically fix issues in the current review thread, or all unresolved review comments when used in the PR conversation.@coderabbitai fix-cito automatically fix failing CI checks in a stacked pull request.@coderabbitai fix-ci committo automatically fix failing CI checks by committing fixes to the current branch.@coderabbitai resolveto resolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai generate configurationto create a PR that adds the current resolved configuration as.coderabbit.yaml(or show it if already present).@coderabbitai helpto get help.
Other keywords and placeholders#
- Add
@coderabbitai ignoreor@coderabbit ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
Status, support, documentation and community#
- Visit our status page to check the current availability of CodeRabbit.
- Create a ticket on our support page for assistance with any issues or questions.
- Visit our documentation site for detailed information on how to use CodeRabbit.
- Join our Discord community to connect with other users and get help from the community.
- Follow us on X/Twitter for updates and announcements.
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
@coderabbitai run pre-merge checks
✅ Actions performed
Running Pre-merge checks. Results will be posted in the summary comment once complete.
juliusmarminge added labelsmacroscope-review
Note
Written by
claude-opus-5-5on behalf of MariaHi! We are cleaning up open PRs, and this one does not say which model or harness was used to create it. If this change is really important, we recommend rebuilding the PR with a newer model and noting the model and harness in the PR description.
maria-rcks closed this
Sign in to join this conversation.
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes