Skip to content

Conversation

@ssncferreira
Copy link
Contributor

@ssncferreira ssncferreira commented Jan 21, 2026

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

Closes: coder/internal#1235

Copy link
Contributor Author

ssncferreira commented Jan 21, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ssncferreira ssncferreira force-pushed the ssncferreira/feat-copilot-provider branch 2 times, most recently from ca6355f to 0b199a7 Compare January 22, 2026 10:47
@ssncferreira ssncferreira force-pushed the ssncferreira/fix-actor-nil branch from b99f59b to 7bd40c9 Compare January 22, 2026 10:47
@ssncferreira ssncferreira force-pushed the ssncferreira/feat-copilot-provider branch 2 times, most recently from b0be741 to 68e00ca Compare January 23, 2026 15:51
@ssncferreira ssncferreira force-pushed the ssncferreira/fix-actor-nil branch from 9182ea4 to 6a9968e Compare January 23, 2026 15:51
@ssncferreira ssncferreira changed the base branch from ssncferreira/fix-actor-nil to graphite-base/137 January 23, 2026 15:54
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.
@ssncferreira ssncferreira force-pushed the ssncferreira/feat-copilot-provider branch from 68e00ca to ea722ff Compare January 23, 2026 16:00
@graphite-app graphite-app bot changed the base branch from graphite-base/137 to main January 23, 2026 16:00
@ssncferreira ssncferreira force-pushed the ssncferreira/feat-copilot-provider branch from ea722ff to ca7e288 Compare January 23, 2026 16:00
@ssncferreira ssncferreira changed the base branch from main to graphite-base/137 January 23, 2026 18:14
@ssncferreira ssncferreira force-pushed the ssncferreira/feat-copilot-provider branch from ca7e288 to 77dea81 Compare January 23, 2026 18:14
@ssncferreira ssncferreira changed the base branch from graphite-base/137 to ssncferreira/fix-chatcompletions-streaming-toolcall January 23, 2026 18:14
@ssncferreira ssncferreira force-pushed the ssncferreira/feat-copilot-provider branch from 77dea81 to 3744945 Compare January 23, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

aibridge: add Copilot provider

1 participant