文件历史

提交图

3 次代码提交

作者 SHA1 备注 提交日期
tjb-tech 9b7051825f fix(ci): remove unused copilot imports 2026-04-05 04:36:25 +00:00
Merlin Chen 03e8f0884d fix: use Copilot-compatible model instead of Anthropic default for copilot api_format 2026-04-05 00:06:03 +08:00
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