Skip to content

fix(server): bound editor discovery latency#4221

Open
StiensWout wants to merge 3 commits into
pingdotgg:mainfrom
StiensWout:fix/editor-discovery-timeout
Open

fix(server): bound editor discovery latency#4221
StiensWout wants to merge 3 commits into
pingdotgg:mainfrom
StiensWout:fix/editor-discovery-timeout

Conversation

@StiensWout

@StiensWout StiensWout commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • run editor availability probes concurrently instead of serializing every command lookup
  • cap each editor probe at three seconds and keep successful partial results when another probe stalls
  • preserve the configured editor order and add deterministic virtual-clock regression coverage

Root cause

server.getConfig waits for external editor discovery before returning its configuration snapshot. Editor discovery checked every configured editor sequentially, and every missing Windows command could traverse the full inherited PATH across all PATHEXT variants. Slow filesystem lookups therefore accumulated across the entire editor catalog and blocked provider statuses from reaching the client.

Impact

Optional editor detection can no longer block configuration indefinitely. Fast probes remain visible even when another editor lookup times out, allowing the Providers page and other configuration consumers to resolve within a bounded interval.

Validation

  • pnpm exec vp test run apps/server/src/process/externalLauncher.test.ts (5 tests passed)
  • pnpm exec vp lint --report-unused-disable-directives apps/server/src/process/externalLauncher.ts apps/server/src/process/externalLauncher.test.ts
  • pnpm exec vp run --filter t3 typecheck
  • pnpm exec vp fmt --check apps/server/src/process/externalLauncher.ts apps/server/src/process/externalLauncher.test.ts
  • isolated authenticated web verification: the Providers page rendered completed provider states; on Windows the editor discovery span completed in about 1.62 seconds while individual missing-command probes took about 1.5 seconds

Closes #4210


Note

Medium Risk
Changes timing and completeness of editor lists (timeouts may hide slow-but-valid editors) and affects config paths that wait on discovery; behavior is bounded and covered by new tests.

Overview
Editor discovery in ExternalLauncher no longer runs serial PATH probes that could block getConfig indefinitely on slow Windows lookups.

Probes for each configured editor now run in parallel, with a 3-second cap per editor (EDITOR_DISCOVERY_TIMEOUT). Editors that finish in time are included; timed-out or hanging probes are dropped while faster ones still appear in the list. Command alias resolution for launch uses Effect.raceAll so the first responsive alias wins instead of checking aliases one-by-one.

makeWithOptions exposes injectable editorCommandAvailability and editorDiscoveryTimeout for tests; production still defaults to isCommandAvailable. New tests cover Zed fallback alias racing and virtual-clock behavior that partial results survive when some probes never complete.

Reviewed by Cursor Bugbot for commit 0ce82e3. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Bound editor discovery latency by probing aliases concurrently with a 3-second timeout

  • Editor discovery in externalLauncher.ts now probes all editors concurrently instead of sequentially, applying a per-editor timeout (default 3 seconds) and returning partial results for editors that resolved in time.
  • For multi-alias editors (e.g. zed/zeditor), the selected command is now the first alias whose availability check resolves, rather than using a fixed order.
  • A new makeWithOptions factory allows injecting a custom editorCommandAvailability function and editorDiscoveryTimeout, used by tests to control probe timing.
  • Behavioral Change: editors whose availability probes never complete (e.g. hung filesystem checks) are now silently dropped from results after the timeout rather than blocking discovery indefinitely.

Macroscope summarized 0ce82e3.

@coderabbitai

coderabbitai Bot commented Jul 21, 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

Run ID: 84eda229-6111-49d2-ba4e-28efa0238068

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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:M 30-99 changed lines (additions + deletions). labels Jul 21, 2026
@StiensWout
StiensWout marked this pull request as ready for review July 21, 2026 06:36
Comment thread apps/server/src/process/externalLauncher.ts
@macroscopeapp

macroscopeapp Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR changes editor discovery from sequential to concurrent with a 3-second timeout, potentially altering which editors users see when some probes are slow. This runtime behavior change warrants human review.

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

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

Reviewed by Cursor Bugbot for commit fe6834f. Configure here.

Comment thread apps/server/src/process/externalLauncher.ts
@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:M 30-99 changed lines (additions + deletions). labels Jul 21, 2026
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]: Provider page stays on "Checking provider status" because server.getConfig blocks on editor discovery

1 participant