github / github/copilot-cli

Xcode ACP custom agent: session/prompt always fails with "failed to produce a response" despite a working CLI and valid auth

未关闭
#4,227 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:non-interactive
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

Goal: Set up GitHub Copilot CLI as a custom agent in Xcode's Coding Intelligence settings via the Agent Client Protocol ( --acp ).

Setup:

• Copilot CLI 1.0.73, installed via Homebrew ( /opt/homebrew/bin/copilot )
• Xcode Coding Intelligence → custom agent config:
• Executable: /opt/homebrew/bin/copilot
• Arguments: --acp
• Interpreter: blank
• Environment Variables: blank (later also tried setting these — see below)
• copilot works fine standalone in Terminal (chat, auth all functional)

Symptom:
As soon as I send any prompt in Xcode (even plain text like "test" ), it fails with:

JSON-RPC request with ID JSONRPCID(rawValue: "D1C50172-B98A-4ABD-8550-6E06581D4B42", intValue: nil) failed to produce a response.

initialize , authenticate , and session/new all appear to succeed — only the prompt request fails, immediately, every time.

Troubleshooting already attempted (no change in any case):

1. Fully quit and relaunched Xcode.
2. Removed and re-added the custom agent entry.
3. Set GITHUB_TOKEN and COPILOT_GITHUB_TOKEN explicitly in Xcode's agent Environment Variables field (I have these set in my shell profile normally, suspecting Xcode's spawned process doesn't inherit them — no effect either way).
4. Confirmed Xcode's agent config only supports Executable + Arguments (stdio) — no URL/host/port field available to try TCP mode ( --acp --port ) as a workaround.
5. Don't have admin access, so can't use Console.app to pull crash/error logs for the copilot process.

Independent verification (works fine outside Xcode):
I manually replayed the full ACP handshake and prompt flow over raw stdio JSON-RPC against the same CLI binary/version:
initialize → authenticate → session/new → session/prompt , using both plain integer IDs and UUID-string IDs (matching the format Xcode uses). All four requests completed successfully, including a real streamed model response and stopReason: "end_turn" .

This strongly suggests the CLI's ACP server implementation is functioning correctly, and the issue lies in Xcode's ACP client — possibly around stdio pipe handling, a client-side capability/callback (e.g., permission requests) that isn't being answered, or some other difference between how Xcode spawns the process versus how Terminal/a manual harness does.

Ask: Any guidance on Xcode-side ACP client debugging, or known issues with this specific integration path, would be appreciated.

贡献指南

打开贡献指南

调研方向

从 Xcode Coding Intelligence 的自定义 agent 配置和 /opt/homebrew/bin/copilot --acp 入口点开始。在 Xcode 中重现 session/prompt,同时将其与成功的原始 stdio JSON-RPC 流程进行比较;当 Xcode 收到流式响应和 end_turn 结果,而不是 failed-to-produce-a-response 错误时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
github
领域
cli, devtools
Issue 类型
缺陷
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
需要澄清
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。