feat: VS Code Copilot Chat proxy integration#1192
Open
damnthonyy wants to merge 1 commit into
Open
Conversation
- proxy_routes.py: read X-Original-Host header sent by the patched VS Code extension to resolve the upstream LLM endpoint, falling back to x-headroom-base-url when both headers are present - tests: cover X-Original-Host passthrough and precedence rules - docker-compose.yml: configure headroom to target api.githubcopilot.com with GITHUB_TOKEN auth; add vscode-plugin-builder service (profile: plugin) that clones damnthonyy/vscode, builds the patched Copilot Chat extension and outputs copilot-proxy.vsix to ./plugin/ - Dockerfile.vscode-plugin: new builder image (node:24-slim) for the VSIX - .gitignore: exclude ./plugin/ build output directory Usage after docker compose --profile plugin run --rm vscode-plugin-builder: code --install-extension ./plugin/copilot-proxy.vsix --force # then set in VS Code settings.json: # "github.copilot.chat.proxy.url": "http://localhost:8787/v1" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
PR governanceThis PR does not yet satisfy the required template fields:
Please update the PR body, or move the PR back to draft while it is still in progress. |
This was referenced Jun 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Enables Copilot Chat in VS Code to route LLM requests through Headroom without TLS MITM — solving the
CERTIFICATE_VERIFY_FAILEDissue that blocked Windows/WSL users (see #962).The patched VS Code Copilot Chat extension (damnthanyy/vscode) intercepts requests internally and rewrites the destination URL to headroom, forwarding the original LLM host via
X-Original-Host. This PR adds the headroom-side support for that header.User setup (3 commands after
git clone):Closes #962
Type of Change
Changes Made
headroom/providers/proxy_routes.py— reads theX-Original-Hostrequest header to resolve the upstream LLM endpoint;x-headroom-base-urltakes precedence when both are present.tests/test_provider_proxy_routes.py— two new assertions:X-Original-Hostpassthrough andx-headroom-base-urlprecedence overX-Original-Host.docker-compose.yml— addsOPENAI_TARGET_API_URL=https://api.githubcopilot.comandGITHUB_TOKENenv vars; addsvscode-plugin-builderservice (profile:plugin) that clones the patched VS Code fork, builds the extension, and outputscopilot-proxy.vsixto./plugin/.Dockerfile.vscode-plugin(new) —node:24-slimmulti-step builder: clones the fork, installs deps, runsnpx tsx .esbuild.mts+vsce package, copies the.vsixto the mounted output volume..gitignore— addsplugin/to keep the built.vsixout of version control.Testing
pytest)ruff check .)mypy headroom) — not run (no type annotations changed)Test Output
Real Behavior Proof
damnthonyy/vscode); Headroom running viadocker compose up; modelgpt-4oviaapi.githubcopilot.com(GitHub Copilot subscription).docker compose up -d(starts headroom + qdrant + neo4j)docker compose --profile plugin run --rm vscode-plugin-builder→ produces./plugin/copilot-proxy.vsixcode --install-extension ./plugin/copilot-proxy.vsix --force"github.copilot.chat.proxy.url": "http://localhost:8787/v1"to VS Codesettings.jsonheadroom-proxy-1logs showed the request arriving with correctX-Original-Host: api.githubcopilot.comheader; headroom resolved the upstream, compressed context, and forwarded to GitHub Copilot API. Response appeared normally in VS Code Copilot Chat.Review Readiness
Checklist
Additional Notes
x-headroom-base-urltakes precedence overX-Original-Hostso existing integrations that already setx-headroom-base-urlare unaffected.pluginDocker Compose profile is opt-in; normaldocker compose upis unchanged.