fix(server): keep installed editors visible when discovery times out
What Changed
- made Windows editor discovery bounded and concurrent while preserving partial successes
- retained last-known editors when a discovery attempt is incomplete
- added an optional completion signal and one retry through the existing config snapshot stream
- added focused shell, launcher, server, and picker coverage
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
- [x] This PR is small and focused
- [x] I explained what changed and why
- [x] I included before/after screenshots for any UI changes
- [x] No animation or interaction changes require a video
[!NOTE] Medium Risk Touches server config streaming and cross-platform command discovery with new timeout/partial-result semantics; behavior is well tested but affects what clients show for editor availability.
Overview Editor discovery no longer collapses to an empty list when probes time out or stall.
discoverAvailableCommandsin shared shell code runs bounded, concurrent PATH checks and returns{ available, complete }.ExternalLauncher.resolveAvailableEditorsnow returns{ editors, complete }, merges partial results with the last known complete list, and only caches successful complete discoveries.
ServerConfigadds optionalavailableEditorsComplete. The websocket config stream keeps that flag on snapshots, schedules a 1s retry when the initial load is incomplete, and folds retries into live updates without clobbering settings/keybinding events.OpenInPickershows “Couldn’t check for installed editors” when discovery is incomplete or unknown, instead of “No installed editors found”.Coverage spans shell discovery, launcher caching/retry behavior, server config subscription, and the picker empty state.
Reviewed by Cursor Bugbot for commit 64d5e41df8b40d7dd5d44429f43aa71fa4185dd1. Bugbot is set up for automated code reviews on this repo. Configure here.
[!NOTE]
Keep installed editors visible in server config when editor discovery times out
- Adds
EditorDiscoveryResult(witheditorsandcompletefields) to replace the plain editor array returned byresolveAvailableEditorsin externalLauncher.ts.- Introduces
discoverAvailableCommandsin shell.ts: a platform-aware, timeout-bounded bulk command scanner that returns partial results with acompleteflag instead of failing on timeout.- Caches complete discoveries for 1 minute; incomplete or failed discoveries are not cached, and the last known complete editor list is preserved on incomplete refreshes.
- On incomplete discovery,
subscribeServerConfigin ws.ts schedules a retry after 1s and emits a refreshedServerConfigsnapshot, propagatingavailableEditorsCompleteto clients.- The
OpenInPickerUI in OpenInPicker.tsx now shows "Couldn't check for installed editors" when discovery is incomplete, versus "No installed editors found" when it is complete.Macroscope summarized 64d5e41.
[!IMPORTANT]
Review skipped
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
d7839a3b-c087-4823-9ae2-62d405e19537You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
- [ ] 🔍 Trigger review
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 @coderabbitai help to get the list of available commands.
Approvability
Verdict: Needs human review
This PR introduces new timeout handling, caching, and retry logic for editor discovery - significant runtime behavior changes. An unresolved review comment identifies that retry failures in the discovery stream could terminate the entire config subscription, which warrants human review.
You can customize Macroscope's approvability policy. Learn more.
Closing as superseded by #5561. I verified on Windows 11 with the latest nightly that the editor dropdown now works correctly without this PR.