-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add GitHub Copilot provider with per-user token authentication #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
## 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
…e and non-zero indices
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
ce1e93a to
8fec1c2
Compare
bf4405e to
ecd5e50
Compare
Merge activity
|
pawbana
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: storing headers in map would be more clear when checking equal 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