Skip to content

Conversation

@jeffreyhunter77
Copy link
Collaborator

Speculative requests for inline completions are only initiated once the completion is shown to the user.

Currently there is no way in chat-lib to indicate that a completion has been shown, which means no speculative requests are issued. This adds a method for indicating a completion has been shown, which in turn sends any pending speculative request.

Copilot AI review requested due to automatic review settings December 15, 2025 20:49
Copy link
Contributor

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 adds support for speculative requests in chat-lib's inline completions by introducing a mechanism to notify when a completion is shown to the user. Previously, speculative requests couldn't be initiated because chat-lib had no way to indicate when completions were displayed.

Key Changes:

  • Added inlineCompletionShown() method to IInlineCompletionsProvider interface to signal when a completion is displayed
  • Implemented the method in InlineCompletionsProvider class to trigger pending speculative requests via the cache

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/lib/node/chatLibMain.ts Added inlineCompletionShown method to interface and implementation to trigger speculative requests when completions are shown
chat-lib/test/getInlineCompletions.spec.ts Added test coverage for speculative request functionality and refactored test setup to track fetch counts

@jeffreyhunter77 jeffreyhunter77 force-pushed the jeffreyhunter77/chat-lib-speculative branch from b96a2a6 to 90bc6ba Compare December 15, 2025 21:00
@chrmarti chrmarti added this pull request to the merge queue Dec 16, 2025
@vs-code-engineering vs-code-engineering bot added this to the December / January 2026 milestone Dec 16, 2025
Merged via the queue into main with commit dd278ca Dec 16, 2025
16 checks passed
@chrmarti chrmarti deleted the jeffreyhunter77/chat-lib-speculative branch December 16, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants