TypeScript
perf(server): skip Windows probes for desktop-prepared environments (#19966)
Julius Marmingeeef0e4e1f96d
diff --git a/apps/desktop/src/backend/DesktopBackendConfiguration.test.ts b/apps/desktop/src/backend/DesktopBackendConfiguration.test.tsindex 090f6e0edf5..717e4a53bdd 100644--- a/apps/desktop/src/backend/DesktopBackendConfiguration.test.ts+++ b/apps/desktop/src/backend/DesktopBackendConfiguration.test.ts@@ -15,6 +15,7 @@ import { ChildProcessSpawner } from "effect/process";import * as DesktopEnvironment from "../app/DesktopEnvironment.ts";import * as DesktopBackendConfiguration from "./DesktopBackendConfiguration.ts";+import * as DesktopShellEnvironment from "../shell/DesktopShellEnvironment.ts";import * as DesktopConfig from "../app/DesktopConfig.ts";import * as DesktopServerExposure from "./DesktopServerExposure.ts";import * as DesktopAppSettings from "../settings/DesktopAppSettings.ts";@@ -37,6 +38,14 @@ const isDesktopBackendObservabilitySettingsReadError = Schema.is(DesktopBackendConfiguration.DesktopBackendObservabilitySettingsReadError,);+const layerShellEnvironment = (prepared = true) =>+ Layer.succeed(DesktopShellEnvironment.DesktopShellEnvironment, {+ installIntoProcess: Effect.succeed(prepared),+ });++const layerBackendConfiguration = (prepared = true) =>+ DesktopBackendConfiguration.layer.pipe(Layer.provide(layerShellEnvironment(prepared)));+const layerServerExposure = Layer.succeed(DesktopServerExposure.DesktopServerExposure, {getState: Effect.die("unexpected getState"),backendConfig: Effect.succeed({@@ -114,6 +123,7 @@ const withHarness = <A, E, R>(| FileSystem.FileSystem| DesktopBackendConfiguration.DesktopBackendConfiguration>,+ prepared = true,) =>Effect.gen(function* () {const fileSystem = yield* FileSystem.FileSystem;@@ -123,7 +133,7 @@ const withHarness = <A, E, R>(return yield* effect.pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration(prepared).pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest()),Layer.provideMerge(DesktopWslEnvironment.layerTest()),@@ -201,7 +211,7 @@ const withPackagedWslHarness = <A, E, R>(return yield* effect(context).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest()),Layer.provideMerge(layerServerTree),@@ -293,7 +303,7 @@ describe("DesktopBackendConfiguration", () => {return yield* configuration.resolvePrimary;}).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest()),Layer.provideMerge(DesktopWslEnvironment.layerTest()),@@ -340,6 +350,17 @@ describe("DesktopBackendConfiguration", () => {),);+ it.effect("keeps server hydration enabled when desktop preparation failed", () =>+ withHarness(+ Effect.gen(function* () {+ const configuration = yield* DesktopBackendConfiguration.DesktopBackendConfiguration;+ const primary = yield* configuration.resolvePrimary;+ assert.equal(primary.bootstrap.shellEnvironmentPrepared, false);+ }),+ false,+ ),+ );+it.effect("resolveWsl reuses the primary's bootstrap token", () =>withHarness(Effect.gen(function* () {@@ -370,7 +391,7 @@ describe("DesktopBackendConfiguration", () => {return yield* configuration.resolveWsl({ port: 5000, distro: null });}).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest()),Layer.provideMerge(DesktopWslServerTree.layerTest()),@@ -692,7 +713,7 @@ describe("DesktopBackendConfiguration", () => {return yield* configuration.resolveWsl({ port: 5000, distro: "Ubuntu" });}).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest()),Layer.provideMerge(DesktopWslServerTree.layerTest()),@@ -820,7 +841,7 @@ describe("DesktopBackendConfiguration", () => {assert.equal(config.bootstrap.otlpLogsUrl, "http://127.0.0.1:4318/v1/logs");}).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest()),Layer.provideMerge(DesktopWslServerTree.layerTest()),@@ -878,7 +899,7 @@ describe("DesktopBackendConfiguration", () => {assert.equal(config.bootstrap.otlpMetricsUrl, "http://persisted:4318/v1/metrics");}).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest()),Layer.provideMerge(DesktopWslServerTree.layerTest()),@@ -923,7 +944,7 @@ describe("DesktopBackendConfiguration", () => {}).pipe(Effect.provide(Layer.mergeAll(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest()),Layer.provideMerge(DesktopWslServerTree.layerTest()),@@ -968,7 +989,7 @@ describe("DesktopBackendConfiguration", () => {assert.notInclude(config.args, "--require");}).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest()),Layer.provideMerge(DesktopWslServerTree.layerTest()),@@ -1010,7 +1031,7 @@ describe("DesktopBackendConfiguration", () => {assert.include((config.env.WSLENV ?? "").split(":"), "T3CODE_TELEMETRY_ENABLED");}).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest()),Layer.provideMerge(DesktopWslServerTree.layerTest()),@@ -1077,7 +1098,7 @@ describe("DesktopBackendConfiguration", () => {assert.include(wslEnv, "T3CODE_OTLP_TRACES_URL");}).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest()),Layer.provideMerge(DesktopWslServerTree.layerTest()),@@ -1151,7 +1172,7 @@ describe("DesktopBackendConfiguration", () => {);}).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest()),Layer.provideMerge(DesktopWslServerTree.layerTest()),@@ -1199,7 +1220,7 @@ describe("DesktopBackendConfiguration", () => {assert.isTrue(Option.isNone(config.preflightFailure));}).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest({@@ -1236,7 +1257,7 @@ describe("DesktopBackendConfiguration", () => {assert.include(failure.reason, "Removed-Distro");}).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest({@@ -1277,7 +1298,7 @@ describe("DesktopBackendConfiguration", () => {assert.include(failure.reason, "timed out");}).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest()),Layer.provideMerge(DesktopWslServerTree.layerTest()),@@ -1312,7 +1333,7 @@ describe("DesktopBackendConfiguration", () => {assert.include(failure.reason, "missing server entry");}).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest()),Layer.provideMerge(DesktopWslServerTree.layerTest()),@@ -1346,7 +1367,7 @@ describe("DesktopBackendConfiguration", () => {assert.include(failure.reason, "could not be extracted");}).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest()),Layer.provideMerge(@@ -1387,7 +1408,7 @@ describe("DesktopBackendConfiguration", () => {assert.include(failure.reason, "Removed-Distro");}).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest()),Layer.provideMerge(DesktopWslServerTree.layerTest()),@@ -1417,7 +1438,7 @@ describe("DesktopBackendConfiguration", () => {assert.equal(label, "WSL (Ubuntu)");}).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest({@@ -1466,7 +1487,7 @@ describe("DesktopBackendConfiguration", () => {assert.equal(config.bootstrap.desktopTelemetryControlFd, 5);}).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest()),Layer.provideMerge(DesktopWslServerTree.layerTest()),@@ -1512,7 +1533,7 @@ describe("DesktopBackendConfiguration", () => {assert.equal(config.bootstrap.resourceMonitorPath, releaseMonitorPath);}).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest()),Layer.provideMerge(DesktopWslServerTree.layerTest()),@@ -1556,7 +1577,7 @@ describe("DesktopBackendConfiguration", () => {assert.equal(label, "Windows");}).pipe(Effect.provide(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest({@@ -1585,7 +1606,7 @@ describe("DesktopBackendConfiguration", () => {// top-level runSync, exactly as the handler does.// oxlint-disable-next-line t3code/no-manual-effect-runtime-in-tests -- This test intentionally replicates the sync IPC handler's runSync path to catch a regression to async-only resolution; it.effect would mask it.const runtime = ManagedRuntime.make(- DesktopBackendConfiguration.layer.pipe(+ layerBackendConfiguration().pipe(Layer.provideMerge(layerServerExposure),Layer.provideMerge(DesktopAppSettings.layerTest()),Layer.provideMerge(DesktopWslServerTree.layerTest()),diff --git a/apps/desktop/src/backend/DesktopBackendConfiguration.ts b/apps/desktop/src/backend/DesktopBackendConfiguration.tsindex b306975beb2..9dcd72263d3 100644--- a/apps/desktop/src/backend/DesktopBackendConfiguration.ts+++ b/apps/desktop/src/backend/DesktopBackendConfiguration.ts@@ -20,6 +20,7 @@ import * as DesktopBackendManager from "./DesktopBackendManager.ts";import * as DesktopCliShim from "../app/DesktopCliShim.ts";import * as DesktopEnvironment from "../app/DesktopEnvironment.ts";import * as DesktopServerExposure from "./DesktopServerExposure.ts";+import * as DesktopShellEnvironment from "../shell/DesktopShellEnvironment.ts";import * as DesktopAppSettings from "../settings/DesktopAppSettings.ts";import * as DesktopWslEnvironment from "../wsl/DesktopWslEnvironment.ts";import * as DesktopWslServerTree from "../wsl/DesktopWslServerTree.ts";@@ -549,6 +550,7 @@ const resolvePrimaryStartConfig = Effect.fn("desktop.backendConfiguration.resolvinput: SharedBootstrapInput & {readonly resourceMonitorPath: Option.Option<string>;readonly cliPath: Option.Option<string>;+ readonly shellEnvironmentPrepared: boolean;},): Effect.fn.Return<DesktopBackendManager.DesktopBackendStartConfig,@@ -567,10 +569,8 @@ const resolvePrimaryStartConfig = Effect.fn("desktop.backendConfiguration.resolvhost: backendExposure.bindHost,desktopBootstrapToken: input.bootstrapToken,desktopBootstrapSecret: input.bootstrapSecret,- // DesktopApp installs the shell environment into process.env before any- // backend starts, and this child extends it (extendEnv below). WSL gets- // a different environment, so its bootstrap never sets this.- shellEnvironmentPrepared: true,+ // Failed Windows probes leave server hydration enabled for another attempt.+ shellEnvironmentPrepared: input.shellEnvironmentPrepared,tailscaleServeEnabled: backendExposure.tailscaleServeEnabled,tailscaleServePort: backendExposure.tailscaleServePort,desktopTelemetryFd: 4,@@ -842,6 +842,7 @@ const resolveWslStartConfig = Effect.fn("desktop.backendConfiguration.resolveWsl/** @public Service construction is part of the canonical Effect module API. */export const make = Effect.gen(function* () {const environment = yield* DesktopEnvironment.DesktopEnvironment;+ const shellEnvironment = yield* DesktopShellEnvironment.DesktopShellEnvironment;const fileSystem = yield* FileSystem.FileSystem;const serverExposure = yield* DesktopServerExposure.DesktopServerExposure;const wslEnvironment = yield* DesktopWslEnvironment.DesktopWslEnvironment;@@ -924,7 +925,13 @@ export const make = Effect.gen(function* () {Effect.provideService(FileSystem.FileSystem, fileSystem),Effect.provideService(DesktopEnvironment.DesktopEnvironment, environment),);- return yield* resolvePrimaryStartConfig({ ...shared, resourceMonitorPath, cliPath }).pipe(+ const shellEnvironmentPrepared = yield* shellEnvironment.installIntoProcess;+ return yield* resolvePrimaryStartConfig({+ ...shared,+ resourceMonitorPath,+ cliPath,+ shellEnvironmentPrepared,+ }).pipe(Effect.provideService(DesktopEnvironment.DesktopEnvironment, environment),Effect.provideService(DesktopServerExposure.DesktopServerExposure, serverExposure),);diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.tsindex ef00c4d66ed..fd34e8d3469 100644--- a/apps/desktop/src/main.ts+++ b/apps/desktop/src/main.ts@@ -195,6 +195,7 @@ const layerDesktopAppActivation = DesktopAppActivation.layer.pipe(const layerDesktopBackend = DesktopBackendPool.layer.pipe(Layer.provideMerge(DesktopAppIdentity.layer),Layer.provideMerge(DesktopBackendConfiguration.layer),+ Layer.provideMerge(DesktopShellEnvironment.layer),Layer.provideMerge(DesktopWslEnvironment.layer),Layer.provideMerge(DesktopWslServerTree.layer),Layer.provideMerge(DesktopTelemetryPublisher.layer),@@ -219,7 +220,6 @@ const layerDesktopApplication = Layer.mergeAll(DesktopApplicationMenu.layer,DesktopLinuxUrlHandler.layer,DesktopCliCommand.layer,- DesktopShellEnvironment.layer,layerDesktopSsh,).pipe(Layer.provideMerge(layerDesktopSnapShot),diff --git a/apps/desktop/src/shell/DesktopShellEnvironment.test.ts b/apps/desktop/src/shell/DesktopShellEnvironment.test.tsindex 8f77089e72c..aee5a0bc81b 100644--- a/apps/desktop/src/shell/DesktopShellEnvironment.test.ts+++ b/apps/desktop/src/shell/DesktopShellEnvironment.test.ts@@ -98,7 +98,9 @@ function runShellEnvironment(input: {const program = Effect.gen(function* () {const shellEnvironment = yield* DesktopShellEnvironment.DesktopShellEnvironment;- yield* shellEnvironment.installIntoProcess;+ const prepared = yield* shellEnvironment.installIntoProcess;+ assert.equal(yield* shellEnvironment.installIntoProcess, prepared);+ return prepared;}).pipe(Effect.provide(DesktopShellEnvironment.layer.pipe(@@ -446,7 +448,7 @@ describe("DesktopShellEnvironment", () => {USERPROFILE: "C:\\Users\\testuser",};- yield* runShellEnvironment({+ const prepared = yield* runShellEnvironment({env,platform: "win32",handler: (command) => {@@ -462,6 +464,7 @@ describe("DesktopShellEnvironment", () => {},});+ assert.isTrue(prepared);assert.equal(env.PATH,[@@ -486,6 +489,30 @@ describe("DesktopShellEnvironment", () => {}),);+ it.effect.each([false, true])(+ "leaves Windows preparation incomplete when loadProfile=%s fails",+ (loadProfile) =>+ Effect.gen(function* () {+ const env: NodeJS.ProcessEnv = { PATH: "C:\\Windows\\System32" };+ let calls = 0;+ const prepared = yield* runShellEnvironment({+ env,+ platform: "win32",+ handler: (command) => {+ calls++;+ if (command._tag !== "StandardCommand") return "";+ return !command.args.includes("-NoProfile") === loadProfile+ ? { output: "", exitCode: 1 }+ : envOutput({ PATH: "C:\\Working" });+ },+ }).pipe(Effect.provide(Logger.layer([])));+ assert.isFalse(prepared);+ assert.equal(calls, 3);+ assert.include(env.PATH, "C:\\Working");+ assert.include(env.PATH, "C:\\Windows\\System32");+ }),+ );+it.effect("replaces a Path-spelled Windows PATH instead of adding a second key", () =>Effect.gen(function* () {const env: NodeJS.ProcessEnv = { Path: "C:\\Windows\\System32" };diff --git a/apps/desktop/src/shell/DesktopShellEnvironment.ts b/apps/desktop/src/shell/DesktopShellEnvironment.tsindex 39651a7e5b9..fe58aa87f0c 100644--- a/apps/desktop/src/shell/DesktopShellEnvironment.ts+++ b/apps/desktop/src/shell/DesktopShellEnvironment.ts@@ -64,7 +64,8 @@ export class DesktopShellEnvironmentCommandTimeoutError extends Schema.TaggedErrexport class DesktopShellEnvironment extends Context.Service<DesktopShellEnvironment,{- readonly installIntoProcess: Effect.Effect<void>;+ // Reuses the installation result; false leaves server hydration enabled.+ readonly installIntoProcess: Effect.Effect<boolean>;}>()("@t3tools/desktop/shell/DesktopShellEnvironment") {}@@ -365,7 +366,7 @@ const readWindowsEnvironment = Effect.fn("desktop.shellEnvironment.readWindowsEnconst installWindowsEnvironment = Effect.fn("desktop.shellEnvironment.installWindowsEnvironment")(function* (config: ShellEnvironmentConfig,- ): Effect.fn.Return<void, never, ChildProcessSpawner.ChildProcessSpawner> {+ ): Effect.fn.Return<boolean, never, ChildProcessSpawner.ChildProcessSpawner> {// Concurrent, not sequential: these two probes are independent (only their// results are combined below) and each spawns its own PowerShell. Run in// series they sit at offset 0 of desktop.startup, before anything else, and@@ -394,6 +395,7 @@ const installWindowsEnvironment = Effect.fn("desktop.shellEnvironment.installWinif (!config.env.FNM_MULTISHELL_PATH && profile.FNM_MULTISHELL_PATH) {config.env.FNM_MULTISHELL_PATH = profile.FNM_MULTISHELL_PATH;}+ return Boolean(noProfile.PATH && profile.PATH);},);@@ -514,14 +516,18 @@ const installPosixEnvironment = Effect.fn("desktop.shellEnvironment.installPosixconst installShellEnvironment = (config: ShellEnvironmentConfig,-): Effect.Effect<void, never, ChildProcessSpawner.ChildProcessSpawner | FileSystem.FileSystem> => {+): Effect.Effect<+ boolean,+ never,+ ChildProcessSpawner.ChildProcessSpawner | FileSystem.FileSystem+> => {if (config.platform === "win32") {return installWindowsEnvironment(config);}if (config.platform === "darwin" || config.platform === "linux") {- return installPosixEnvironment(config);+ return installPosixEnvironment(config).pipe(Effect.as(true));}- return Effect.void;+ return Effect.succeed(false);};/** @public Service construction is part of the canonical Effect module API. */@@ -530,13 +536,15 @@ export const make = Effect.gen(function* () {const fileSystem = yield* FileSystem.FileSystem;const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;const installIntoProcess: DesktopShellEnvironment["Service"]["installIntoProcess"] =- installShellEnvironment({- env: process.env,- platform: environment.platform,- }).pipe(- Effect.provideService(FileSystem.FileSystem, fileSystem),- Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),- Effect.withSpan("desktop.shellEnvironment.installIntoProcess"),+ yield* Effect.cached(+ installShellEnvironment({+ env: process.env,+ platform: environment.platform,+ }).pipe(+ Effect.provideService(FileSystem.FileSystem, fileSystem),+ Effect.provideService(ChildProcessSpawner.ChildProcessSpawner, spawner),+ Effect.withSpan("desktop.shellEnvironment.installIntoProcess"),+ ),);return DesktopShellEnvironment.of({ installIntoProcess });diff --git a/apps/server/src/os-jank.test.ts b/apps/server/src/os-jank.test.tsindex c06ef9eab6d..0051747e219 100644--- a/apps/server/src/os-jank.test.ts+++ b/apps/server/src/os-jank.test.ts@@ -130,15 +130,17 @@ effectIt.effect("keeps mise's PATH record with the login shell PATH", () =>),);-effectIt.effect("repairs Windows PATH even when the desktop marks it prepared", () =>+effectIt.effect("keeps the prepared Windows PATH without probing", () =>Effect.gen(function* () {- const env: NodeJS.ProcessEnv = { PATH: "C:\\Windows" };+ const env: NodeJS.ProcessEnv = { PATH: "C:\\Prepared\\Bin;C:\\Windows" };const commands: string[] = [];yield* fixPath({ shellEnvironmentPrepared: true }).pipe(Effect.provideService(HostProcess.Platform, "win32"),Effect.provideService(HostProcess.Environment, env),- Effect.provideService(WindowsShellEnvironment, () => ({ PATH: "C:\\Tools" })),+ Effect.provideService(WindowsShellEnvironment, () => {+ throw new Error("The prepared environment must not launch another shell");+ }),Effect.provideService(CommandAvailability, (command) =>Effect.sync(() => {commands.push(command);@@ -148,8 +150,8 @@ effectIt.effect("repairs Windows PATH even when the desktop marks it prepared",Effect.provide(NodeServices.layer),);- assert.deepEqual(commands, ["node"]);- assert.equal(env.PATH, "C:\\Tools;C:\\Windows");+ assert.deepEqual(commands, []);+ assert.equal(env.PATH, "C:\\Prepared\\Bin;C:\\Windows");}),);diff --git a/apps/server/src/os-jank.ts b/apps/server/src/os-jank.tsindex deeefae367b..b6d0d5a7ad7 100644--- a/apps/server/src/os-jank.ts+++ b/apps/server/src/os-jank.ts@@ -63,6 +63,9 @@ export const fixPath = Effect.fn("fixPath")(function* (options?: {const env = yield* HostProcess.Environment;if (platform === "win32") {+ // The desktop already ran both PowerShell probes into the env this child+ // extends. Repeating them here costs seconds of startup on Windows.+ if (options?.shellEnvironmentPrepared === true) return;const repairedEnvironment = yield* resolveWindowsEnvironment(env).pipe(Effect.catchDefect((defect) =>Effect.sync(() => {