Skip to content

Commit 9fc8339

Browse files
committed
docs(desktop): stop claiming WSLENV cannot carry URLs now that the OTLP URLs rely on it
Signed-off-by: Yordis Prieto <[email protected]>
1 parent 6a66a8c commit 9fc8339

2 files changed

Lines changed: 11 additions & 16 deletions

File tree

‎apps/desktop/src/backend/DesktopBackendConfiguration.test.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -780,12 +780,11 @@ describe("DesktopBackendConfiguration", () => {
780780
const config = yield* configuration.resolveWsl({ port: 5050, distro: null });
781781

782782
// No settings.json exists here: the endpoints come from the desktop
783-
// process's env, which a WSL child cannot inherit, so the bootstrap
784-
// has to carry them or log export stays off inside the distro.
783+
// environment, and the bootstrap carries them for a WSL child that
784+
// lacks the variables.
785785
assert.equal(config.bootstrap.otlpTracesUrl, "http://127.0.0.1:4318/v1/traces");
786786
assert.equal(config.bootstrap.otlpMetricsUrl, "http://127.0.0.1:4318/v1/metrics");
787787
assert.equal(config.bootstrap.otlpLogsUrl, "http://127.0.0.1:4318/v1/logs");
788-
assert.notInclude(config.env.WSLENV ?? "", "T3CODE_OTLP_LOGS_URL");
789788
}).pipe(
790789
Effect.provide(
791790
DesktopBackendConfiguration.layer.pipe(

‎apps/desktop/src/backend/DesktopBackendConfiguration.ts‎

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,8 @@ const DESKTOP_BACKEND_ENV_NAMES = [
9090
] as const;
9191

9292
// Env vars that the WSL backend needs but Windows process.env won't forward
93-
// across the wsl.exe boundary without WSLENV. The dev-server URL is handled
94-
// separately via a `--dev-url` CLI flag because WSLENV translation of
95-
// URL-shaped values (colons / slashes) is unreliable.
93+
// across the wsl.exe boundary without WSLENV. The dev-server URL travels as
94+
// the `--dev-url` CLI flag instead.
9695
const WSL_FORWARDED_ENV_NAMES = [
9796
"OPENAI_API_KEY",
9897
"ANTHROPIC_API_KEY",
@@ -239,12 +238,11 @@ const readPersistedBackendObservabilitySettings = Effect.gen(function* () {
239238
};
240239
});
241240

242-
// The bootstrap is the only channel that carries an OTLP endpoint to every
243-
// backend. A Windows-native child inherits the desktop process's env, but a
244-
// WSL child gets nothing across wsl.exe that WSLENV does not declare, and
245-
// WSLENV translation of URL-shaped values is unreliable, so the endpoints are
246-
// deliberately not forwarded that way. Env beats the persisted settings file,
247-
// matching the precedence resolveServerConfig and DesktopObservability apply.
241+
// The bootstrap carries the OTLP endpoints to every backend, including a WSL
242+
// child that lacks the variables. The T3 URLs also travel as variables in
243+
// WSL_FORWARDED_ENV_NAMES so they outrank a forwarded OTEL endpoint. Env beats
244+
// the persisted settings file, matching the precedence resolveServerConfig and
245+
// DesktopObservability apply.
248246
const readBackendObservabilitySettings = Effect.gen(function* () {
249247
const environment = yield* DesktopEnvironment.DesktopEnvironment;
250248
const persisted = yield* readPersistedBackendObservabilitySettings;
@@ -760,10 +758,8 @@ const resolveWslStartConfig = Effect.fn("desktop.backendConfiguration.resolveWsl
760758
};
761759

762760
// Forward the dev-server URL as an explicit CLI flag so the WSL backend's
763-
// config resolution lands in dev/ instead of userdata/. Inheriting through
764-
// WSLENV is unreliable in practice (URL-shaped values with colons /
765-
// slashes get translated unpredictably depending on flags), and the
766-
// packaged build leaves devServerUrl as None anyway.
761+
// config resolution lands in dev/ instead of userdata/. The packaged build
762+
// leaves devServerUrl as None.
767763
const devUrlArgs = Option.match(environment.devServerUrl, {
768764
onNone: () => [] as ReadonlyArray<string>,
769765
onSome: (url) => ["--dev-url", url.href],

0 commit comments

Comments
 (0)