Skip to content

Speed up first copilot mode calls by pre-warming session#2598

Merged
hillary-mutisya merged 1 commit into
microsoft:mainfrom
hillary-mutisya:selfhost7
Jul 4, 2026
Merged

Speed up first copilot mode calls by pre-warming session#2598
hillary-mutisya merged 1 commit into
microsoft:mainfrom
hillary-mutisya:selfhost7

Conversation

@hillary-mutisya

Copy link
Copy Markdown
Collaborator

This pull request introduces several enhancements to the Copilot integration, focusing on improved connection options, diagnostics, and performance. The main updates include support for connecting to an external Copilot CLI server (eliminating local CLI startup latency), detailed timing diagnostics for requests, and pre-warming of the Copilot client and session to reduce initial request latency. There are also related configuration and API changes to enable these features.

Copilot CLI Connection Enhancements:

  • Added support for connecting to an already-running Copilot CLI server via cliUrl, as an alternative to spawning a local CLI process. This is configurable via the new cliUrl option in both code and config files, and is mutually exclusive with cliPath. [1] [2] [3] [4] [5] [6] [7] [8]

Performance and Diagnostics:

  • Introduced detailed timing diagnostics for Copilot client operations (startup, session creation, request handling, etc.), with logging controlled via debug namespaces and environment variables. This includes breakdowns of model time versus SDK/session overhead and logs of the final prompt sent to the model. [1] [2] [3] [4] [5] [6] [7] [8]

Pre-warming and Startup Optimization:

  • Added logic to pre-warm the Copilot client and session at host startup when Copilot is the active provider, significantly reducing latency for the first user-visible request. This is triggered automatically from runtime configuration setup. [1] [2] [3] [4]

API and Configuration Changes:

  • Updated the Copilot API settings and related types to include the new cliUrl option, and exported new pre-warming functions from the main API surface.

Configuration Handling:

  • Updated configuration parsing and sample files to support the new cliUrl option, ensuring it can be set via environment variables or YAML config. [1] [2] [3] [4]

These changes collectively improve Copilot performance, flexibility, and observability, especially in environments where process startup latency is a concern.

@hillary-mutisya hillary-mutisya enabled auto-merge July 4, 2026 07:11
@hillary-mutisya hillary-mutisya added this pull request to the merge queue Jul 4, 2026
Merged via the queue into microsoft:main with commit 15ef5aa Jul 4, 2026
14 of 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.

1 participant