Skip to content

Commit 33fe6fb

Browse files
Make Posthog telemetry the default (#7909)
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
1 parent a9e22f0 commit 33fe6fb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+100
-201
lines changed

PRIVACY.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Roo Code Privacy Policy
22

3-
**Last Updated: August 20th, 2025**
3+
**Last Updated: September 11th, 2025**
44

55
Roo Code respects your privacy and is committed to transparency about how we handle your data. Below is a simple breakdown of where key pieces of data go—and, importantly, where they don’t.
66

@@ -10,19 +10,19 @@ Roo Code respects your privacy and is committed to transparency about how we han
1010
- **Commands**: Any commands executed through Roo Code happen on your local environment. However, when you use AI-powered features, the relevant code and context from your commands may be transmitted to your chosen AI model provider (e.g., OpenAI, Anthropic, OpenRouter) to generate responses. We do not have access to or store this data, but AI providers may process it per their privacy policies.
1111
- **Prompts & AI Requests**: When you use AI-powered features, your prompts and relevant project context are sent to your chosen AI model provider (e.g., OpenAI, Anthropic, OpenRouter) to generate responses. We do not store or process this data. These AI providers have their own privacy policies and may store data per their terms of service. If you choose Roo Code Cloud as the provider (proxy mode), prompts may transit Roo Code servers only to forward them to the upstream model and are not stored.
1212
- **API Keys & Credentials**: If you enter an API key (e.g., to connect an AI model), it is stored locally on your device and never sent to us or any third party, except the provider you have chosen.
13-
- **Telemetry (Usage Data)**: We only collect feature usage and error data if you explicitly opt-in. This telemetry is powered by PostHog and helps us understand feature usage to improve Roo Code. This includes your VS Code machine ID and feature usage patterns and exception reports. We do **not** collect personally identifiable information, your code, or AI prompts.
14-
- **Marketplace Requests**: When you browse or search the Marketplace for Model Configuration Profiles (MCPs) or Custom Modes, Roo Code makes a secure API call to Roo Codes backend servers to retrieve listing information. These requests send only the query parameters (e.g., extension version, search term) necessary to fulfill the request and do not include your code, prompts, or personally identifiable information.
13+
- **Telemetry (Usage Data)**: We collect anonymous feature usage and error data to help us improve Roo Code. This telemetry is powered by PostHog and includes your VS Code machine ID, feature usage patterns, and exception reports. This telemetry does **not** collect personally identifiable information, your code, or AI prompts. You can opt out of this telemetry at any time through the settings.
14+
- **Marketplace Requests**: When you browse or search the Marketplace for Model Configuration Profiles (MCPs) or Custom Modes, Roo Code makes a secure API call to Roo Code's backend servers to retrieve listing information. These requests send only the query parameters (e.g., extension version, search term) necessary to fulfill the request and do not include your code, prompts, or personally identifiable information.
1515

1616
### **How We Use Your Data (If Collected)**
1717

18-
- If you opt-in to telemetry, we use it to understand feature usage and improve Roo Code.
18+
- We use telemetry to understand feature usage and improve Roo Code.
1919
- We do **not** sell or share your data.
2020
- We do **not** train any models on your data.
2121

2222
### **Your Choices & Control**
2323

2424
- You can run models locally to prevent data being sent to third-parties.
25-
- By default, telemetry collection is off and if you turn it on, you can opt out of telemetry at any time.
25+
- Telemetry collection is enabled by default to help us improve Roo Code, but you can opt out at any time through the settings.
2626
- You can delete Roo Code to stop all data collection.
2727

2828
### **Security & Updates**

packages/telemetry/src/TelemetryService.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ export class TelemetryService {
3636

3737
/**
3838
* Updates the telemetry state based on user preferences and VSCode settings
39-
* @param didUserOptIn Whether the user has explicitly opted into telemetry
39+
* @param isOptedIn Whether the user is opted into telemetry
4040
*/
41-
public updateTelemetryState(didUserOptIn: boolean): void {
41+
public updateTelemetryState(isOptedIn: boolean): void {
4242
if (!this.isReady) {
4343
return
4444
}
4545

46-
this.clients.forEach((client) => client.updateTelemetryState(didUserOptIn))
46+
this.clients.forEach((client) => client.updateTelemetryState(isOptedIn))
4747
}
4848

4949
/**

packages/types/src/telemetry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ export interface TelemetryClient {
242242

243243
setProvider(provider: TelemetryPropertiesProvider): void
244244
capture(options: TelemetryEvent): Promise<void>
245-
updateTelemetryState(didUserOptIn: boolean): void
245+
updateTelemetryState(isOptedIn: boolean): void
246246
isTelemetryEnabled(): boolean
247247
shutdown(): Promise<void>
248248
}

src/core/webview/webviewMessageHandler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,10 +490,10 @@ export const webviewMessageHandler = async (
490490
),
491491
)
492492

493-
// If user already opted in to telemetry, enable telemetry service
493+
// Enable telemetry by default (when unset) or when explicitly enabled
494494
provider.getStateToPostToWebview().then((state) => {
495495
const { telemetrySetting } = state
496-
const isOptedIn = telemetrySetting === "enabled"
496+
const isOptedIn = telemetrySetting !== "disabled"
497497
TelemetryService.instance.updateTelemetryState(isOptedIn)
498498
})
499499

@@ -2289,7 +2289,7 @@ export const webviewMessageHandler = async (
22892289
case "telemetrySetting": {
22902290
const telemetrySetting = message.text as TelemetrySetting
22912291
await updateGlobalState("telemetrySetting", telemetrySetting)
2292-
const isOptedIn = telemetrySetting === "enabled"
2292+
const isOptedIn = telemetrySetting !== "disabled"
22932293
TelemetryService.instance.updateTelemetryState(isOptedIn)
22942294
await provider.postStateToWebview()
22952295
break

webview-ui/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,11 @@ const App = () => {
192192
useEvent("message", onMessage)
193193

194194
useEffect(() => {
195-
if (shouldShowAnnouncement) {
195+
if (shouldShowAnnouncement && tab === "chat") {
196196
setShowAnnouncement(true)
197197
vscode.postMessage({ type: "didShowAnnouncement" })
198198
}
199-
}, [shouldShowAnnouncement])
199+
}, [shouldShowAnnouncement, tab])
200200

201201
useEffect(() => {
202202
if (didHydrateState) {

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1777,6 +1777,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
17771777
<div
17781778
data-testid="chat-view"
17791779
className={isHidden ? "hidden" : "fixed top-0 left-0 right-0 bottom-0 flex flex-col overflow-hidden"}>
1780+
{telemetrySetting === "unset" && <TelemetryBanner />}
17801781
{(showAnnouncement || showAnnouncementModal) && (
17811782
<Announcement
17821783
hideAnnouncement={() => {
@@ -1840,7 +1841,6 @@ const ChatViewComponent: React.ForwardRefRenderFunction<ChatViewRef, ChatViewPro
18401841
/>
18411842

18421843
<RooHero />
1843-
{telemetrySetting === "unset" && <TelemetryBanner />}
18441844

18451845
<div className="mb-2.5">
18461846
{cloudIsAuthenticated || taskHistory.length < 4 ? (

webview-ui/src/components/common/TelemetryBanner.tsx

Lines changed: 26 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,53 @@
11
import { memo, useState } from "react"
2-
import { VSCodeButton, VSCodeLink } from "@vscode/webview-ui-toolkit/react"
3-
import styled from "styled-components"
42
import { Trans } from "react-i18next"
3+
import { VSCodeLink } from "@vscode/webview-ui-toolkit/react"
54

65
import type { TelemetrySetting } from "@roo-code/types"
76

87
import { vscode } from "@src/utils/vscode"
98
import { useAppTranslation } from "@src/i18n/TranslationContext"
109

11-
const BannerContainer = styled.div`
12-
background-color: var(--vscode-banner-background);
13-
padding: 12px 20px;
14-
display: flex;
15-
flex-direction: column;
16-
gap: 10px;
17-
flex-shrink: 0;
18-
margin-bottom: 6px;
19-
`
20-
21-
const ButtonContainer = styled.div`
22-
display: flex;
23-
gap: 8px;
24-
width: 100%;
25-
& > vscode-button {
26-
flex: 1;
27-
}
28-
`
29-
3010
const TelemetryBanner = () => {
3111
const { t } = useAppTranslation()
32-
const [hasChosen, setHasChosen] = useState(false)
12+
const [isDismissed, setIsDismissed] = useState(false)
3313

34-
const handleAllow = () => {
35-
setHasChosen(true)
14+
const handleClose = () => {
15+
setIsDismissed(true)
3616
vscode.postMessage({ type: "telemetrySetting", text: "enabled" satisfies TelemetrySetting })
3717
}
3818

39-
const handleDeny = () => {
40-
setHasChosen(true)
41-
vscode.postMessage({ type: "telemetrySetting", text: "disabled" satisfies TelemetrySetting })
42-
}
43-
4419
const handleOpenSettings = () => {
4520
window.postMessage({
4621
type: "action",
4722
action: "settingsButtonClicked",
48-
values: { section: "about" }, // Link directly to about settings with telemetry controls
23+
values: { section: "about" },
4924
})
5025
}
5126

27+
if (isDismissed) {
28+
return null
29+
}
30+
5231
return (
53-
<BannerContainer>
32+
<div className="relative px-4 py-2.5 pr-10 bg-vscode-banner-background border-b border-vscode-panel-border text-sm leading-normal text-vscode-foreground">
33+
{/* Close button (X) */}
34+
<button
35+
onClick={handleClose}
36+
className="absolute top-1.5 right-2 bg-transparent border-none text-vscode-foreground cursor-pointer text-2xl p-1 opacity-70 hover:opacity-100 transition-opacity duration-200 leading-none"
37+
aria-label="Close">
38+
×
39+
</button>
40+
41+
<div className="mb-0.5 font-bold">{t("welcome:telemetry.helpImprove")}</div>
5442
<div>
55-
<strong>{t("welcome:telemetry.title")}</strong>
56-
<div className="mt-1">
57-
<Trans
58-
i18nKey="welcome:telemetry.anonymousTelemetry"
59-
components={{
60-
privacyLink: <VSCodeLink href="https://roocode.com/privacy" />,
61-
}}
62-
/>
63-
<div className="mt-1">
64-
<Trans
65-
i18nKey="welcome:telemetry.changeSettings"
66-
components={{
67-
settingsLink: <VSCodeLink href="#" onClick={handleOpenSettings} />,
68-
}}
69-
/>
70-
.
71-
</div>
72-
</div>
43+
<Trans
44+
i18nKey="welcome:telemetry.helpImproveMessage"
45+
components={{
46+
settingsLink: <VSCodeLink href="#" onClick={handleOpenSettings} />,
47+
}}
48+
/>
7349
</div>
74-
<ButtonContainer>
75-
<VSCodeButton appearance="primary" onClick={handleAllow} disabled={hasChosen}>
76-
{t("welcome:telemetry.allow")}
77-
</VSCodeButton>
78-
<VSCodeButton appearance="secondary" onClick={handleDeny} disabled={hasChosen}>
79-
{t("welcome:telemetry.deny")}
80-
</VSCodeButton>
81-
</ButtonContainer>
82-
</BannerContainer>
50+
</div>
8351
)
8452
}
8553

webview-ui/src/components/settings/About.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const About = ({ telemetrySetting, setTelemetrySetting, className, ...pro
4040
<Section>
4141
<div>
4242
<VSCodeCheckbox
43-
checked={telemetrySetting === "enabled"}
43+
checked={telemetrySetting !== "disabled"}
4444
onChange={(e: any) => {
4545
const checked = e.target.checked === true
4646
setTelemetrySetting(checked ? "enabled" : "disabled")

webview-ui/src/i18n/locales/ca/settings.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

webview-ui/src/i18n/locales/ca/welcome.json

Lines changed: 2 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)