Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

Add Copilot Completions - #1493

Merged
Alexandru Dima (alexdima) merged 1 commit into
mainfrom
copilot/completions
Oct 22, 2025
Merged

Alexandru Dima (alexdima) merged 1 commit into
mainfrom
copilot/completions

Conversation

@benibenj

@benibenj Benjamin Christopher Simmonds (benibenj) commented Oct 22, 2025 •

Copy link
Copy Markdown
Collaborator

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings October 22, 2025 08:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 Copilot Completions functionality to the extension by implementing a comprehensive completions system with prompt factory architecture, context management, and integration with OpenAI/Copilot services.

Key changes:

  • Implements prompt factories for building completion prompts with workspace context and cascading allocation
  • Adds networking infrastructure for communication with Copilot/OpenAI services
  • Implements streaming completion processing with SSE support
  • Adds language detection, file system utilities, and logging infrastructure

Reviewed Changes

Copilot reviewed 116 out of 275 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
workspaceContextPromptFactory.ts Factory for building prompts with workspace context using virtual components
componentsCompletionsPromptFactory.tsx Main declarative prompt factory with JSX-based prompt construction and context resolution
completionsPromptFactory.ts Core factory interfaces and sequential/timeout handling wrappers
completionsPromptFactory.test.tsx Comprehensive test suite for prompt factory functionality
cascadingPromptFactory.ts Base class for cascading prompt allocation across components
asyncUtils.ts Utilities for handling async operations with cancellation
stream.ts SSE processor for streaming OpenAI/Copilot API responses
stream.test.ts Test suite for SSE stream processing
openai.ts OpenAI API integration with choice handling
model.ts Model management and selection logic
fetch.ts HTTP fetching infrastructure for OpenAI endpoints
fetch.test.ts Tests for fetch and error handling
fetch.fake.ts Test utilities for mocking fetch operations
config.ts Configuration for engine/model selection
config.test.ts Tests for configuration handling
progress.ts Status reporting infrastructure
postInsertion.ts Post-insertion tracking and telemetry
notificationSender.ts User notification abstraction
networkingTypes.ts Networking type definitions
networking.ts Core networking fetcher abstraction
networkConfiguration.ts Network endpoint configuration
logger.ts Logging infrastructure with telemetry integration
localFileSystem.ts Local file system implementation
languages.ts Language definitions and template handling
languageDetection.ts Language detection from file extensions/names
languageDetection.test.ts Tests for language detection
generatedLanguages.ts Generated language metadata from linguist
generatedLanguages.test.ts Tests for generated languages
inlineCompletion.ts Inline completion orchestration
radix.ts LRU radix trie data structure
radix.test.ts Tests for radix trie
iterableHelpers.ts Async iterable utility functions
speculativeRequestCache.ts Cache for speculative completion requests
telemetryNames.ts Telemetry constant definitions
logging/util.ts Logging utility functions
telemetryLogSender.ts Telemetry log sender implementation

Comment thread src/extension/completions-core/vscode-node/lib/src/postInsertion.ts
@alexdima
Alexandru Dima (alexdima) added this pull request to the merge queue Oct 22, 2025
Merged via the queue into main with commit d46ac0e Oct 22, 2025
22 checks passed
@alexdima
Alexandru Dima (alexdima) deleted the copilot/completions branch October 22, 2025 09:40
Benjamin Christopher Simmonds (benibenj) pushed a commit that referenced this pull request Oct 22, 2025
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
github-merge-queue Bot pushed a commit that referenced this pull request Oct 22, 2025
* Hello Copilot (#1493)

Co-authored-by: kieferrm <4674940+kieferrm@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

* Fix applyPatch-tool emitting incorrect edits

Started to use applyPatch in stests (`joh/slow-meerkat`) which resulted in corrected files because of bogous edits. The culprit is that the applyPatch-tool computes multiple text edits and then dispatches them to the stream via individual calls. The semantics of that is that  call `N` knows new offsets after applying edits from the `N-1` call. Tho, the calls aren't made like that by the tool. Instead, it should dispatch its edit in a single call

* fix windows tests

---------

Co-authored-by: Benjamin Christopher Simmonds <44439583+benibenj@users.noreply.github.com>
Co-authored-by: kieferrm <4674940+kieferrm@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@vjaykrsna

Copy link
Copy Markdown

I am glad that you guys did this. I hope open sourcing it will bring greater improvement in less time.
Excited for it ❤️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open Source Copilot Completions

5 participants