Skip to content

Conversation

@andrewyuq
Copy link
Contributor

@andrewyuq andrewyuq commented Aug 15, 2025

Non-Cancellable Inline Completion with Session Persistence

These two commits implemented a non-cancellable inline completion system that preserves suggestions across display sessions:

Key Changes:

Added NonCancellable context: Wrapped getSuggestion with NonCancellable to prevent completion requests from being cancelled mid-execution

Implemented session persistence: Maintained activeTriggerSessions map to preserve suggestions from previous trigger sessions that were disposed before completion

Cross-session suggestion display: When a display session is invalidated, suggestions from activeTriggerSessions are carried forward to the next available display session via getVariants()

Asynchronous pagination: Made pagination non-blocking while ensuring suggestions are still delivered to future display sessions

Result: Inline completion suggestions are now guaranteed to be displayed even if the original display session is cancelled or disposed, ensuring users see all generated suggestions in the next available display session.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • A short description of the change has been added to the CHANGELOG if the change is customer-facing in the IDE.
  • I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a non-cancellable inline completion system with session persistence for Amazon Q CodeWhisperer. The changes ensure that completion suggestions are preserved across display sessions and delivered even if the original session is cancelled.

  • Implements non-cancellable completion requests using NonCancellable context
  • Adds session persistence through activeTriggerSessions map to preserve suggestions across invalidated sessions
  • Modifies telemetry and event handling to work with cross-session suggestion display

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
CodeWhispererTelemetryService.kt Updates telemetry logging to include trigger session ID and adds TODO for user input length
QInlineCompletionProvider.kt Main implementation of non-cancellable completion with session persistence and cross-session variant handling
QManualCall.kt (src-243+) Adds isIntelliSense() extension function for event type detection
QManualCall.kt (src-242) Adds isIntelliSense() extension function for event type detection in older IDE version

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@andrewyuq andrewyuq merged commit bc11847 into aws:main Aug 18, 2025
15 checks passed
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.

3 participants