From 59960b92f6b44d59254752683f33d9f5ad9d0a5e Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Wed, 16 Apr 2025 11:49:16 -0400 Subject: [PATCH] Add consecutive mistake count to diff error telemetry --- .changeset/fair-donuts-wash.md | 5 +++++ src/core/tools/applyDiffTool.ts | 2 +- src/services/telemetry/TelemetryService.ts | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/fair-donuts-wash.md diff --git a/.changeset/fair-donuts-wash.md b/.changeset/fair-donuts-wash.md new file mode 100644 index 00000000000..74ae66f6d75 --- /dev/null +++ b/.changeset/fair-donuts-wash.md @@ -0,0 +1,5 @@ +--- +"roo-cline": patch +--- + +Add consecutive mistake count to diff error telemetry diff --git a/src/core/tools/applyDiffTool.ts b/src/core/tools/applyDiffTool.ts index 2f68480e58d..d18adaa8d0b 100644 --- a/src/core/tools/applyDiffTool.ts +++ b/src/core/tools/applyDiffTool.ts @@ -90,7 +90,7 @@ export async function applyDiffTool( cline.consecutiveMistakeCountForApplyDiff.set(relPath, currentCount) let formattedError = "" - telemetryService.captureDiffApplicationError(cline.taskId) + telemetryService.captureDiffApplicationError(cline.taskId, currentCount) if (diffResult.failParts && diffResult.failParts.length > 0) { for (const failPart of diffResult.failParts) { diff --git a/src/services/telemetry/TelemetryService.ts b/src/services/telemetry/TelemetryService.ts index 492d3e0aded..863f78ac93a 100644 --- a/src/services/telemetry/TelemetryService.ts +++ b/src/services/telemetry/TelemetryService.ts @@ -290,9 +290,10 @@ class TelemetryService { }) } - public captureDiffApplicationError(taskId: string): void { + public captureDiffApplicationError(taskId: string, consecutiveMistakeCount: number): void { this.captureEvent(PostHogClient.EVENTS.ERRORS.DIFF_APPLICATION_ERROR, { taskId, + consecutiveMistakeCount, }) }