Skip to content

fix(telemetry): honor the onboarding opt-out in the live emit() path#230

Open
rylinjames wants to merge 1 commit into
mainfrom
fix/telemetry-optout-gating
Open

fix(telemetry): honor the onboarding opt-out in the live emit() path#230
rylinjames wants to merge 1 commit into
mainfrom
fix/telemetry-optout-gating

Conversation

@rylinjames

Copy link
Copy Markdown
Collaborator

Audit §3.11 / Part 1 #19 (Python side).

Problem

The only live telemetry emitter (pro/license.load_licensetelemetry.emit) checked only TETHER_NO_TELEMETRY. The onboarding "Enable anonymous telemetry?" answer and tether config set telemetry off write an onboarding telemetry_enabled flag honored only by emit_free — which is dead code (zero call sites). So a user who explicitly answered "no" kept emitting.

Fix

  • emit() now also checks _is_telemetry_enabled_by_onboarding() — opting out via the first-run prompt / tether config set telemetry off actually stops the heartbeat.
  • _is_telemetry_enabled_by_onboarding() now honors TETHER_HOME (it hardcoded ~/.tether, disagreeing with the free-tier cache which already respects it).
  • README "no telemetry by default" was misleading → corrected: the free CLI sends none; Pro sends an opt-out daily heartbeat (disable via TETHER_NO_TELEMETRY=1 or tether config set telemetry off).

Tests

New emit-honors-onboarding-opt-out + opt-in cases. Added an autouse fixture isolating TETHER_HOME so the emit tests are hermetic regardless of the developer's real ~/.tether/onboarding.json (a latent flakiness this gate would otherwise expose). 16 pass, ruff clean.

Worker-side telemetry items (the reflex_version field-drift rejection, IP storage in the contribution worker) are infra changes tracked separately.

🤖 Generated with Claude Code

Audit §3.11 / Part 1 #19 (Python side).

The only live telemetry emitter (pro/license.load_license → telemetry.emit)
checked only TETHER_NO_TELEMETRY. The onboarding "Enable anonymous telemetry?"
answer and `tether config set telemetry off` write an onboarding
telemetry_enabled flag that was honored ONLY by emit_free — which is dead code
(zero call sites). So a user who explicitly answered "no" kept emitting.

- emit() now also checks _is_telemetry_enabled_by_onboarding(); opting out via
  the first-run prompt / config actually stops the heartbeat.
- _is_telemetry_enabled_by_onboarding() now honors TETHER_HOME (it hardcoded
  ~/.tether, disagreeing with the free-tier cache which already respects it).
- README "no telemetry by default" was misleading: corrected to state the free
  CLI sends none and Pro sends an opt-out daily heartbeat (disable via
  TETHER_NO_TELEMETRY=1 or `tether config set telemetry off`).

Tests: new emit-honors-onboarding-opt-out + opt-in cases; added an autouse
fixture isolating TETHER_HOME so the emit tests are hermetic regardless of the
developer's real ~/.tether/onboarding.json (latent flakiness this gate would
otherwise expose). 16 pass; ruff clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant