Skip to content

[Bug]: Windows desktop server can miss the saved telemetry opt-out #42351

Done

Description

@ErrorModeCo

Area and affected version

Windows desktop launcher and bundled server. Observed on Windows 11 Pro with T3 Code v0.1.11, upstream commit 59651c1761f6c63e9b6056839067066968e6a406. Current releases have not been tested. The investigation was conducted with Codex assistance.

What happened

During an audit, the saved Windows user variable was T3CODE_TELEMETRY_ENABLED=false. The running T3 Code processes lacked that variable. Retained server traces show two POSTs to ingest.t3.codes at 03:33:58.136865 and 03:36:48.701323 UTC on 24 November 2026, both HTTP 204. The pinned analytics source uses /batch/. The request bodies were not retained. The audited records do not establish when the saved value was written, so this observation alone does not establish that it preceded the POSTs or the original launch.

Suggested reproduction for maintainers

Use a disposable Windows VM, a fresh test profile with no provider credentials or project data, and block external egress. Use a mock analytics collector for the request assertion.

  1. Open a PowerShell window before saving the Windows user preference. Confirm the variable is absent in that process.
  2. Using Windows Environment Variables, save the user value T3CODE_TELEMETRY_ENABLED=false and record the save time. In the original window, compare [Environment]::GetEnvironmentVariable('T3CODE_TELEMETRY_ENABLED', 'User') with $env:T3CODE_TELEMETRY_ENABLED. The intended test setup has false saved and the process value absent.
  3. With all T3 processes exited, launch the native desktop executable from that original window. In a process inspector, inspect only the named variable in the launcher and actual server child. Record the launch and value. Where the test build supplies a mock collector and a synthetic startup event, record whether a product analytics event reaches it.
  4. Fully exit T3. Set $env:T3CODE_TELEMETRY_ENABLED = 'false' in the launching shell and repeat. Run a separate opt-in control against the mock to confirm it receives the synthetic event.
  5. Repeat the documented Start menu launch after a fresh sign-in. This distinguishes a stale parent from a separate issue in a fresh launch path.

These are proposed test steps. The historical audit did not execute this controlled sequence.

Expected behavior

Once the Windows user opt-out is saved, a subsequent native desktop launch should honor it before product analytics starts. The server should receive an effective disabled setting and enqueue or send no product usage events. If the persistence contract requires a new sign-in or different launch method, document that explicitly and expose the effective setting locally.

Observed behavior

The later Windows inspection found a saved opt-out and an absent runtime variable. Windows normally inherits the parent environment. The pinned Windows shell discovery reads process variables and refreshes PATH from the registry. The server's analytics config defaults to enabled when its variable is absent, subject to other gates. A stale process environment is a candidate explanation to test.

Impact and workaround

The mismatch makes it hard to confirm whether the documented opt-out is effective. For an existing install, fully exit the desktop and server, relaunch from a process with T3CODE_TELEMETRY_ENABLED=false, and verify the named variable on the server. This is the documented configuration to test, not a workaround verified on the audited Windows machine.

Proposed remediation

Resolve the supported Windows user setting before analytics initialization and pass an explicit effective value to the server. Document precedence between the launcher environment, saved setting, and managed policy, with explicit opt-out winning conflicting enable defaults. Add a regression test with a stale parent, the saved false value, and a mock collector that must receive zero events. Test restart and fresh sign-in separately. Expose the setting source in local diagnostics without logging any other environment values.

Evidence and source

Public audit with redacted evidence and methodology

Related reports

#37772 addresses desktop relay tracing checked before login shell discovery, a different signal and failure path. #1397, #4123, and #42283 concern telemetry controls or transparency. #16563 concerns shell-profile opt-out handling. None of the reviewed reports describes the specific Windows persisted-user-setting versus native server process mismatch above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions