Merlin Chen
|
43f2e4988e
|
feat: add GitHub Copilot provider support with OAuth device flow
Implement full Copilot provider integration using GitHub's OAuth
device flow. The OAuth token is used directly as a Bearer token
(matching OpenCode's approach) — no intermediate token exchange.
Supports both github.com and GitHub Enterprise (data-residency /
self-hosted) deployments. Enterprise uses copilot-api.<domain>.
New files:
- copilot_auth.py: OAuth device flow, persistence, enterprise URL
- copilot_client.py: wraps OpenAICompatibleClient with Copilot headers
Modified:
- cli.py: oh auth copilot-login/logout with deployment type selection
- provider.py: Copilot detection + auth status with enterprise info
- runtime.py: CopilotClient routing in build_runtime()
- settings.py: resolve_api_key() returns copilot-managed sentinel
- __init__.py: export CopilotClient
- README.md: Copilot provider documentation
- spawn_utils.py, react_launcher.py, app.py: api_format forwarding
Tests: 31 copilot-specific tests (auth + client), all passing.
|
2026-04-04 23:46:26 +08:00 |
|