@devries-cameron20 / t3code Mirror · read-only / commits / 78c9fcaafc
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 18:00 UTC

fix(desktop): honor the telemetry opt-out from the shell profile (#16563)

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

Julius Marminge committed Oct 6, 2026 at 13:55 UTC 78c9fcaafcbee9e2b941d8b0129a9f968373c6b2
5 files changed +14
apps/desktop/src/backend/DesktopBackendConfiguration.test.ts
+5
@@ -979,9 +979,11 @@ describe("DesktopBackendConfiguration", () => {
979
980 const previousWslEnv = process.env.WSLENV;
981 const previousDisabled = process.env.OTEL_SDK_DISABLED;
982 + const previousTelemetry = process.env.T3CODE_TELEMETRY_ENABLED;
983 try {
984 delete process.env.WSLENV;
985 process.env.OTEL_SDK_DISABLED = "true";
986 + process.env.T3CODE_TELEMETRY_ENABLED = "false";
987
988 yield* Effect.gen(function* () {
989 const configuration = yield* DesktopBackendConfiguration.DesktopBackendConfiguration;
@@ -989,6 +991,8 @@ describe("DesktopBackendConfiguration", () => {
991
992 assert.equal(config.env.OTEL_SDK_DISABLED, "true");
993 assert.include((config.env.WSLENV ?? "").split(":"), "OTEL_SDK_DISABLED");
994 + assert.equal(config.env.T3CODE_TELEMETRY_ENABLED, "false");
995 + assert.include((config.env.WSLENV ?? "").split(":"), "T3CODE_TELEMETRY_ENABLED");
996 }).pipe(
997 Effect.provide(
998 DesktopBackendConfiguration.layer.pipe(
@@ -1009,6 +1013,7 @@ describe("DesktopBackendConfiguration", () => {
1013 } finally {
1014 restoreEnv("WSLENV", previousWslEnv);
1015 restoreEnv("OTEL_SDK_DISABLED", previousDisabled);
1016 + restoreEnv("T3CODE_TELEMETRY_ENABLED", previousTelemetry);
1017 }
1018 }).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
1019 );
apps/desktop/src/backend/DesktopBackendConfiguration.ts
+1
@@ -101,6 +101,7 @@ const DESKTOP_BACKEND_ENV_NAMES = [
101 const WSL_FORWARDED_ENV_NAMES = [
102 "OPENAI_API_KEY",
103 "ANTHROPIC_API_KEY",
104 + "T3CODE_TELEMETRY_ENABLED",
105 // Otherwise the WSL server keeps exporting to endpoints from the bootstrap.
106 "T3CODE_OTEL_SDK_DISABLED",
107 "OTEL_SDK_DISABLED",
apps/desktop/src/shell/DesktopShellEnvironment.test.ts
+2
@@ -268,11 +268,13 @@ describe("DesktopShellEnvironment", () => {
268 envOutput({
269 PATH: "/home/linuxbrew/.linuxbrew/bin:/usr/bin",
270 SSH_AUTH_SOCK: "/tmp/secretive.sock",
271 + T3CODE_TELEMETRY_ENABLED: "false",
272 }),
273 });
274
275 assert.equal(env.PATH, "/home/linuxbrew/.linuxbrew/bin:/usr/bin");
276 assert.equal(env.SSH_AUTH_SOCK, "/tmp/secretive.sock");
277 + assert.equal(env.T3CODE_TELEMETRY_ENABLED, "false");
278 }),
279 );
280
apps/desktop/src/shell/DesktopShellEnvironment.ts
+3
@@ -85,6 +85,7 @@ const LOGIN_SHELL_ENV_NAMES = [
85 "XDG_SESSION_DESKTOP",
86 "XDG_SESSION_TYPE",
87 "WAYLAND_DISPLAY",
88 + "T3CODE_TELEMETRY_ENABLED",
89 ] as const;
90 const WINDOWS_PROFILE_ENV_NAMES = ["PATH", "FNM_DIR", "FNM_MULTISHELL_PATH"] as const;
91 const LOCALE_ENV_NAMES = ["LANG", "LC_ALL", "LC_CTYPE"] as const;
@@ -450,6 +451,8 @@ const installPosixEnvironment = Effect.fn("desktop.shellEnvironment.installPosix
451 "XDG_DATA_HOME",
452 "XDG_RUNTIME_DIR",
453 "WAYLAND_DISPLAY",
454 + // The telemetry opt-out is documented as a shell variable; GUI launches never see it.
455 + "T3CODE_TELEMETRY_ENABLED",
456 ] as const) {
457 if (!config.env[name] && shellEnvironment[name]) {
458 config.env[name] = shellEnvironment[name];
docs/user/telemetry.md
+3
@@ -9,3 +9,6 @@ raw provider events, or child-agent output. Child-agent token use is excluded fr
9
10 To disable collection, set `T3CODE_TELEMETRY_ENABLED=false` in the server's environment before
11 starting it. This stops product events from being recorded or sent.
12 +
13 +The desktop app reads the variable from your shell profile (for example `~/.zshrc`) on macOS and
14 +Linux, so export it there and restart the app. On Windows, set it as a user environment variable.