-
Notifications
You must be signed in to change notification settings - Fork 2.8k
feat: add toolProtocol property to PostHog tool usage telemetry #9374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Re-review complete. Previous issue has been resolved, but found one new type safety improvement.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
…arameter required - Extract toolProtocol variable once at protocol detection point (line 288) - Remove duplicate detection logic at telemetry capture point (line 434) - Make toolProtocol parameter required (not optional) in TelemetryService.captureToolUsage() - Ensures consistent protocol detection and required telemetry data
|
|
||
| public captureToolUsage(taskId: string, tool: string): void { | ||
| this.captureEvent(TelemetryEventName.TOOL_USED, { taskId, tool }) | ||
| public captureToolUsage(taskId: string, tool: string, toolProtocol: string): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The toolProtocol parameter uses string type instead of the more specific ToolProtocol type from @roo-code/types. Using the proper type would provide compile-time safety against typos or invalid values (e.g., "nativ" instead of "native"). The ToolProtocol type is already available since @roo-code/types is a dependency of this package.
| public captureToolUsage(taskId: string, tool: string, toolProtocol: string): void { | |
| public captureToolUsage(taskId: string, tool: string, toolProtocol: ToolProtocol): void { |
Fix it with Roo Code or mention @roomote and request a fix.
This PR adds a
toolProtocolproperty to the PostHog tool usage telemetry event to track whether tool calls are using native or XML protocol.Changes
TelemetryService.captureToolUsage()to accept an optionaltoolProtocolparameterpresentAssistantMessage.tsto determine and pass the tool protocol when capturing tool usageBenefits
toolProtocolparameter is optional