github / github/copilot-cli

BYOK support for GitHub Copilot CLI in ACP server mode

Đang mở
#4,037 0 bình luận 3 reaction 0 người được giao Xem trên GitHub
area:authentication area:models
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

### Describe the feature or problem you'd like to solve

Provide the opportunity to use your own LLM models in GitHub Copilot CLI in ACP server mode

### Proposed solution

At JetBrains, we're integrating the Copilot agent into our IDEs via the ACP (Agent Client Protocol). Currently, when Copilot CLI is run in ACP mode, GitHub login is the only supported authentication method:
```
"authMethods": [
{
"id": "copilot-login",
"name": "Log in with Copilot CLI",
"description": "Run `copilot login` in the terminal",
"_meta": {
"terminal-auth": {
"command": "/opt/homebrew/Caskroom/copilot-cli/1.0.63/copilot",
"args": [
"login"
],
"label": "Copilot Login"
}
}
}
]
```
Copilot CLI does support [BYOK](https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/use-byok-models) when run normally from the terminal, using env vars like:
```
export COPILOT_PROVIDER_BASE_URL=https://api.openai.com/v1
export COPILOT_PROVIDER_API_KEY=YOUR-OPENAI-API-KEY
export COPILOT_MODEL=YOUR-MODEL-NAME
```
However, this doesn't appear to work in ACP mode.
Without GitHub login, with the BYOK env vars set, session/new fails:
```
{
"code": -32000,
"message": "Authentication required"
}
```
With GitHub login, session/new succeeds, but the BYOK env vars are ignored — the session reports Copilot's default model instead of the configured one:
```
"currentModelId": "gpt-5.4"
```
So as it stands, there's no way to use BYOK through ACP: it's either blocked by the auth requirement, or silently overridden once authenticated.

Could you either:
* Add a BYOK-based auth method to the ACP authMethods list (e.g. an entry that validates/uses COPILOT_PROVIDER_BASE_URL, COPILOT_PROVIDER_API_KEY, and COPILOT_MODEL instead of requiring copilot login), or
* Skip the GitHub-login requirement in ACP mode when valid BYOK env vars are present, and ensure the session actually honors the configured provider/model.

This would let ACP clients (like our IDE integration) offer BYOK as a first-class option, matching what's already possible via the CLI directly.
Happy to share our test script or logs if that's useful for reproducing this on your end.

### Example prompts or workflows

- **Anthropic subscription** — Customer has a paid Anthropic subscription and wants to use Copilot in the IDE with BYOK, using their existing Claude API access instead of paying for a separate Copilot seat.
- **Local model** — Customer has a local model (e.g. via Ollama, LM Studio, or self-hosted) and wants to use Copilot in the IDE with the model's local address set, for privacy, offline work, or avoiding API costs.
- **Corporate OpenAI-compatible model** — Customer has a corporate OpenAI-compatible model (e.g. an internal Azure OpenAI or self-hosted gateway) and wants to use Copilot in the IDE with BYOK and a special model/base URL set, to meet compliance or data-residency requirements.

### Additional context

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start by reproducing the ACP session/new flow with COPILOT_PROVIDER_BASE_URL, COPILOT_PROVIDER_API_KEY, and COPILOT_MODEL set, then inspect how authMethods and the reported currentModelId are produced. Done means ACP accepts valid BYOK credentials without requiring GitHub login and uses the configured provider and model.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
github, shell
Lĩnh vực
authentication, cli
Loại issue
Tính năng
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
45/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.