fix(server): speed up Windows diagnostics and editor discovery #3911
ClosedSivanTechDev(GitHub profile, opens in a new tab)wants to merge 4 commits into
main fromrefs/pull/3911/headopened View on GitHubgithub-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
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
- @@ -117,3 +117,14 @@117117 const isOrchestrationDispatchCommandError = Schema.is(OrchestrationDispatchCommandError);118118119119 const nowIso = Effect.map(DateTime.now, DateTime.formatIso);120+const EDITOR_DISCOVERY_TIMEOUT = Duration.seconds(5);121+const EDITOR_DISCOVERY_FALLBACK = [] as const;122+123+export const withEditorDiscoveryTimeout = <A, E, R>(124+ discovery: Effect.Effect<ReadonlyArray<A>, E, R>,125+ timeout: Duration.Input = EDITOR_DISCOVERY_TIMEOUT,126+) =>127+ discovery.pipe(128+ Effect.timeoutOption(timeout),129+ Effect.map(Option.getOrElse(() => EDITOR_DISCOVERY_FALLBACK)),130+ );@@ -270,12 +272,9 @@270- if (editor.commands === null) {271- const command = fileManagerCommandForPlatform(platform);272- if (yield* isCommandAvailable(command, { env })) {273- available.push(editor.id);274- }275- continue;276- }277-278- const command = yield* resolveAvailableCommand(editor.commands, env);279- if (Option.isSome(command)) {280- available.push(editor.id);281- }272+ if (platform === "win32") {273+ // Use the existing fast resolver: repeated asynchronous PATH scans exceeded five seconds on the reported machine.274+ const resolveExecutable = yield* SpawnExecutableResolution;275+ return EDITORS.flatMap((editor) => {276+ const commands = editor.commands ?? [fileManagerCommandForPlatform(platform)];277+ return commands.some((command) => resolveExecutable(command, platform, env) !== undefined)278+ ? [editor.id]279+ : [];280+ });
Sign in to join this conversation.


📝 Walkthrough
Walkthrough#
Process diagnostics now use platform-specific timeouts and batched Windows performance queries. Editor discovery uses concurrent command resolution, while server configuration applies a timeout and empty fallback for stalled discovery. Tests cover Windows querying, resolver behavior, and non-blocking configuration.
Changes#
Diagnostics and editor discovery
apps/server/src/diagnostics/ProcessDiagnostics.ts,apps/server/src/diagnostics/ProcessDiagnostics.test.tsapps/server/src/process/externalLauncher.ts,apps/server/src/process/externalLauncher.test.tsapps/server/src/ws.ts,apps/server/src/server.test.tsEstimated code review effort: 3 (Moderate) | ~20 minutes
Sequence Diagram(s)#
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)#
✅ Passed checks (4 passed)
#3610by fixing Windows diagnostics latency, editor discovery blocking, and config fallback behavior.✨ Finishing Touches
🧪 Generate unit tests (beta)
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