Repository navigation
Conversation
Implements proper capability token exchange to enable access to all GitHub Copilot models and preview features. Previously, Zed sent OAuth tokens directly to Copilot APIs, causing GitHub to filter out preview models. Now exchanges OAuth tokens for capability tokens that include feature flags like editor_preview_features=1. Changes: - Add CapabilityToken struct with expiration tracking - Implement refresh_capability_token() with caching and auto-refresh - Update all API calls to use capability tokens instead of OAuth tokens - Add Copilot-Integration-Id: vscode-chat header - Fix GitHub Enterprise support with /api/v3/ path prefix - Clear capability tokens when OAuth token or configuration changes Fixes zed-industries#49691
dastrobu
force-pushed
the
experiment/gh-copilot-vscode-impersonation
branch
from
March 2, 2026 17:46
85705ef to
fac5bc8
Compare
This was referenced Mar 3, 2026
Closed
benbrandt
reviewed
Mar 3, 2026
benbrandt
left a comment
Member
There was a problem hiding this comment.
We can't use the vscode-chat integration id
Contributor
Author
|
@benbrandt of course you can't use vscode. That is exactly what I was mentioning over in #49586 (comment):
That is why this was opened as draft PR to show how API calls could work if there would be |
Contributor
Nope, but Ben might have missed your comment here. |
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.
Implements proper capability token exchange to enable access to all GitHub Copilot models including GPT-5.3-Codex and preview features.
Previously, Zed sent OAuth tokens directly to Copilot APIs, causing GitHub to filter out preview models. Now exchanges OAuth tokens for capability tokens that include feature flags like editor_preview_features=1.
Changes:
Closes #49691