Repository navigation
fix(telemetry): keep the agent id per machine, not per project folder - #27
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The anonymous agent id sent as
X-ZR-Agent-Idon 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, intelemetry-idunder:ZENROWS_CONFIG_HOMEif set (tests, sandboxes)%APPDATA%\zenrowson Windows$XDG_CONFIG_HOME/zenrows, else~/.config/zenrowsZENROWS_TELEMETRY=off/telemetry: "off".ZENROWS_CONFIG_HOMEat 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:The first two fail against the previous implementation.
🤖 Generated with Claude Code