Skip to content

Commit 9bed1c4

Browse files
committed
addressed PR comments
1 parent 3897d4b commit 9bed1c4

7 files changed

Lines changed: 44 additions & 25 deletions

File tree

‎PRIVACY.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Roo Code respects your privacy and is committed to transparency about how we han
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.
1313
- **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+
- **Zoo Code Observability (Authenticated Subscribers Only):** If you sign in to Zoo Code and have an active subscription, Zoo Code will send LLM usage telemetry to the Zoo Code backend (zoocode.dev). This includes task ID, AI provider name, model name, token counts (input/output/cache), and estimated cost. This data is linked to your authenticated Zoo Code account. You can stop this collection at any time by signing out via the Zoo Code badge in the chat area.
1415
- **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.
1516

1617
### **How We Use Your Data (If Collected)**

‎packages/types/src/vscode-extension-host.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ export type ExtensionState = Pick<
377377
zooCodeUserEmail?: string
378378
zooCodeUserImage?: string
379379
zooCodeBaseUrl?: string
380+
deviceName?: string
380381
debug?: boolean
381382

382383
/**

‎src/core/task/Task.ts‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3158,21 +3158,22 @@ export class Task extends EventEmitter<TaskEvents> implements TaskLike {
31583158

31593159
// Zoo Code observability telemetry
31603160
import("../../services/zoo-telemetry")
3161-
.then(({ sendLlmTelemetry }) =>
3162-
sendLlmTelemetry({
3161+
.then(async ({ sendLlmTelemetry }) => {
3162+
const mode = await this.getTaskMode().catch(() => "unknown")
3163+
return sendLlmTelemetry({
31633164
taskId: this.taskId,
31643165
provider: this.apiConfiguration?.apiProvider ?? "unknown",
31653166
model: this.apiConfiguration
31663167
? (getModelId(this.apiConfiguration) ?? "unknown")
31673168
: "unknown",
3168-
mode: this.taskMode,
3169+
mode,
31693170
inputTokens: costResult.totalInputTokens,
31703171
outputTokens: costResult.totalOutputTokens,
31713172
cacheReadTokens: tokens.cacheRead ?? 0,
31723173
cacheWriteTokens: tokens.cacheWrite ?? 0,
31733174
totalCost: tokens.total ?? costResult.totalCost,
3174-
}).catch(() => {}),
3175-
)
3175+
}).catch(() => {})
3176+
})
31763177
.catch(() => {})
31773178
}
31783179
}

‎src/core/webview/ClineProvider.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2306,13 +2306,15 @@ export class ClineProvider
23062306
zooCodeUserEmail: userInfo.email,
23072307
zooCodeUserImage: userInfo.image,
23082308
zooCodeBaseUrl: getZooCodeBaseUrl(),
2309+
deviceName: os.hostname(),
23092310
}
23102311
} catch {
23112312
return {
23122313
zooCodeUserName: undefined,
23132314
zooCodeUserEmail: undefined,
23142315
zooCodeUserImage: undefined,
23152316
zooCodeBaseUrl: "https://www.zoocode.dev",
2317+
deviceName: os.hostname(),
23162318
}
23172319
}
23182320
})(),

‎src/services/zoo-code-auth.ts‎

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as vscode from "vscode"
2-
import os from "os"
32

43
import { Package } from "../shared/package"
54

@@ -200,25 +199,33 @@ export function getZooCodeBaseUrl(): string {
200199
return config.get<string>("baseUrl") || process.env.ZOO_CODE_BASE_URL || "https://www.zoocode.dev"
201200
}
202201

203-
export async function startZooCodeAuth(): Promise<void> {
204-
const baseUrl = getZooCodeBaseUrl()
205-
const deviceName = os.hostname()
206-
const editor = "VS Code"
207-
const version = Package.version
208-
209-
const callbackUri = await vscode.env.asExternalUri(vscode.Uri.parse("vscode://zoo-code.zoo-code/auth-callback"))
210-
211-
const authUrl = `${baseUrl}/dashboard/connect?device=${encodeURIComponent(deviceName)}&editor=${encodeURIComponent(editor)}&version=${encodeURIComponent(version)}&callback_uri=${encodeURIComponent(callbackUri.toString())}`
212-
213-
await vscode.env.openExternal(vscode.Uri.parse(authUrl))
214-
}
215-
216202
export async function handleAuthCallback(token: string): Promise<boolean> {
217203
if (!token || !token.startsWith("zoo_ext_")) {
218204
vscode.window.showErrorMessage("Zoo Code: Invalid authentication token received.")
219205
return false
220206
}
221207

208+
// Verify token with backend before storing
209+
const baseUrl = getZooCodeBaseUrl()
210+
try {
211+
const response = await fetch(`${baseUrl}/api/extension/auth/verify`, {
212+
headers: { Authorization: `Bearer ${token}` },
213+
signal: AbortSignal.timeout(10_000),
214+
})
215+
if (!response.ok) {
216+
vscode.window.showErrorMessage("Zoo Code: Token verification failed.")
217+
return false
218+
}
219+
const data = (await response.json()) as { valid?: boolean }
220+
if (!data.valid) {
221+
vscode.window.showErrorMessage("Zoo Code: Invalid token.")
222+
return false
223+
}
224+
} catch {
225+
vscode.window.showErrorMessage("Zoo Code: Could not verify token.")
226+
return false
227+
}
228+
222229
await setZooCodeToken(token)
223230

224231
// Check subscription status after successful auth

‎webview-ui/src/components/chat/ZooCodeAuthBadge.tsx‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,15 @@ function getInitials(name?: string, email?: string): string {
3434
}
3535

3636
export const ZooCodeAuthBadge: React.FC<ZooCodeAuthBadgeProps> = ({ className }) => {
37-
const { zooCodeIsAuthenticated, zooCodeUserName, zooCodeUserEmail, zooCodeUserImage, zooCodeBaseUrl, uriScheme } =
38-
useExtensionState()
37+
const {
38+
zooCodeIsAuthenticated,
39+
zooCodeUserName,
40+
zooCodeUserEmail,
41+
zooCodeUserImage,
42+
zooCodeBaseUrl,
43+
uriScheme,
44+
deviceName,
45+
} = useExtensionState()
3946
const [isOpen, setIsOpen] = useState(false)
4047
const [imageError, setImageError] = useState(false)
4148
const ref = useRef<HTMLDivElement>(null)
@@ -56,7 +63,7 @@ export const ZooCodeAuthBadge: React.FC<ZooCodeAuthBadgeProps> = ({ className })
5663
setImageError(false)
5764
}, [zooCodeUserImage])
5865

59-
const authUrl = getZooCodeAuthUrl(uriScheme, zooCodeBaseUrl)
66+
const authUrl = getZooCodeAuthUrl(uriScheme, zooCodeBaseUrl, deviceName)
6067

6168
const showImage = zooCodeIsAuthenticated && zooCodeUserImage && !imageError
6269
const avatarColor = getAvatarColor(zooCodeUserEmail || zooCodeUserName || "ZC")

‎webview-ui/src/oauth/urls.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ export function getRequestyAuthUrl(uriScheme?: string) {
1414

1515
const ZOO_CODE_DEFAULT_BASE_URL = "https://www.zoocode.dev"
1616

17-
export function getZooCodeAuthUrl(uriScheme?: string, baseUrl?: string) {
17+
export function getZooCodeAuthUrl(uriScheme?: string, baseUrl?: string, deviceName?: string) {
1818
const resolvedBaseUrl = baseUrl || ZOO_CODE_DEFAULT_BASE_URL
1919
const callbackUri = getCallbackUrl("auth-callback", uriScheme)
20-
const deviceName = encodeURIComponent("VS Code")
20+
const resolvedDeviceName = encodeURIComponent(deviceName || "VS Code")
2121
const editor = encodeURIComponent("VS Code")
2222
const version = Package.version
23-
return `${resolvedBaseUrl}/dashboard/connect?device=${deviceName}&editor=${editor}&version=${version}&callback_uri=${callbackUri}`
23+
return `${resolvedBaseUrl}/dashboard/connect?device=${resolvedDeviceName}&editor=${editor}&version=${version}&callback_uri=${callbackUri}`
2424
}

0 commit comments

Comments
 (0)