fix(telemetry): count coding agents as machines, no project id outside git

Merged
OK
2mo ago
+77-64

Telemetry merged real users into shared ids and created project ids nobody returns to. That skews retention.

  • Coding agents count as machines. Agents often set CI=1 in the shells they spawn. With no CI vendor marker, those runs all collapsed into ci:unknown. Now CI + a detected coding agent + no vendor uses the machine id (packages/e2e/src/telemetry/environment.ts). Plain CI with no vendor and no agent stays ci:unknown.
  • More CI vendors recognized: EAS Build, Bitrise, Codemagic and Xcode Cloud.
  • No project id outside git. Outside git or in a shallow clone, project_id is now null instead of a hash of the path with a per-machine salt. Those ids were the same project on one machine only, so a scratch dir looked like a project that churned.
  • The salt is still written to telemetry.json. Older versions replace the machine id when the file has no salt, and machines often have several versions installed.

Data from PostHog, last 60 days, canary builds excluded:

  • ci:unknown: about 3.5k sessions. Most came from coding agents: Claude Code 2,223 (67 projects), Codex 137, Cursor 65. 998 had no agent.
  • Projects that ran once: 1,691 of 4,899.

Verified

Ran it locally: yes

  • Packed CLI from this branch installed in /tmp, E2E_TELEMETRY_DEBUG=1 node node_modules/e2e/dist/cli/bin.js telemetry status, reading the printed payload. "main" is the published e2e@0.17.0.
envmainthis branch
non-git dir, localproject_id: 389d… (salted path)project_id: null
non-git dir, CI=1 CLAUDECODE=1distinct_id: ci:unknowndistinct_id: cd15… (machine id)
non-git dir, CI=1ci:unknownci:unknown
git repo, CI=1 EAS_BUILD=trueci:unknownci:eas, project_id: 7cd3…
git repo, CI GITHUB_ACTIONS CLAUDECODEci:github-actionsci:github-actions

The new telemetry.json still contains salt.