Skip to content

Conversation

@kiloconnect
Copy link
Contributor

@kiloconnect kiloconnect bot commented Jan 7, 2026

This PR adds an id field to the autocomplete cache entry and updates the visibility tracking to use the id instead of the prefix/suffix/suggestion triplet.

Changes:

  • Add id property to FillInAtCursorSuggestion type in types.ts
  • Update getSuggestionKey() in AutocompleteTelemetry.ts to return the id
  • Generate id when creating suggestions in processSuggestion()
  • Update updateSuggestions() to ensure suggestions have an id
  • Update tests to include id field

This provides more reliable telemetry tracking for autocomplete visibility.

- Add id property to FillInAtCursorSuggestion type
- Update getSuggestionKey() to return the id instead of prefix/suffix/text triplet
- Generate id when creating suggestions
- Update tests to include id field
@changeset-bot
Copy link

changeset-bot bot commented Jan 7, 2026

🦋 Changeset detected

Latest commit: e3cf991

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
kilo-code Patch

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

@kiloconnect
Copy link
Contributor Author

kiloconnect bot commented Jan 7, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Overview

This PR adds an id field to FillInAtCursorSuggestion for more reliable telemetry tracking. The implementation is clean and well-structured:

  • Type Safety: The id field is properly added as a required property in the interface
  • ID Generation: All code paths that create suggestions now generate UUIDs using crypto.randomUUID()
  • Backward Compatibility: The updateSuggestions method ensures existing suggestions without IDs get one assigned
  • Test Coverage: The test helper has been updated to include the new id field
Files Reviewed (5 files)
  • .changeset/fast-carrots-remember.md - Changeset for the patch
  • src/services/ghost/classic-auto-complete/AutocompleteTelemetry.ts - Updated getSuggestionKey to use id
  • src/services/ghost/classic-auto-complete/GhostInlineCompletionProvider.ts - Added id generation in all suggestion creation paths
  • src/services/ghost/classic-auto-complete/__tests__/AutocompleteTelemetry.test.ts - Updated test helper with id field
  • src/services/ghost/types.ts - Added id property to FillInAtCursorSuggestion interface

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.

1 participant