JetBrains IDEs - Add Autocomplete Acceptance Telemetry - #4582
Conversation
🦋 Changeset detectedLatest commit: 7caa96e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
✅ No Issues Found
16 files reviewed | Confidence: 92% | Recommendation: Merge
Review Details
Key Files Reviewed:
KiloCodeInlineCompletionInsertHandler.kt(new) - Custom insert handler for telemetryKiloCodeInlineCompletionProvider.kt- Integration of insert handlerGhostServiceManager.ts- Removal of JetBrains conditional for telemetry
Other Files: Formatting/style changes only (trailing commas, whitespace normalization)
Checked:
- ✅ Security: No vulnerabilities found
- ✅ Bug detection: Logic is sound, error handling is appropriate
- ✅ Performance: Fire-and-forget telemetry pattern is correct
- ✅ Architecture: RPC-based telemetry flow is well-designed
Architecture Notes:
- JetBrains plugin now triggers telemetry via RPC command
kilocode.ghost.inline-completion.accepted - VSCode extension always creates
AutocompleteTelemetry(conditional removed) - Command ID is consistent between Kotlin and TypeScript implementations
- Error handling properly isolates telemetry failures from user experience
markijbema
left a comment
There was a problem hiding this comment.
Sweet, that's really clean
There was a problem hiding this comment.
✅ No New Issues
This is an incremental review following the previous bot review. The changes since the last review (commit 3de2547 → 4ee5f0c) appear to be minor and the core implementation remains sound.
| Files Reviewed | Confidence |
|---|---|
| 8 files | 90% |
Review Details
Key Implementation:
KiloCodeInlineCompletionInsertHandler.ktcorrectly extendsDefaultInlineCompletionInsertHandlerand triggers telemetry via RPC- Command ID
kilocode.ghost.inline-completion.acceptedmatches the registered command inGhostInlineCompletionProvider.ts GhostServiceManager.tschange ensuresAutocompleteTelemetryis always instantiated (previouslynullfor JetBrains)
Verified:
- ✅ Command ID consistency between Kotlin and TypeScript
- ✅ Error handling isolates telemetry failures from user experience
- ✅ Fire-and-forget pattern is appropriate for telemetry
- ✅ RPC proxy retrieval follows established patterns in the codebase
Other Changes: Formatting only (trailing commas, whitespace normalization in build.gradle.kts)
There was a problem hiding this comment.
✅ No New Issues
Changes since last review (4ee5f0c → 7caa96e) are a clean refactor moving the command constant to InlineCompletionConstants.kt.
| Files Reviewed | Confidence |
|---|---|
| 3 files | 95% |
Review Details
Latest Commit: Refactored command ID to shared constants file
Verified:
- ✅ Command ID
kilocode.ghost.inline-completion.acceptedmatches TypeScript constant inGhostInlineCompletionProvider.ts:137 - ✅ No functional changes in latest commit
- ✅ Error handling properly isolates telemetry failures
- ✅ RPC-based telemetry flow is well-designed
… display state in the command_list (resolves Kilo-Org#4582) (Kilo-Org#4810) Co-authored-by: GitHub Action <action@github.com> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com> Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
… display state in the command_list (resolves Kilo-Org#4582) (Kilo-Org#4810)
… display state in the command_list (resolves Kilo-Org#4582) (Kilo-Org#4810) Co-authored-by: GitHub Action <action@github.com> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com> Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
Context
The JetBrains plugin's autocomplete service was successfully generating and displaying AI-powered code suggestions using the VSCode extension's Ghost service via RPC. However, we had no visibility into whether users were actually accepting these suggestions. While all other telemetry events (suggestion requests, LLM completions, cache hits) were being captured, the critical
AUTOCOMPLETE_ACCEPT_SUGGESTIONevent was never triggered when JetBrains users accepted completions.This missing telemetry prevented us from:
Implementation
Architecture
The solution leverages IntelliJ Platform's
InlineCompletionInsertHandlerAPI, which provides anafterInsertion()callback that's invoked when users accept inline completions. This mirrors the VSCode implementation pattern whereInlineCompletionItemhas acommandproperty that executes automatically on acceptance.Key Components
1. Custom Insert Handler (
KiloCodeInlineCompletionInsertHandler.kt)DefaultInlineCompletionInsertHandlerfrom IntelliJ PlatformafterInsertion()to trigger telemetry via RPCINLINE_COMPLETION_ACCEPTED_COMMANDasynchronously2. Provider Integration (
KiloCodeInlineCompletionProvider.kt)insertHandlerproperty override to use custom handlerProgram Flow
Screenshots
How to Test
Prerequisites
Test Steps
Enable Debug Logging (optional)
#ai.kilocode.jetbrains.inline.KiloCodeInlineCompletionInsertHandlerTrigger Autocomplete
Accept Suggestion
TaborEnterto accept the suggestionVerify Telemetry
Verify Debug Logs (if enabled)
Expected Results