Skip to content

fix: disable telemetry for non-interactive/CI runs unless opted in#209

Draft
bukinoshita wants to merge 3 commits into
mainfrom
fix/disable-ci-telemetry-d5c7
Draft

fix: disable telemetry for non-interactive/CI runs unless opted in#209
bukinoshita wants to merge 3 commits into
mainfrom
fix/disable-ci-telemetry-d5c7

Conversation

@bukinoshita
Copy link
Copy Markdown
Member

@bukinoshita bukinoshita commented Apr 9, 2026

Summary by cubic

Disable CLI telemetry in non-interactive and CI runs by default, unless RESEND_TELEMETRY_OPT_IN=1 is set. Interactive runs keep the existing behavior with the first-run notice. Addresses Linear BU-620.

  • Bug Fixes

    • Add early return in trackCommand when session is non-interactive and not opted in.
    • Treat CI, piped/non-TTY, and --json runs as non-interactive.
    • Add tests covering opt-in gating; adjust existing tests to set RESEND_TELEMETRY_OPT_IN=1.
  • Migration

    • Telemetry in CI/automation is now off by default. Set RESEND_TELEMETRY_OPT_IN=1 to enable.
    • No change for interactive users; DO_NOT_TRACK and RESEND_TELEMETRY_DISABLED still work.

Written for commit 744d93b. Summary will update on new commits.

In non-interactive sessions (CI, piped, no TTY), telemetry was silently
sent to PostHog without any notice or consent. This posed a privacy and
compliance risk for organizations running the CLI in automation.

Now, when the session is non-interactive, trackCommand returns early
unless RESEND_TELEMETRY_OPT_IN=1 is explicitly set. Interactive sessions
continue to send telemetry as before (with the existing first-run notice).

Closes BU-620

Co-authored-by: Bu Kinoshita <bukinoshita@users.noreply.github.com>
@bukinoshita
Copy link
Copy Markdown
Member Author

@cubic-dev-ai can you review?

@cubic-dev-ai
Copy link
Copy Markdown
Contributor

cubic-dev-ai Bot commented Apr 9, 2026

@cubic-dev-ai can you review?

@bukinoshita I have started the AI code review. It will take a few minutes to complete.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

@bukinoshita
Copy link
Copy Markdown
Member Author

@cursor fix conflicts

@cursor
Copy link
Copy Markdown

cursor Bot commented Apr 13, 2026

The PR description was edited by cubic (automated summary). The conflicts are now resolved and pushed. The PR should be conflict-free.

Resolved the merge conflicts in tests/lib/telemetry.test.ts. The conflict was between:

  • Our branch: Added 4 new opt-in gating tests using test()
  • Main branch: Migrated all test() calls to it() and added a new symlink protection test

I kept both sets of changes, updating our new tests to use it() to match the upstream convention. All 792 tests pass, lint and typecheck are clean.

Open in Web Open in Cursor 

Merge upstream changes (test() -> it() migration, symlink protection in
temp file writing) with opt-in telemetry gating tests.

Co-authored-by: Bu Kinoshita <bukinoshita@users.noreply.github.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.

2 participants