github / github/copilot-cli

Enterprise authentication not supported by ACP server

未關閉
#3,161 1 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
area:authentication area:enterprise area:non-interactive
主要語言
Shell
星號
11.2k
分支
1.9k
平均合併
14 小時 16 分鐘
30 天內合併 PR
6

描述

### Describe the bug

Enterprise users cannot authenticate ACP clients with the copilot ACP server. To authenticate as a GHE user using the copilot CLI natively, users must either:

1. Run `copilot login --host https://example.ghe.com`; or
2. Launch `copilot` then run the `/login` command and specify the domain.

However, the copilot ACP server does not reveal either of these possibilities in the `terminal-auth` value of the ACP initialization response:

```json
{"jsonrpc":"2.0","id":0,"result":{"protocolVersion":1,"agentCapabilities":{"loadSession":true,"mcpCapabilities":{"http":true,"sse":true},"promptCapabilities":{"image":true,"audio":false,"embeddedContext":true},"sessionCapabilities":{"list":{}}},"agentInfo":{"name":"Copilot","title":"Copilot","version":"1.0.42"},"authMethods":[{"id":"copilot-login","name":"Log in with Copilot CLI","description":"Run `copilot login` in the terminal","_meta":{"terminal-auth":{"command":"/Users//.local/bin/copilot","args":["login"],"label":"Copilot Login"}}}]}}
```

Please add support for enterprise users trying to authenticate their ACP clients.

### Affected version

GitHub Copilot CLI 1.0.42.

### Steps to reproduce the behavior

1. Open a code editor that supports ACP clients/servers (e.g., Zed or IntelliJ), then add GitHub Copilot from the agent server registry.
2. Open a new agent session with Copilot. The UI should expose a button to log in. Click that button.
3. Observe a new terminal open running `copilot login` and the usual github.com login flow.

### Expected behavior

Enterprise users should be able to log in with ACP clients. I can see two potential solutions:

1. Respect the `GH_HOST` or `COPILOT_GH_HOST` env vars, if set, during the `terminal-auth` flow.
2. Implement the env var [auth method type](https://agentclientprotocol.com/rfds/auth-methods#auth-method-types), so as to make explicit the use of `GH_TOKEN` and `COPILOT_GH_TOKEN` for this purpose.

### Additional context

_No response_

貢獻指南

開啟貢獻指南

研究方向

Start by tracing the ACP initialization response and its terminal-auth flow, then review how copilot login currently handles GH_HOST and COPILOT_GH_HOST. Compare the two proposed approaches with the ACP auth-method-types guidance. Done means an enterprise user can authenticate through an ACP client using the documented host or token environment variables.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
shell
領域
api, authentication, cli
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
冷清
描述清晰度
基本清楚
新手友好度
50/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。