Skip to content

v0.53.2 — Headroom proxy integration for Copilot Chat

Choose a tag to compare

@damnthonyy damnthonyy released this 20 Jun 10:56
· 14 commits to main since this release
9066f5c

Overview

This release patches the GitHub Copilot Chat VS Code extension to route all LLM requests through Headroom, a context-compression proxy, without requiring TLS interception or any OS-level certificate installation.

It is a drop-in replacement for the official GitHub.copilot-chat marketplace extension.


What's new in v0.53.2

Core: proxy interception layer

All requests to GitHub Copilot LLM endpoints (api.githubcopilot.com and variants) are transparently rewritten to target the Headroom proxy. The original destination is preserved via X-Original-Host and X-Original-Url headers so Headroom knows where to forward after compression.

Before:  POST https://api.githubcopilot.com/v1/chat/completions
After:   POST http://localhost:8787/v1/chat/completions
           X-Original-Host: api.githubcopilot.com
           X-Original-Url:  https://api.githubcopilot.com/v1/chat/completions

Interception covers both request paths inside the extension:

  • Direct fetch path — BYOK / custom endpoints via networking.ts
  • CAPI path — standard Copilot chat completions via ProxyInterceptingFetcherService in capiClient.ts

New VS Code setting: github.copilot.chat.proxy.url

Previously, the only way to configure the proxy was via the COPILOT_PROXY_URL environment variable, which only works when VS Code is launched from a terminal where that variable is exported.

The new VS Code setting persists independently of how VS Code is launched:

Launch method COPILOT_PROXY_URL env var github.copilot.chat.proxy.url setting
Terminal (./scripts/code.sh)
Dock / Start Menu / Spotlight
Remote-WSL / after reboot

Improved WSL host IP detection (scripts/install-wsl.sh)

The install script now uses a 4-level fallback strategy to reliably detect the Windows host IP in any WSL2 networking configuration:

  1. Mirrored networking mode — detected via .wslconfig, uses 127.0.0.1 directly
  2. ip route default gateway — reliable in standard NAT mode
  3. /etc/resolv.conf — filtered to exclude loopback addresses (127.x) set by systemd-resolved
  4. /etc/resolv.conf unfiltered — last resort

Installation

Requirements

  • VS Code 1.125.0 or later
  • Headroom running on your machine or network

Step 1 — Download and install the extension

Download copilot-proxy.vsix from the assets below, then:

code --install-extension copilot-proxy.vsix --force

Windows / WSL users: use the automated install script instead:

git clone https://github.com/damnthonyy/vscode
cd vscode
bash scripts/install-wsl.sh

Step 2 — Configure VS Code

Open Ctrl/Cmd+Shift+POpen User Settings (JSON) and add:

"github.copilot.chat.proxy.url": "http://localhost:8787/v1",
"extensions.autoUpdate": "off"

Replace localhost with your Headroom host IP if running remotely.
extensions.autoUpdate: false prevents VS Code from overwriting the patched extension with the marketplace version.

Step 3 — Start Headroom and test

headroom proxy --port 8787

Open Copilot Chat in VS Code and send a message. Headroom should receive the request and compress the context before forwarding to GitHub Copilot.


Compatibility

Version
Base extension github.copilot-chat@0.53.0
VS Code engine ^1.125.0
Headroom Compatible with X-Original-Host header support (see PR #1192)