fix(server): keep installed editors visible when discovery times out - #4956
fix(server): keep installed editors visible when discovery times out#4956eeinarsson wants to merge 5 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8c9c656. Configure here.
ApprovabilityVerdict: Needs human review This PR introduces significant new functionality: timeout-aware editor discovery with caching, retry logic, and a new API field ( You can customize Macroscope's approvability policy. Learn more. |
8c9c656 to
feb5302
Compare
There was a problem hiding this comment.
One finding on Effect dependency acquisition: the new Windows discovery path reads process.env directly instead of the HostProcessEnvironment reference already used elsewhere in this module.
Posted via Macroscope — Effect Service Conventions
0f14432 to
e6f1eb2
Compare

What Changed
Why
Editor discovery could exceed the server config timeout and discard editors already found, causing clients to incorrectly show “No installed editors found.”
The optional completion field and existing snapshot event keep this compatible across mixed client/server versions.
Fixes #4697.
Related approaches: #4739 and #4435. Complementary command-probe performance work: #4778.
UI Changes
Before:

After:

Checklist
Note
Medium Risk
Changes editor discovery, caching, and server config contract; behavior is well covered by tests but affects cross-platform PATH probing and WebSocket config snapshots.
Overview
Editor discovery could exceed the server config timeout and drop editors already found, so the UI showed “No installed editors found” even when VS Code (etc.) was installed.
Shared shell layer adds
discoverAvailableCommands, which probes commands with bounded concurrency and a timeout and returns{ available, complete }. On Windows it scans PATH directories concurrently instead of serial per-editor checks.External launcher now returns
EditorDiscoveryResult(editors+complete), caches successful discovery for one minute, merges partial results with the last-known list on timeout, and shares one in-flight lookup across callers (including after interrupt or defect).Server config exposes optional
availableEditorsCompleteonServerConfig.subscribeServerConfigemits a follow-up snapshot one second later when the first discovery was incomplete so clients can refresh without blocking the initial response.Web UI (
OpenInPicker) uses that flag so an empty menu shows “Couldn’t check for installed editors” when discovery is incomplete or unknown, and “No installed editors found” only after a complete empty scan.Reviewed by Cursor Bugbot for commit e6f1eb2. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Keep installed editors visible in the UI when editor discovery times out
discoverAvailableCommandsinshell.tsto probe editor availability concurrently with a bounded timeout, returning partial results and acompleteflag on timeout.resolveAvailableEditorsinexternalLauncher.tsto return{ editors, complete }, with a 3s discovery timeout, 1-minute TTL cache for complete results, and shared in-flight deduplication across concurrent callers.availableEditorsCompletethrough the server config contract and WebSocket handlers;subscribeServerConfigemits a second snapshot after 1s when the initial discovery was incomplete.OpenInPicker.tsxto show "Couldn't check for installed editors" instead of "No installed editors found" when discovery did not complete.serverGetConfigresponses now includeavailableEditorsComplete; incomplete first discoveries are not cached, causing a retry on the next request.Macroscope summarized e6f1eb2.