feat: add GitHub Copilot provider with per-user token authentication#137
Merged
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
ca6355f to
0b199a7
Compare
b99f59b to
7bd40c9
Compare
b0be741 to
68e00ca
Compare
9182ea4 to
6a9968e
Compare
ssncferreira
added a commit
that referenced
this pull request
Jan 23, 2026
## Description Fixes a nil pointer dereference when extracting Actor ID for trace attributes. Discovered while testing the Copilot provider implementation (implemented upstack #137), where requests may not always have an actor set in the context. ## Changes Adds `ActorIDFromContext` helper that safely returns an empty string if no actor is present, and updates the interceptors to use it.
68e00ca to
ea722ff
Compare
6a9968e to
a127009
Compare
ea722ff to
ca7e288
Compare
ca7e288 to
77dea81
Compare
3744945 to
c1d483a
Compare
b4479ce to
6de1225
Compare
f3cc0dd to
bb51264
Compare
6de1225 to
82de4d9
Compare
01ca570 to
905e2b5
Compare
82de4d9 to
d02fd35
Compare
905e2b5 to
274b1ba
Compare
d02fd35 to
9e54caf
Compare
274b1ba to
1646733
Compare
9e54caf to
e9bac3b
Compare
1646733 to
a2eb2d3
Compare
a2eb2d3 to
cad2669
Compare
efa7ba4 to
734ddda
Compare
…client timeout during tool invocation
cad2669 to
79e2524
Compare
dannykopping
approved these changes
Jan 27, 2026
matifali
reviewed
Jan 27, 2026
ce1e93a to
8fec1c2
Compare
bf4405e to
ecd5e50
Compare
pawbana
reviewed
Jan 27, 2026
pawbana
reviewed
Jan 27, 2026
Contributor
Author
Merge activity
|
pawbana
approved these changes
Jan 27, 2026
Contributor
pawbana
left a comment
There was a problem hiding this comment.
LGTM
some tests nits that can be ignored
|
|
||
| body := `{"model": "gpt-4", "messages": [{"role": "user", "content": "hello"}], "stream": false}` | ||
| req := httptest.NewRequest(http.MethodPost, routeCopilotChatCompletions, bytes.NewBufferString(body)) | ||
| req.Header.Set("Authorization", "Bearer test-token") |
Contributor
There was a problem hiding this comment.
nit: storing headers in map would be more clear when checking equal later.
ssncferreira
added a commit
to coder/coder
that referenced
this pull request
Jan 27, 2026
Adds GitHub Copilot as a supported AI provider in aibridge. Depends on: coder/aibridge#137 Closes: coder/internal#1235
SasSwart
pushed a commit
that referenced
this pull request
Jan 30, 2026
…137) ## Description Adds support for GitHub Copilot as an AI provider. Unlike other providers that use a global API key, Copilot uses per-user keys passed in the `Authorization` header. Copilot's API is OpenAI-compatible, so the provider reuses the existing OpenAI interceptors. ## Changes * Add `Copilot` provider in with support for: * `/chat/completions` endpoint * `/responses` endpoint * Passthrough routes: `/models`, `/agents/`, `/mcp/` * `InjectAuthHeader` is a no-op since Copilot uses per-user keys from the original request * Add Copilot specific tests Related to: coder/internal#1235
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
Adds support for GitHub Copilot as an AI provider. Unlike other providers that use a global API key, Copilot uses per-user keys passed in the
Authorizationheader. Copilot's API is OpenAI-compatible, so the provider reuses the existing OpenAI interceptors.Changes
Copilotprovider in with support for:/chat/completionsendpoint/responsesendpoint/models,/agents/,/mcp/InjectAuthHeaderis a no-op since Copilot uses per-user keys from the original requestRelated to: coder/internal#1235