Add telemetry for consecutive mistake error (#2649)

This commit is contained in:
Matt Rubens 2025-04-15 10:17:17 -04:00 committed by GitHub
parent 84c574c947
commit afbf174e19
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View file

@ -1758,6 +1758,9 @@ export class Cline extends EventEmitter<ClineEvents> {
...formatResponse.imageBlocks(images),
],
)
// Track consecutive mistake errors in telemetry
telemetryService.captureConsecutiveMistakeError(this.taskId)
}
this.consecutiveMistakeCount = 0
}

View file

@ -31,6 +31,7 @@ class PostHogClient {
ERRORS: {
SCHEMA_VALIDATION_ERROR: "Schema Validation Error",
DIFF_APPLICATION_ERROR: "Diff Application Error",
CONSECUTIVE_MISTAKE_ERROR: "Consecutive Mistake Error",
},
}
@ -281,6 +282,12 @@ class TelemetryService {
})
}
public captureConsecutiveMistakeError(taskId: string): void {
this.captureEvent(PostHogClient.EVENTS.ERRORS.CONSECUTIVE_MISTAKE_ERROR, {
taskId,
})
}
/**
* Checks if telemetry is currently enabled
* @returns Whether telemetry is enabled