Browse Source

feat: add toolProtocol property to PostHog tool usage telemetry (#9374)

Co-authored-by: Roo Code <[email protected]>
Co-authored-by: Matt Rubens <[email protected]>
Co-authored-by: daniel-lxs <[email protected]>
roomote[bot] 1 month ago
parent
commit
7c079453dc

+ 2 - 2
packages/telemetry/src/TelemetryService.ts

@@ -98,8 +98,8 @@ export class TelemetryService {
 		this.captureEvent(TelemetryEventName.MODE_SWITCH, { taskId, newMode })
 	}
 
-	public captureToolUsage(taskId: string, tool: string): void {
-		this.captureEvent(TelemetryEventName.TOOL_USED, { taskId, tool })
+	public captureToolUsage(taskId: string, tool: string, toolProtocol: string): void {
+		this.captureEvent(TelemetryEventName.TOOL_USED, { taskId, tool, toolProtocol })
 	}
 
 	public captureCheckpointCreated(taskId: string): void {

+ 1 - 1
src/core/assistant-message/presentAssistantMessage.ts

@@ -437,7 +437,7 @@ export async function presentAssistantMessage(cline: Task) {
 
 			if (!block.partial) {
 				cline.recordToolUsage(block.name)
-				TelemetryService.instance.captureToolUsage(cline.taskId, block.name)
+				TelemetryService.instance.captureToolUsage(cline.taskId, block.name, toolProtocol)
 			}
 
 			// Validate tool use before execution.