Skip to content

Conversation

@markijbema
Copy link
Contributor

Summary

This PR adds telemetry tracking for inline assist (autocomplete) suggestions to measure acceptance and rejection rates.

Changes

  • Added tracking for INLINE_ASSIST_ACCEPT_SUGGESTION event when users accept inline code suggestions
  • Added tracking for INLINE_ASSIST_REJECT_SUGGESTION event when:
    • No suggestion is available (empty LLM response)
    • A suggestion times out after 10 seconds without being accepted
  • Protected all telemetry calls with TelemetryService.hasInstance() checks for backward compatibility

Implementation Details

The implementation tracks user interactions with inline suggestions:

  1. Acceptance: Registered a VSCode command that fires when suggestions are accepted
  2. Rejection: Tracks both immediate rejection (no suggestion) and timeout-based rejection (10s)

Testing

  • Added comprehensive test suite in GhostInlineCompletionProvider.telemetry.spec.ts
  • All 4 new telemetry tests pass ✅
  • All 63 existing tests continue to pass ✅
  • Total: 111 tests passing

Impact

This telemetry will provide valuable metrics on:

  • Suggestion acceptance rates
  • User engagement with inline assist
  • Quality of generated suggestions

…rejection

- Track INLINE_ASSIST_ACCEPT_SUGGESTION when users accept suggestions
- Track INLINE_ASSIST_REJECT_SUGGESTION when suggestions are rejected or timeout
- Add comprehensive test coverage for telemetry events
- Ensure backward compatibility with TelemetryService.hasInstance() checks
@changeset-bot
Copy link

changeset-bot bot commented Nov 20, 2025

⚠️ No Changeset found

Latest commit: 9f0fb1d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@markijbema markijbema marked this pull request as draft November 20, 2025 15:21
- Remove separate 334-line telemetry test file
- Add telemetry tests to existing GhostInlineCompletionProvider.test.ts
- Reuse existing mocks instead of duplicating them
- Reduces PR size significantly while maintaining test coverage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants