Skip to content

fix(server): keep installed editors visible when discovery times out - #4956

Open
eeinarsson wants to merge 5 commits into
pingdotgg:mainfrom
eeinarsson:fix/issue-4697-editor-discovery
Open

fix(server): keep installed editors visible when discovery times out#4956
eeinarsson wants to merge 5 commits into
pingdotgg:mainfrom
eeinarsson:fix/issue-4697-editor-discovery

Conversation

@eeinarsson

@eeinarsson eeinarsson commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

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:
image

After:
image

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • No animation or interaction changes require a video

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 availableEditorsComplete on ServerConfig. subscribeServerConfig emits 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

  • Adds discoverAvailableCommands in shell.ts to probe editor availability concurrently with a bounded timeout, returning partial results and a complete flag on timeout.
  • Rewrites resolveAvailableEditors in externalLauncher.ts to return { editors, complete }, with a 3s discovery timeout, 1-minute TTL cache for complete results, and shared in-flight deduplication across concurrent callers.
  • Propagates availableEditorsComplete through the server config contract and WebSocket handlers; subscribeServerConfig emits a second snapshot after 1s when the initial discovery was incomplete.
  • Updates OpenInPicker.tsx to show "Couldn't check for installed editors" instead of "No installed editors found" when discovery did not complete.
  • Behavioral Change: serverGetConfig responses now include availableEditorsComplete; incomplete first discoveries are not cached, causing a retry on the next request.

Macroscope summarized e6f1eb2.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 675c953a-1f2b-4726-aa76-18611ff04cc1

You can disable this status message by setting the reviews.review_status to false in 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jul 30, 2026

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread apps/server/src/process/externalLauncher.ts Outdated
@macroscopeapp

macroscopeapp Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces significant new functionality: timeout-aware editor discovery with caching, retry logic, and a new API field (availableEditorsComplete). The complex concurrency patterns (semaphores, deferreds, shared discovery) and new runtime behavior warrant human review despite comprehensive test coverage.

You can customize Macroscope's approvability policy. Learn more.

@eeinarsson
eeinarsson force-pushed the fix/issue-4697-editor-discovery branch from 8c9c656 to feb5302 Compare July 30, 2026 10:16

@macroscopeapp macroscopeapp Bot 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.

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

Comment thread packages/shared/src/shell.ts Outdated
Comment thread packages/shared/src/shell.ts Outdated
@eeinarsson eeinarsson changed the title Keep installed editors visible when discovery times out fix(server): keep installed editors visible when discovery times out Jul 30, 2026
@eeinarsson
eeinarsson force-pushed the fix/issue-4697-editor-discovery branch from 0f14432 to e6f1eb2 Compare July 31, 2026 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: No installed editors found

1 participant