Skip to content

fix(telemetry): keep the agent id per machine, not per project folder - #27

Merged
AnderRV merged 1 commit into
mainfrom
fix/machine-stable-telemetry-id
Oct 7, 2026
Merged

AnderRV merged 1 commit into
mainfrom
fix/machine-stable-telemetry-id

Conversation

@AnderRV

@AnderRV AnderRV commented Oct 7, 2026

Copy link
Copy Markdown
Member

Why

The anonymous agent id sent as X-ZR-Agent-Id on signup was stored in .zenrows/config.json, inside the project folder. Every new folder minted a new id, so one machine looked like a new device in each project, and a retry from a machine that had already signed up (for example after a rate limit) could not be tied back to it.

Change

  • getOrCreateTelemetryId() stores the id once per machine, in telemetry-id under:
    • ZENROWS_CONFIG_HOME if set (tests, sandboxes)
    • %APPDATA%\zenrows on Windows
    • $XDG_CONFIG_HOME/zenrows, else ~/.config/zenrows
  • An id already in a workspace config is adopted as the machine id on first run, so existing installs keep their identity.
  • If the machine directory can't be written (read-only home, locked-down sandbox), it falls back to the workspace config as before.
  • Still a random UUID, still suppressed by ZENROWS_TELEMETRY=off / telemetry: "off".
  • The test bootstrap points ZENROWS_CONFIG_HOME at a temp dir so the suite never writes to the real home directory.

Verification

  • npm run typecheck: clean.

  • npm test: 276/276 pass.

  • New tests/telemetry-id.test.ts:

    • two workspaces on one machine send the same id
    • an existing workspace id is adopted
    • an unwritable machine directory falls back to the workspace

    The first two fail against the previous implementation.

🤖 Generated with Claude Code

…ooked like a new device in every folder

X-ZR-Agent-Id lived in .zenrows/config.json, so each new folder minted a
new id, and a retry from a machine that had already signed up could not be
tied back to it. Store the id per machine (ZENROWS_CONFIG_HOME,
XDG_CONFIG_HOME/zenrows, ~/.config/zenrows, or %APPDATA%\zenrows), adopt an
existing workspace id on first run, and fall back to the workspace when the
machine directory is not writable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AnderRV AnderRV self-assigned this Oct 7, 2026
@AnderRV
AnderRV merged commit b951524 into main Oct 7, 2026
2 checks passed
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