Skip to content

Commit 5f19ea4

Browse files
authored
Add telemetry for prompt enhancement (#2651)
1 parent 31fd6e1 commit 5f19ea4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/core/webview/webviewMessageHandler.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,10 @@ export const webviewMessageHandler = async (provider: ClineProvider, message: We
10201020
),
10211021
)
10221022

1023+
// Capture telemetry for prompt enhancement
1024+
const currentCline = provider.getCurrentCline()
1025+
telemetryService.capturePromptEnhanced(currentCline?.taskId)
1026+
10231027
await provider.postMessageToWebview({
10241028
type: "enhancedPrompt",
10251029
text: enhancedPrompt,

src/services/telemetry/TelemetryService.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class PostHogClient {
2828
CHECKPOINT_RESTORED: "Checkpoint Restored",
2929
CHECKPOINT_DIFFED: "Checkpoint Diffed",
3030
CODE_ACTION_USED: "Code Action Used",
31+
PROMPT_ENHANCED: "Prompt Enhanced",
3132
},
3233
ERRORS: {
3334
SCHEMA_VALIDATION_ERROR: "Schema Validation Error",
@@ -275,6 +276,12 @@ class TelemetryService {
275276
})
276277
}
277278

279+
public capturePromptEnhanced(taskId?: string): void {
280+
this.captureEvent(PostHogClient.EVENTS.TASK.PROMPT_ENHANCED, {
281+
...(taskId && { taskId }),
282+
})
283+
}
284+
278285
public captureSchemaValidationError({ schemaName, error }: { schemaName: string; error: ZodError }): void {
279286
this.captureEvent(PostHogClient.EVENTS.ERRORS.SCHEMA_VALIDATION_ERROR, {
280287
schemaName,

0 commit comments

Comments
 (0)