AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

How to Fix GitHub Copilot Completion Delays and Disconnections in VS Code

Baptiste Aulanier · 365Finds Editorial
Indexed 88,650 Wiki articles

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

Few things break a coding flow faster than typing a function signature, pausing for ghost text, and staring at an empty cursor for eight seconds. Or worse: GitHub Copilot begins streaming a completion, clips off mid-bracket, and leaves the status bar icon spinning before quietly turning orange with a connection dropout.

When GitHub Copilot slows down or disconnects in Visual Studio Code, developers often assume GitHub’s cloud is buckling or their Wi-Fi is failing. Sometimes that is true. But at 365Finds, our research into developer workflows and editor diagnostics reveals a much more nuanced reality: most persistent completion lag and random connection resets trace back to local extension host saturation, bloated workspace chat history, conflicting completion engines, or corporate proxy/TLS inspection choking persistent WebSocket tunnels.

Here is 365Finds' systematic troubleshooting roadmap to isolate the failure point and restore sub-second inline completions.


1. The 30-Second Triage: Cloud Incident or Local Breakdown?

Before you alter extension settings or purge cache files, eliminate external infrastructure as the culprit:

  1. Check GitHub Status: Visit GitHub Status and expand the GitHub Copilot service metric. If Copilot API latency is degraded or elevated error rates are reported, no local tweak will fix it. Stop debugging and wait for Microsoft’s upstream incident resolution.
  2. Observe the Status Bar Icon: Look at the Copilot status badge at the bottom right of VS Code:
    • Normal (Checkmark/Active): The extension is connected and authenticated.
    • Spinning continuously: An inline request is pending, usually stuck in local context gathering or a blocked socket.
    • Strikethrough or Warning: Authentication expired, token refresh failed, or the network handshake timed out.

If the public status is green and your badge is spinning or warning, move straight to your local editor environment.


2. Eliminate Local Extension Host Saturation

VS Code executes all extensions within a single Node.js worker thread called the Extension Host. When that thread chokes on heavy background computation, GitHub Copilot cannot calculate debounce intervals or transmit prompt payloads to the server on time.

Check the Process Explorer

Press Ctrl + Shift + P (or Cmd + Shift + P on macOS), type Process Explorer, and press Enter.

Examine the CPU and memory consumption of the extensionHost and child processes:

Stop AI Tool Hoarding

At 365Finds, we regularly see developers install two or three AI assistants simultaneously—running GitHub Copilot alongside Tabnine, Codeium, Supermaven, or local Ollama autocompletion plugins.

Running multiple inline completion providers creates aggressive race conditions. VS Code must query multiple providers simultaneously or wait for debounce timers to clear. The extensions cancel each other's in-flight promises, resulting in erratic 3- to 10-second delays. Pick one inline completion provider. Disable competing AI extensions and observe whether Copilot’s responsiveness recovers instantly.


3. Purge Bloated Workspace Storage and Chat History

If you use Copilot Chat alongside inline completions, VS Code maintains serialized JSON transcripts and session state across workspaces. Over weeks of active development, this state can balloon into dozens of megabytes, causing the Copilot extension to freeze during startup and throttle inline suggestions.

Clear Workspace Chat Sessions

  1. Open the Command Palette (Ctrl + Shift + P / Cmd + Shift + P).
  2. Type and run: Chat: Clear All Workspace Chats.
  3. Run Developer: Reload Window.

Manually Inspect Workspace Storage

If the Command Palette does not clear accumulated lag, inspect the local workspace storage folder:

Search for folders containing oversized chatEditingSessions or chatSessions JSON payloads. Deleting stale session directories resets Copilot's local memory footprint without touching your editor configurations or keybindings.


4. Run Built-In Copilot Diagnostics

Do not guess why Copilot is failing; inspect what the extension is reporting in real time.

Command Palette (Ctrl + Shift + P / Cmd + Shift + P)
│
├── Developer: Chat Diagnostics ─────────► Review Reachability and endpoint test status
│
├── Developer: Set Log Level ────────────► Select "GitHub Copilot" ──► Set to "Trace"
│
└── Output Panel (Ctrl + K, Ctrl + H) ───► Select "GitHub Copilot" dropdown

Enable Trace Logging

  1. Open the Command Palette and run Developer: Set Log Level.
  2. Choose GitHub Copilot (or GitHub Copilot Chat).
  3. Switch the level from Info to Trace.
  4. Open a source file, start typing to trigger completions, and switch to the Output tab (View: Output).
  5. In the dropdown on the right, select GitHub Copilot.

Look for explicit network error codes:

(Note: Remember to reset your log level back to Info after debugging to prevent unnecessary disk writes.)

Run Reachability Diagnostics

Run Developer: Chat Diagnostics from the Command Palette. Review the Reachability section. VS Code tests direct reachability against GitHub Copilot endpoints (including api.githubcopilot.com and copilot-proxy.githubusercontent.com). If any endpoint reports failure, your connection dropouts are originating at the network perimeter.


5. Solve Corporate Proxy, SSL/TLS, and WebSocket Dropouts

In corporate environments, network-level dropouts account for over half of all GitHub Copilot failures. Copilot relies on continuous bidirectional HTTPS and secure WebSocket (WSS) communication on TCP port 443.

The HTTPS Proxy Trap

A critical architectural quirk: GitHub Copilot uses dedicated networking code to route proxy traffic. Copilot does not support proxy URLs starting with https://. If your http.proxy setting or HTTPS_PROXY environment variable is defined as https://proxy.corp.example:8080, Copilot will fail to initialize or intermittently drop connection pools. Change the proxy protocol scheme to http://:

{
  "http.proxy": "http://proxy.corp.example:8080",
  "http.proxySupport": "override"
}

Self-Signed Certificates and Deep Packet Inspection (DPI)

If your company decrypts outgoing traffic with tools like Zscaler, Netskope, or corporate root CAs, Node.js inside VS Code will reject the connection because the intercepting certificate is not in the default Mozilla CA bundle.

To resolve custom certificate rejections cleanly:

  1. Export your corporate root and intermediate CA certificates in PEM format.
  2. Launch VS Code with the environment variable NODE_EXTRA_CA_CERTS=/path/to/corporate-ca.pem.
  3. If managing corporate certificates through VS Code directly, ensure http.systemCertificates is set to true in your settings.json.

365Finds strongly advises against setting "http.proxyStrictSSL": false as a permanent fix. While toggling strict SSL to false is useful as a 60-second test to confirm that certificate validation is the root cause, leaving it disabled disables TLS verification across your editor extensions, creating serious security vulnerabilities.

WebSocket Port 443 and Stateful Timeout Settings

Copilot streams completions and chat responses. If corporate firewalls or cloud NAT gateways have aggressive idle-connection timeouts (e.g., dropping quiet TCP connections after 30 seconds), Copilot's persistent socket drops out mid-stream. Ask your network administrator to verify:


6. Prevent Context Bloat in Massive Repositories

GitHub Copilot does not merely send your current line of code; it analyzes adjacent tabs, open files, and local workspace structure to build surrounding context. In massive codebases or monorepos, context generation itself can take 2 to 4 seconds if the editor scans unindexed build artifacts.

Add sensible file exclusions to your workspace .vscode/settings.json:

{
  "files.watcherExclude": {
    "**/.git/objects/**": true,
    "**/.git/subtree-cache/**": true,
    "**/node_modules/**": true,
    "**/dist/**": true,
    "**/build/**": true,
    "**/.next/**": true,
    "**/target/**": true,
    "**/.venv/**": true
  },
  "search.exclude": {
    "**/node_modules": true,
    "**/dist": true,
    "**/build": true
  }
}

Keeping massive dependency folders out of the editor watcher keeps the extension host unburdened and dramatically cuts down Copilot's local context extraction latency.


7. Fast Recovery Sequence

When Copilot suddenly hangs in the middle of a workday and you need to resume writing code immediately, run this exact sequence:

  1. Press Ctrl + Shift + P (or Cmd + Shift + P) and execute Developer: Reload Window. This tears down dead HTTP/2 sessions, drops stale socket pools, and reinitializes the extension host without closing your open tabs.
  2. If completion remains unresponsive, click the Accounts icon in the activity bar, sign out of your GitHub account, run Developer: Reload Window, and sign back in.
  3. If the status bar icon still flashes an orange alert, open View: Output -> GitHub Copilot to read the exact HTTP status code returned on the last socket handshake.

References