@devries-cameron20 / t3code-1 / commits / 8de0aa24d9
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

perf(desktop): probe the Windows shell environment concurrently (#5878)

Co-authored-by: tsouth89 <tsouth89@users.noreply.github.com>

Tyler committed Aug 10, 2026 at 10:53 UTC 8de0aa24d9b09b3dff9e3378222877cbfff41ae0
1 file changed +12 -4
apps/desktop/src/shell/DesktopShellEnvironment.ts
+12 -4
@@ -379,10 +379,18 @@ const installWindowsEnvironment = Effect.fn("desktop.shellEnvironment.installWin
379 function* (
380 config: ShellEnvironmentConfig,
381 ): Effect.fn.Return<void, never, ChildProcessSpawner.ChildProcessSpawner> {
382 - const noProfile = yield* readWindowsEnvironment(["PATH"], { loadProfile: false });
383 - const profile = yield* readWindowsEnvironment(WINDOWS_PROFILE_ENV_NAMES, {
384 - loadProfile: true,
385 - });
382 + // Concurrent, not sequential: these two probes are independent (only their
383 + // results are combined below) and each spawns its own PowerShell. Run in
384 + // series they sit at offset 0 of desktop.startup, before anything else, and
385 + // launch traces measured them at 2718ms then 2066ms — the entire 4.8s
386 + // startup span, of which desktop.bootstrap is ~30ms.
387 + const [noProfile, profile] = yield* Effect.all(
388 + [
389 + readWindowsEnvironment(["PATH"], { loadProfile: false }),
390 + readWindowsEnvironment(WINDOWS_PROFILE_ENV_NAMES, { loadProfile: true }),
391 + ],
392 + { concurrency: 2 },
393 + );
394 const mergedPath = mergePaths("win32", [
395 trimNonEmpty(profile.PATH),
396 trimNonEmpty(knownWindowsCliDirs(config.env).join(";")),