feat: add PostHog telemetry to CLI with privacy controls & UX stabilisation#32
Conversation
Add withStreamGuards wrapper that detects provider rate limits, token exhaustion, and idle timeouts (5min) with automatic error yielding. Integrate guards into all test session stream loops (web, desktop, native) and surface error chunks as thrown errors. Enhance HTML report findings with "Why this matters" context based on severity and category, and generate fix prompts with reproduction steps. Improve streaming UI with rotating activity messages, elapsed timer, chunk counter, and better empty/connecting states. Add clickable file:// links to HTML reports in CLI output across all test flows. Expand finding cards in terminal views to show full descriptions, URLs, and step sequences.
Integrate PostHog for anonymous telemetry to track test starts, completions, and errors across web, desktop, and native platforms. Add telemetry toggle to settings UI with clear privacy messaging that no URLs, code, or file paths are collected. Load environment variables during build for API key injection. Update tests to reflect new telemetry configuration field.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
🤖 Augment PR SummarySummary: Adds anonymous PostHog telemetry to the GetWired CLI with opt-out controls, plus several UX and stability improvements. Changes:
Technical Notes: Telemetry is disabled via config, 🤖 Was this summary useful? React with 👍 or 👎 |
| process.stderr.write( | ||
| "\n" + | ||
| " ℹ GetWired collects anonymous usage analytics to improve the product.\n" + | ||
| " No private data, URLs, code, file paths, or error details are ever sent.\n" + |
There was a problem hiding this comment.
The first-run notice says “No … URLs … or error details are ever sent”, but captureTestErrored() does send a scrubbed error field and stripPii() doesn’t remove URLs. Consider aligning the notice text with the actual payload to avoid over-promising on privacy guarantees.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
|
|
||
| function stripPii(text: string): string { | ||
| return text | ||
| .replace(HOME_RE, "~") |
There was a problem hiding this comment.
stripPii() replaces the home directory with ~ before path scrubbing, which can leave ~/… / ~\… paths intact (and PATH_RE won’t match single-segment paths like /tmp). That means local path fragments could still end up in the cli_test_errored telemetry payload.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| /max.?tokens/i, | ||
| /capacity/i, | ||
| /overloaded/i, | ||
| /429/, |
There was a problem hiding this comment.
RATE_LIMIT_PATTERNS includes /429/, which can match incidental output (e.g., a random number) and incorrectly trigger a rate-limit error. Tightening this match to a more specific “HTTP 429”/status-code pattern would reduce false positives.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
| isTimedOut: () => boolean, | ||
| ): AsyncGenerator<T> { | ||
| while (true) { | ||
| if (isTimedOut()) return; |
There was a problem hiding this comment.
raceTimeout() returns on timeout without closing/canceling the underlying gen, and the losing gen.next() from Promise.race() can remain pending. This may leave provider streams/subprocesses running after a timeout and could cause resource leaks or hangs in long-running sessions.
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Summary
Adds anonymous usage analytics to the CLI via
posthog-node, with full privacy controls and opt-out support. Also includes prior UX stabilisation work on this branch.Telemetry Implementation
Events captured
cli_test_startedprovider,persona,platform,deviceProfile,cliVersioncli_test_completeddurationMs,findingsCount,passed,failed,warningscli_test_erroredprovider,persona,platform,error(scrubbed),cliVersionPrivacy & security
$process_person_profile: false)~/.getwired/telemetry.jsonwritten with0o600(owner-only)Opt-out (3 ways)
.getwired/config.json)"telemetry": falsein.getwired/config.jsonGETWIRED_TELEMETRY=0orDO_NOT_TRACK=1Build-time env injection
packages/cli/.env(gitignored)envoption — not hardcoded in source.env.examplecommitted as a template for contributorsOther changes
0.0.20update.test.tsthat hardcoded version0.0.19— now uses99.0.0so it's version-agnosticFiles changed
packages/cli/src/telemetry.ts— new telemetry modulepackages/cli/src/orchestrator/index.ts— capture events on test start/complete/errorpackages/cli/src/config/settings.ts—telemetryboolean onGetwiredSettingspackages/cli/src/components/App.tsx— telemetry toggle in dashboard settingspackages/cli/tsup.config.ts— load.envfor build-time injectionpackages/cli/.env.example— template for PostHog credentialspackages/cli/tests/unit/update.test.ts— fix version-dependent testpackages/cli/tests/unit/security-payloads.test.ts— addtelemetryto mock settingsPull Request opened by Augment Code with guidance from the PR author