Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Related GitHub Issue
Closes: #830
Description
PostHog's Product Analytics quota was 2.7x over its free-tier limit (2.7M/1M events in the June 6 - July 6 cycle), driven mainly by a
CODE_INDEX_ERRORretry-storm bug (309 people generating 254,786 events) and per-turnConversation Message/Tool Usedevents. Separately, a telemetry gap analysis found the consent banner treated dismissal (and the default "unset" state) as opt-in rather than a real choice.Volume reduction:
CODE_INDEX_ERROR: sliding 10-minute window, trips after 50 occurrences, independent of any other telemetry the same install sends (so unrelated events can't mask or reset a burst).Conversation Message/Tool Usedare no longer emitted per-turn/per-tool-call. Instead,Task.messageCountsandTask.toolUsageare summarized once intotoolsUsed/messageCounton theTask Completedevent, fired only when a task actually completes (single emission per task, not per attempt/feedback round).Model Cache Empty Responsethrottled to once per distinct provider+endpoint (matching the same compound cache-key identity the model cache itself uses) until a non-empty response is seen.Consent / privacy:
isTelemetryOptedIn()(packages/types) requiring an explicit"enabled"setting. Replaces the previoustelemetrySetting !== "disabled"check used in 5 places, which silently treated the default"unset"state as consent."unset"); added explicit Accept/Decline buttons. Localized across all 18 supported locales.vscode.env.onDidChangeTelemetryEnabledin addition to the existing (deprecated)telemetry.telemetryLevelcheck.TelemetryService.shutdown()is now properly awaited on deactivation, tracks in-flightcapture()/captureException()promises and drains them before flushing/closing clients, and is wrapped so a shutdown failure can't skip terminal cleanup.PRIVACY.mdclarified: the "does not collect code or prompts" telemetry bullet now notes this applies to the PostHog path only — the separate Cloud task-sync pipeline does transmit task messages when enabled.toolsUsedproperty key.Explicitly out of scope for this PR:
vscode.env.machineId— assessed and dropped; it's already a random per-install UUID, not a hostname/username-derived identifier, so hashing it would pseudonymize an already-non-identifying value while losing existing PostHog person continuity.captureExceptionpayloads, potentially movingCODE_INDEX_ERRORfrom Product Analytics to Error Tracking) — Error Tracking was only 6% over quota vs. Product Analytics' 2.7x, so it wasn't the priority; flagged for a follow-up.Test Procedure
pnpm check-typesandpnpm lintclean across all 14 packages.src, 1439 inwebview-ui, 42 in@roo-code/telemetry, 238 in@roo-code/types— all passing.Task Completedpayload aggregation, per-endpoint empty-model throttling, the banner's Accept/Decline/neutral-dismiss behavior,isTelemetryOptedIn()semantics, theonDidChangeTelemetryEnabledlistener, shutdown draining/error-handling, and the tool-name validation gate.Task Completedevent withtoolsUsed/messageCountand zeroConversation Message/Tool Usedevents.Pre-Submission Checklist
Documentation Updates
PRIVACY.mdupdated to clarify the Cloud task-sync pipeline's scope relative to PostHog telemetry.