-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Add telemetry for slash command usage #6381
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
mrubens
left a comment
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.
@roomote-agent instead of command detection, just track if they click on an option in the slash autocomplete or the zap menu
daniel-lxs
left a comment
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.
LGTM
- Add SLASH_COMMAND_USED telemetry event type - Implement slash command detection with regex pattern matching - Classify commands as mode_switch vs custom types - Integrate telemetry capture in user input processing - Add comprehensive test coverage for detection logic and telemetry
- Remove detectSlashCommands utility and its usage from Task.ts - Add telemetry tracking to SlashCommandsList for popover clicks - Add telemetry tracking to ChatTextArea for context menu selections - Track both mode switches and custom commands with appropriate types - Delete unused slashCommandDetection.ts and its tests
451d328 to
34b00c9
Compare
Code Review SummaryI've reviewed the telemetry implementation for slash command usage tracking. The PR has 3 issues that need to be addressed: Issues Found
Required Changes
ContextThe backend
The webview's |
| if (type === ContextMenuOptionType.Mode && value) { | ||
| // Track telemetry for mode selection from context menu | ||
| telemetryClient.capture(TelemetryEventName.SLASH_COMMAND_USED, { | ||
| commandType: "mode", |
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 commandType value should be "mode_switch" not "mode" to match the type signature of TelemetryService.captureSlashCommandUsed(taskId, commandType: "custom" | "mode_switch", commandName). This mismatch will cause the telemetry data to be inconsistent with the intended classification of mode switch commands.
| telemetryClient.capture(TelemetryEventName.SLASH_COMMAND_USED, { | ||
| commandType: "mode", | ||
| commandName: value, | ||
| }) |
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 telemetry capture is missing the taskId property. According to the backend TelemetryService.captureSlashCommandUsed() signature and the telemetry schema, this event requires taskId, commandType, and commandName properties. The webview needs access to the current task ID to properly track slash command usage. Consider passing the task ID through the extension state or event context.
| telemetryClient.capture(TelemetryEventName.SLASH_COMMAND_USED, { | ||
| commandType: "custom", | ||
| commandName: value, | ||
| }) |
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.
This telemetry capture is also missing the taskId property. The TelemetryService.captureSlashCommandUsed() method requires three parameters: taskId, commandType, and commandName. Without the task ID, the telemetry data won't be properly associated with the task context.
|
I don't think this is needed |
Track usage of custom commands vs mode switch commands
Summary
This PR implements telemetry tracking for slash command usage in the Roo Code extension to help understand how users interact with slash commands.
Changes
SLASH_COMMAND_USEDevent type to track slash command usage/(?:^|\s)(\/[a-zA-Z][a-zA-Z0-9_-]*)(?=\s|$)/gm/code,/debug) and "custom" commandsTask.tsFiles Modified
packages/types/src/telemetry.ts- Added new telemetry event typepackages/telemetry/src/TelemetryService.ts- AddedcaptureSlashCommandUsed()methodsrc/core/task/Task.ts- Integrated slash command detection and telemetry capturesrc/utils/slashCommandDetection.ts- New utility for detecting and classifying slash commandsTesting
Usage Analytics
This will help track:
Important
Add telemetry tracking for slash command usage, distinguishing between custom and mode switch commands, with integration and testing across multiple files.
SLASH_COMMAND_USEDevent type intelemetry.ts.captureSlashCommandUsed()inTelemetryService.tsto log command usage.slashCommandDetection.ts.Task.tsandChatTextArea.tsx.TelemetryService.slashCommands.test.tswith 19 test cases.Task.tsto handle telemetry in user input processing.This description was created by
for 34b00c9. You can customize this summary. It will automatically update as commits are pushed.