From 0ccd6334e10cabb924e9e21e4ee61bcf0bf50486 Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Tue, 15 Jul 2025 10:35:06 -0400 Subject: [PATCH] Add telemetry for todos --- packages/types/src/telemetry.ts | 8 ++++++++ src/core/webview/ClineProvider.ts | 14 ++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/packages/types/src/telemetry.ts b/packages/types/src/telemetry.ts index c0e2830b27f..223c39484c2 100644 --- a/packages/types/src/telemetry.ts +++ b/packages/types/src/telemetry.ts @@ -89,6 +89,14 @@ export const taskPropertiesSchema = z.object({ modelId: z.string().optional(), diffStrategy: z.string().optional(), isSubtask: z.boolean().optional(), + todos: z + .object({ + total: z.number(), + completed: z.number(), + inProgress: z.number(), + pending: z.number(), + }) + .optional(), }) export const gitPropertiesSchema = z.object({ diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 8fa9ceccfa6..233bd469267 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -1853,6 +1853,19 @@ export class ClineProvider // Get git repository information const gitInfo = await getWorkspaceGitInfo() + // Calculate todo list statistics + const todoList = task?.todoList + let todos: { total: number; completed: number; inProgress: number; pending: number } | undefined + + if (todoList && todoList.length > 0) { + todos = { + total: todoList.length, + completed: todoList.filter((todo) => todo.status === "completed").length, + inProgress: todoList.filter((todo) => todo.status === "in_progress").length, + pending: todoList.filter((todo) => todo.status === "pending").length, + } + } + // Return all properties including git info - clients will filter as needed return { appName: packageJSON?.name ?? Package.name, @@ -1867,6 +1880,7 @@ export class ClineProvider diffStrategy: task?.diffStrategy?.getName(), isSubtask: task ? !!task.parentTask : undefined, cloudIsAuthenticated, + ...(todos && { todos }), ...gitInfo, } }